diff --git a/src/HttpResponse.h b/src/HttpResponse.h index 5955f6d..af8b4fc 100644 --- a/src/HttpResponse.h +++ b/src/HttpResponse.h @@ -502,6 +502,13 @@ public: * 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(newCorkedSocket)->uncork();