avoid multipart boundary conflict (#1753)

when nesting multipart, descendant parts currently may have the same boundary as the top-level multipart.
This commit is contained in:
TimTim
2017-08-10 16:07:19 +08:00
committed by Aleksandar Fabijanic
parent 453d5248f1
commit 5b7d9d2b18

View File

@@ -78,7 +78,7 @@ const std::string& MultipartWriter::boundary() const
std::string MultipartWriter::createBoundary()
{
std::string boundary("MIME_boundary_");
Random rnd;
static Random rnd;
NumberFormatter::appendHex(boundary, rnd.next(), 8);
NumberFormatter::appendHex(boundary, rnd.next(), 8);
return boundary;