File tree Expand file tree Collapse file tree 2 files changed +2
-6
lines changed
Expand file tree Collapse file tree 2 files changed +2
-6
lines changed Original file line number Diff line number Diff line change @@ -141,11 +141,6 @@ struct AsyncSocket {
141141 getLoopData ()->corkedSocket = this ;
142142 }
143143
144- /* Returns the corked socket or nullptr */
145- void *corkedSocket () {
146- return getLoopData ()->corkedSocket ;
147- }
148-
149144 /* Returns wheter we are corked or not */
150145 bool isCorked () {
151146 return getLoopData ()->corkedSocket == this ;
Original file line number Diff line number Diff line change @@ -496,13 +496,14 @@ struct HttpResponse : public AsyncSocket<SSL> {
496496 /* Corks the response if possible. Leaves already corked socket be. */
497497 HttpResponse *cork (MoveOnlyFunction<void ()> &&handler) {
498498 if (!Super::isCorked () && Super::canCork ()) {
499+ LoopData *loopData = Super::getLoopData ();
499500 Super::cork ();
500501 handler ();
501502
502503 /* The only way we could possibly have changed the corked socket during handler call, would be if
503504 * the HTTP socket was upgraded to WebSocket and caused a realloc. Because of this we cannot use "this"
504505 * from here downwards. The corking is done with corkUnchecked() in upgrade. It steals cork. */
505- auto *newCorkedSocket = Super:: corkedSocket() ;
506+ auto *newCorkedSocket = loopData-> corkedSocket ;
506507
507508 /* If nobody is corked, it means most probably that large amounts of data has
508509 * been written and the cork buffer has already been sent off and uncorked.
You can’t perform that action at this time.
0 commit comments