Commit 667a5950 authored by Dominik Charousset's avatar Dominik Charousset

Discard data on disconnected scribes

parent a4df55f6
...@@ -84,6 +84,13 @@ message broker::scribe::disconnect_message() { ...@@ -84,6 +84,13 @@ message broker::scribe::disconnect_message() {
void broker::scribe::consume(const void*, size_t num_bytes) { void broker::scribe::consume(const void*, size_t num_bytes) {
CAF_LOG_TRACE(CAF_ARG(num_bytes)); CAF_LOG_TRACE(CAF_ARG(num_bytes));
if (m_disconnected) {
// we are already disconnected from the broker while the multiplexer
// did not yet remove the socket, this can happen if an IO event causes
// the broker to call close_all() while the pollset contained
// further activities for the broker
return;
}
auto& buf = rd_buf(); auto& buf = rd_buf();
buf.resize(num_bytes); // make sure size is correct buf.resize(num_bytes); // make sure size is correct
read_msg().buf.swap(buf); // swap into message read_msg().buf.swap(buf); // swap into message
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment