Skip to content

Commit

Permalink
Fix another HTTP async cork bug
Browse files Browse the repository at this point in the history
  • Loading branch information
uNetworkingAB committed Apr 21, 2023
1 parent 67ed81b commit e5b1d3f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/HttpResponse.h
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,13 @@ struct HttpResponse : public AsyncSocket<SSL> {
* from here downwards. The corking is done with corkUnchecked() in upgrade. It steals cork. */
auto *newCorkedSocket = Super::corkedSocket();

/* If nobody is corked, it means most probably that large amounts of data has
* been written and the cork buffer has already been sent off and uncorked.
* We are done here, if that is the case. */
if (!newCorkedSocket) {
return this;
}

/* Timeout on uncork failure, since most writes will succeed while corked */
auto [written, failed] = static_cast<Super *>(newCorkedSocket)->uncork();

Expand Down

0 comments on commit e5b1d3f

Please sign in to comment.