diff options
author | lloyd <[email protected]> | 2009-06-09 22:43:15 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2009-06-09 22:43:15 +0000 |
commit | d2db951559bf4c17a658de55b48f7971885e53fd (patch) | |
tree | aef833185d2359bbb92f3fb9517c36e308fb78cb /src/entropy/dev_random | |
parent | a970f838ffcd050147cae46fb40b0d85e38453ce (diff) |
Changes to /dev/*random poller - read up to 48 bytes, and wait longer in select loop (up to a second)
Diffstat (limited to 'src/entropy/dev_random')
-rw-r--r-- | src/entropy/dev_random/es_dev.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/entropy/dev_random/es_dev.cpp b/src/entropy/dev_random/es_dev.cpp index 6fcdcbfea..e6033753d 100644 --- a/src/entropy/dev_random/es_dev.cpp +++ b/src/entropy/dev_random/es_dev.cpp @@ -103,10 +103,9 @@ Device_EntropySource::~Device_EntropySource() */ void Device_EntropySource::poll(Entropy_Accumulator& accum) { - u32bit go_get = std::min<u32bit>(accum.desired_remaining_bits() / 8, 16); - - u32bit read_wait_ms = go_get / 16; + u32bit go_get = std::min<u32bit>(accum.desired_remaining_bits() / 8, 48); + u32bit read_wait_ms = std::max<u32bit>(go_get, 1000); MemoryRegion<byte>& io_buffer = accum.get_io_buffer(go_get); for(size_t i = 0; i != devices.size(); ++i) |