File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -75,7 +75,7 @@ export class NodeStreamLink implements ILink {
7575 packetTexts . push ( packetText ) ;
7676 }
7777 } ) ;
78- this . recvBuffer . splice ( 0 , this . recvBuffer . length , rest [ - 1 ] ) ;
78+ this . recvBuffer . splice ( 0 , this . recvBuffer . length , rest . at ( - 1 ) ! ) ;
7979 }
8080
8181 // Second, process the packets. This involves steps that may throw errors, so we catch
@@ -87,11 +87,14 @@ export class NodeStreamLink implements ILink {
8787 const packet = JSON . parse ( packetText ) as wire . ServerPacket ;
8888 try {
8989 await this . onRecv ( packet ) ;
90+ this . stream . resume ( ) ;
9091 } catch ( error ) {
9192 console . error ( 'uncaught error in onRecv' , error ) ;
93+ return ; // leave paused
9294 }
9395 } catch ( error ) {
94- console . error ( 'malformed JSON' , packetText ) ;
96+ console . error ( 'malformed JSON: ' , packetText ) ;
97+ return ; // leave paused
9598 }
9699 }
97100 this . stream . resume ( ) ;
You can’t perform that action at this time.
0 commit comments