aboutsummaryrefslogtreecommitdiffstats
path: root/src/entropy/dev_random/es_dev.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2009-06-09 22:43:15 +0000
committerlloyd <[email protected]>2009-06-09 22:43:15 +0000
commitd2db951559bf4c17a658de55b48f7971885e53fd (patch)
treeaef833185d2359bbb92f3fb9517c36e308fb78cb /src/entropy/dev_random/es_dev.cpp
parenta970f838ffcd050147cae46fb40b0d85e38453ce (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/es_dev.cpp')
-rw-r--r--src/entropy/dev_random/es_dev.cpp5
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)