File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -443,6 +443,10 @@ function connectLibsignal(
443443 logId ,
444444 keepalive
445445 ) ;
446+ if ( abortController . signal . aborted ) {
447+ resource . close ( 3000 , 'aborted' ) ;
448+ throw new Error ( 'Aborted' ) ;
449+ }
446450 // eslint-disable-next-line no-param-reassign
447451 resourceHolder . resource = resource ;
448452 return resource ;
@@ -454,7 +458,16 @@ function connectLibsignal(
454458 } ;
455459 return new AbortableProcess < LibsignalWebSocketResource > (
456460 `${ logId } .connect` ,
457- abortController ,
461+ {
462+ abort ( ) {
463+ if ( resourceHolder . resource != null ) {
464+ log . warn ( `${ logId } : closing socket` ) ;
465+ resourceHolder . resource . close ( 3000 , 'aborted' ) ;
466+ } else {
467+ abortController . abort ( ) ;
468+ }
469+ } ,
470+ } ,
458471 connectAsync ( )
459472 ) ;
460473}
You can’t perform that action at this time.
0 commit comments