better random payload code

This commit is contained in:
Brian Tierney 2009-11-13 15:26:49 +00:00
parent c44d17d1f7
commit 9e1f731a44
2 changed files with 4 additions and 3 deletions

View File

@ -1,6 +1,7 @@
iperf3 is a complete rewrite of iperf2, with a goal of making the
code smaller and easier to maintain.
code smaller and easier to maintain, and to support a client library
verion of the functionality.
Main designer: Jon Dugan, ESnet

View File

@ -768,9 +768,9 @@ iperf_new_stream(struct iperf_test * testp)
sp->result = (struct iperf_stream_result *) malloc(sizeof(struct iperf_stream_result));
/* fill in buffer with random stuff */
/* XXX: probably better to use something truely random here */
srandom (time(0));
for (i = 0; i < testp->default_settings->blksize; i++)
sp->buffer[i] = i % 255;
sp->buffer[i] = random();
sp->socket = -1;