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 {
75
75
packetTexts . push ( packetText ) ;
76
76
}
77
77
} ) ;
78
- this . recvBuffer . splice ( 0 , this . recvBuffer . length , rest [ - 1 ] ) ;
78
+ this . recvBuffer . splice ( 0 , this . recvBuffer . length , rest . at ( - 1 ) ! ) ;
79
79
}
80
80
81
81
// Second, process the packets. This involves steps that may throw errors, so we catch
@@ -87,11 +87,14 @@ export class NodeStreamLink implements ILink {
87
87
const packet = JSON . parse ( packetText ) as wire . ServerPacket ;
88
88
try {
89
89
await this . onRecv ( packet ) ;
90
+ this . stream . resume ( ) ;
90
91
} catch ( error ) {
91
92
console . error ( 'uncaught error in onRecv' , error ) ;
93
+ return ; // leave paused
92
94
}
93
95
} catch ( error ) {
94
- console . error ( 'malformed JSON' , packetText ) ;
96
+ console . error ( 'malformed JSON: ' , packetText ) ;
97
+ return ; // leave paused
95
98
}
96
99
}
97
100
this . stream . resume ( ) ;
You can’t perform that action at this time.
0 commit comments