Maintain outgoing bytes queued count
This commit is contained in:
@@ -43,6 +43,7 @@ void Connection::appendMessage(std::string_view s, bool copy_to_arena) {
|
||||
} else {
|
||||
messages_.push_back(s);
|
||||
}
|
||||
outgoing_bytes_queued_ += s.size();
|
||||
}
|
||||
|
||||
int Connection::readBytes(char *buf, size_t buffer_size) {
|
||||
@@ -104,6 +105,7 @@ bool Connection::writeBytes() {
|
||||
|
||||
// Handle partial writes by updating string_view data/size
|
||||
size_t bytes_written = static_cast<size_t>(w);
|
||||
outgoing_bytes_queued_ -= bytes_written;
|
||||
while (bytes_written > 0 && !messages_.empty()) {
|
||||
auto &front = messages_.front();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user