diff options
author | Russell Branca <chewbranca@apache.org> | 2017-09-26 17:47:13 +0000 |
---|---|---|
committer | Russell Branca <chewbranca@apache.org> | 2017-09-26 17:47:13 +0000 |
commit | f191d62974da073dcf0c6c048b562a9bf27a30f5 (patch) | |
tree | 4d9de1f1f363a0ff020648365ff4f73da5df9912 | |
parent | 32ccd1b20e12094c75a97d068fddb266e5fb5105 (diff) | |
download | couchdb-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.erl | 4 |
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), |