mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-29 20:59:45 +01:00
fixed GH #2038: Poco::Net::MultipartWriter::createBoundary() always returns the same string.
This commit is contained in:
@@ -48,7 +48,7 @@ MultipartWriter::~MultipartWriter()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void MultipartWriter::nextPart(const MessageHeader& header)
|
void MultipartWriter::nextPart(const MessageHeader& header)
|
||||||
{
|
{
|
||||||
if (_firstPart)
|
if (_firstPart)
|
||||||
@@ -60,7 +60,7 @@ void MultipartWriter::nextPart(const MessageHeader& header)
|
|||||||
_ostr << "\r\n";
|
_ostr << "\r\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void MultipartWriter::close()
|
void MultipartWriter::close()
|
||||||
{
|
{
|
||||||
_ostr << "\r\n--" << _boundary << "--\r\n";
|
_ostr << "\r\n--" << _boundary << "--\r\n";
|
||||||
@@ -77,6 +77,7 @@ std::string MultipartWriter::createBoundary()
|
|||||||
{
|
{
|
||||||
std::string boundary("MIME_boundary_");
|
std::string boundary("MIME_boundary_");
|
||||||
Random rnd;
|
Random rnd;
|
||||||
|
rnd.seed();
|
||||||
NumberFormatter::appendHex(boundary, rnd.next(), 8);
|
NumberFormatter::appendHex(boundary, rnd.next(), 8);
|
||||||
NumberFormatter::appendHex(boundary, rnd.next(), 8);
|
NumberFormatter::appendHex(boundary, rnd.next(), 8);
|
||||||
return boundary;
|
return boundary;
|
||||||
|
|||||||
Reference in New Issue
Block a user