Commit 214cf7b2 authored by Claudio Saavedra's avatar Claudio Saavedra

SoupMultipart: remove usage of GTimeVal and g_get_current_time()

Use an array of random integers instead, which is more than enough
to generate a random boundary.
parent e852f4a0
Pipeline #106591 passed with stage
in 1 minute and 10 seconds
......@@ -61,18 +61,10 @@ soup_multipart_new_internal (char *mime_type, char *boundary)
static char *
generate_boundary (void)
static int counter;
struct {
GTimeVal timeval;
int counter;
} data;
/* avoid valgrind warning */
if (sizeof (data) != sizeof (data.timeval) + sizeof (data.counter))
memset (&data, 0, sizeof (data));
g_get_current_time (&data.timeval);
data.counter = counter++;
guint32 data[2];
data[0] = g_random_int ();
data[1] = g_random_int ();
/* The maximum boundary string length is 69 characters, and a
* stringified SHA256 checksum is 64 bytes long.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment