summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell Branca <chewbranca@apache.org>2017-09-26 17:47:13 +0000
committerRussell Branca <chewbranca@apache.org>2017-09-26 17:47:13 +0000
commitf191d62974da073dcf0c6c048b562a9bf27a30f5 (patch)
tree4d9de1f1f363a0ff020648365ff4f73da5df9912
parent32ccd1b20e12094c75a97d068fddb266e5fb5105 (diff)
downloadcouchdb-random-seed-chttpd-pids.tar.gz
Ensure chttpd pids have a proper random seedarchive/random-seed-chttpd-pidsrandom-seed-chttpd-pids
-rw-r--r--src/chttpd/src/chttpd.erl4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/chttpd/src/chttpd.erl b/src/chttpd/src/chttpd.erl
index 6be0d1848..fd7de8e21 100644
--- a/src/chttpd/src/chttpd.erl
+++ b/src/chttpd/src/chttpd.erl
@@ -154,6 +154,10 @@ handle_request_int(MochiReq) ->
ok = mochiweb_socket:setopts(MochiReq:get(socket), SocketOpts)
end,
+ % Set random seed
+ <<A:32, B:32, C:32>> = crypto:rand_bytes(12),
+ random:seed({A,B,C}),
+
% for the path, use the raw path with the query string and fragment
% removed, but URL quoting left intact
RawUri = MochiReq:get(raw_path),