File tree Expand file tree Collapse file tree 1 file changed +7
-8
lines changed
Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -793,23 +793,22 @@ function onReadableStreamEnd() {
793793 }
794794}
795795
796-
797796Socket . prototype . destroySoon = function ( ) {
798- if ( this . writable )
799- this . end ( ) ;
797+ if ( this . destroyingOnFinish ) return ;
798+
799+ if ( this . writable ) this . end ( ) ;
800800
801- if ( this . writableFinished )
801+ if ( this . writableFinished ) {
802802 this . destroy ( ) ;
803- else if ( ! this . _destroyingOnFinish ) {
804- this . _destroyingOnFinish = true ;
803+ } else {
804+ this . destroyingOnFinish = true ;
805805 this . once ( 'finish' , ( ) => {
806- this . _destroyingOnFinish = false ;
806+ this . destroyingOnFinish = false ;
807807 this . destroy ( ) ;
808808 } ) ;
809809 }
810810} ;
811811
812-
813812Socket . prototype . _destroy = function ( exception , cb ) {
814813 debug ( 'destroy' ) ;
815814
You can’t perform that action at this time.
0 commit comments