File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -68,9 +68,8 @@ class HTTPHandler {
6868 }
6969
7070 onError ( err ) {
71- this . res
72- . off ( 'drain' , this . resume )
73- . off ( 'close' , this . abort )
71+ this . res . off ( 'close' , this . abort )
72+ this . res . off ( 'drain' , this . resume )
7473 this . callback ( err )
7574 }
7675}
@@ -83,6 +82,7 @@ class WSHandler {
8382
8483 this . socket = socket
8584 this . head = head
85+ this . abort = null
8686 this . promise = new Promise ( ( resolve , reject ) => {
8787 this . callback = err => err ? reject ( err ) : resolve ( )
8888 } )
@@ -92,6 +92,7 @@ class WSHandler {
9292 if ( this . socket . destroyed ) {
9393 abort ( )
9494 } else {
95+ this . abort = abort
9596 this . socket . on ( 'close' , abort )
9697 }
9798 }
@@ -127,6 +128,7 @@ class WSHandler {
127128 }
128129
129130 onError ( err ) {
131+ this . socket . off ( 'close' , this . abort )
130132 this . callback ( err )
131133 }
132134}
You can’t perform that action at this time.
0 commit comments