Commit fe7c01a
authored
Fix cork() closing a WebSocket that was upgraded asynchronously (#1929)
cork() detected an in-handler upgrade with `this != newCorkedSocket`, but
us_socket_context_adopt_socket() reallocs the poll and returns the same pointer
when the WebSocket extension is not larger than the HttpResponse extension. The
upgrade then went undetected and cork() ran its HTTP connection-close logic on
the now-WebSocket socket, closing it right after open. Also compare the socket
context, which always changes on upgrade.1 parent 8a1f360 commit fe7c01a
1 file changed
Lines changed: 8 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
532 | 532 | | |
533 | 533 | | |
534 | 534 | | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
535 | 538 | | |
536 | 539 | | |
537 | 540 | | |
| |||
552 | 555 | | |
553 | 556 | | |
554 | 557 | | |
555 | | - | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
556 | 563 | | |
557 | 564 | | |
558 | 565 | | |
| |||
0 commit comments