fixed GH #2038: Poco::Net::MultipartWriter::createBoundary() always returns the same string.

This commit is contained in:
Günter Obiltschnig 2017-12-06 11:10:06 +01:00
parent 7e4ee52226
commit db89dff111

View File

@ -48,7 +48,7 @@ MultipartWriter::~MultipartWriter()
{
}
void MultipartWriter::nextPart(const MessageHeader& header)
{
if (_firstPart)
@ -60,7 +60,7 @@ void MultipartWriter::nextPart(const MessageHeader& header)
_ostr << "\r\n";
}
void MultipartWriter::close()
{
_ostr << "\r\n--" << _boundary << "--\r\n";
@ -76,7 +76,8 @@ const std::string& MultipartWriter::boundary() const
std::string MultipartWriter::createBoundary()
{
std::string boundary("MIME_boundary_");
static Random rnd;
Random rnd;
rnd.seed();
NumberFormatter::appendHex(boundary, rnd.next(), 8);
NumberFormatter::appendHex(boundary, rnd.next(), 8);
return boundary;