Skip to content

Commit

Permalink
Fix repeated write issue under SSL
Browse files Browse the repository at this point in the history
  • Loading branch information
thefallentree committed Jun 4, 2023
1 parent 6661846 commit 7182371
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/comm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -662,13 +662,13 @@ int flush_message(interactive_t *ip) {
auto *output = bufferevent_get_output(ip->ev_buffer);
auto len = evbuffer_get_length(output);
if (len > 0) {
evbuffer_unfreeze(output, 1);
evbuffer_freeze(output, 1);
auto *data = evbuffer_pullup(output, len);
auto wrote = SSL_write(ssl, data, len);
evbuffer_unfreeze(output, 1); // must left unfreezed: https://github.com/libevent/libevent/issues/1469
if (wrote > 0) {
evbuffer_drain(output, wrote);
}
evbuffer_freeze(output, 1);
return wrote > 0;
}
} else {
Expand Down

0 comments on commit 7182371

Please sign in to comment.