aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlloyd <[email protected]>2007-10-19 01:23:21 +0000
committerlloyd <[email protected]>2007-10-19 01:23:21 +0000
commitd1ad07ba94372ba16ecba6d674338a554107b308 (patch)
tree8c30120f78d6da4ec71ef5f6393bec617bd69ef4
parent83784f32b65b822636355eafa0ba744456cdc753 (diff)
The flag that we had run a slow pollwas only set if one was forced from
a fast poll request, and not if a slow poll was specifically requested. So a sequence of slow and then fast polls would trigger a second slow poll, which was not desired.
-rw-r--r--src/buf_es.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/buf_es.cpp b/src/buf_es.cpp
index 409a98297..b0ae98865 100644
--- a/src/buf_es.cpp
+++ b/src/buf_es.cpp
@@ -36,6 +36,7 @@ u32bit Buffered_EntropySource::fast_poll(byte out[], u32bit length)
u32bit Buffered_EntropySource::slow_poll(byte out[], u32bit length)
{
do_slow_poll();
+ done_slow_poll = true;
return copy_out(out, length, buffer.size());
}
@@ -53,6 +54,7 @@ void Buffered_EntropySource::do_fast_poll()
void Buffered_EntropySource::add_bytes(const void* entropy_ptr, u32bit length)
{
const byte* bytes = static_cast<const byte*>(entropy_ptr);
+
while(length)
{
u32bit copied = std::min(length, buffer.size() - write_pos);