diff --git a/src/connection.cpp b/src/connection.cpp index 55550e1..31bd198 100644 --- a/src/connection.cpp +++ b/src/connection.cpp @@ -295,7 +295,7 @@ uint32_t Connection::write_bytes() { // Check if queue is empty and remove EPOLLOUT interest { std::lock_guard lock(mutex_); - if (message_queue_.empty()) { + if (message_queue_.empty() && pending_response_queue_.empty()) { auto server = server_.lock(); if (server) { struct epoll_event event;