Skip to content

Commit

Permalink
Added code to randomize values returned by rand()
Browse files Browse the repository at this point in the history
  • Loading branch information
lucaderi committed Jun 17, 2018
1 parent fae12f6 commit 30610bd
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/HTTPserver.cpp
Expand Up @@ -864,7 +864,12 @@ HTTPserver::HTTPserver(const char *_docs_dir, const char *_scripts_dir) {
bool use_http = true;
struct stat statsBuf;
int stat_rc;
struct timeval tv;

/* Randomize data */
gettimeofday(&tv, NULL);
srand(tv.tv_sec + tv.tv_usec);

static char *http_options[] = {
(char*)"listening_ports", ports,
(char*)"enable_directory_listing", (char*)"no",
Expand Down

1 comment on commit 30610bd

@lucaderi
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.