Skip to content

Commit

Permalink
net: send any pending writes if possible
Browse files Browse the repository at this point in the history
  • Loading branch information
Chilledheart committed May 19, 2024
1 parent a37399f commit 5482168
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/cli/cli_connection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,8 @@ void CliConnection::SendIfNotProcessing() {
DCHECK(!http2_in_recv_callback_);
if (!processing_responses_) {
processing_responses_ = true;
adapter_->Send();
while (adapter_->want_write() && adapter_->Send() == 0) {
}
processing_responses_ = false;
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/server/server_connection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,8 @@ void ServerConnection::SendIfNotProcessing() {
DCHECK(!http2_in_recv_callback_);
if (!processing_responses_) {
processing_responses_ = true;
adapter_->Send();
while (adapter_->want_write() && adapter_->Send() == 0) {
}
processing_responses_ = false;
}
}
Expand Down

0 comments on commit 5482168

Please sign in to comment.