diff options
author | lloyd <[email protected]> | 2015-03-18 10:10:09 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2015-03-18 10:10:09 +0000 |
commit | 1c5c28f2e8a605c0429bacd49fc8cacbbb50377a (patch) | |
tree | cd955920104c7d1d3db0cd56af7d350a04124de9 /src/lib/entropy/egd | |
parent | 827080864508e03d796c5138b34d563977d693bb (diff) |
Remove the shared IO buffer from EntropySource_Accumulator.
Instead each source that needs a buffer maintains their own.
Diffstat (limited to 'src/lib/entropy/egd')
-rw-r--r-- | src/lib/entropy/egd/es_egd.cpp | 6 | ||||
-rw-r--r-- | src/lib/entropy/egd/es_egd.h | 1 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/lib/entropy/egd/es_egd.cpp b/src/lib/entropy/egd/es_egd.cpp index 1595935d2..728104b44 100644 --- a/src/lib/entropy/egd/es_egd.cpp +++ b/src/lib/entropy/egd/es_egd.cpp @@ -141,15 +141,15 @@ void EGD_EntropySource::poll(Entropy_Accumulator& accum) std::lock_guard<std::mutex> lock(m_mutex); - secure_vector<byte>& io_buffer = accum.get_io_buffer(READ_ATTEMPT); + m_buf.resize(READ_ATTEMPT); for(size_t i = 0; i != sockets.size(); ++i) { - size_t got = sockets[i].read(&io_buffer[0], io_buffer.size()); + size_t got = sockets[i].read(&m_buf[0], m_buf.size()); if(got) { - accum.add(&io_buffer[0], got, 6); + accum.add(&m_buf[0], got, 6); break; } } diff --git a/src/lib/entropy/egd/es_egd.h b/src/lib/entropy/egd/es_egd.h index 3f46bc64f..0c9caec66 100644 --- a/src/lib/entropy/egd/es_egd.h +++ b/src/lib/entropy/egd/es_egd.h @@ -44,6 +44,7 @@ class EGD_EntropySource : public EntropySource std::mutex m_mutex; std::vector<EGD_Socket> sockets; + secure_vector<byte> m_buf; }; } |