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 e38b12d commit fa4615f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/HTTPserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -838,7 +838,6 @@ HTTPserver::HTTPserver(const char *_docs_dir, const char *_scripts_dir) {
bool use_http = true;
struct stat statsBuf;
int stat_rc;

static char *http_options[] = {
(char*)"listening_ports", ports,
(char*)"enable_directory_listing", (char*)"no",
Expand All @@ -848,6 +847,11 @@ HTTPserver::HTTPserver(const char *_docs_dir, const char *_scripts_dir) {
NULL, NULL, NULL, NULL,
NULL
};
struct timeval tv;

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

docs_dir = strdup(_docs_dir), scripts_dir = strdup(_scripts_dir);
httpserver = this;
Expand Down

1 comment on commit fa4615f

@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.