File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -1308,23 +1308,23 @@ function socketOnClose() {
13081308
13091309 websocket . _readyState = WebSocket . CLOSING ;
13101310
1311- let chunk ;
1312-
13131311 //
13141312 // The close frame might not have been received or the `'end'` event emitted,
13151313 // for example, if the socket was destroyed due to an error. Ensure that the
13161314 // `receiver` stream is closed after writing any remaining buffered data to
13171315 // it. If the readable side of the socket is in flowing mode then there is no
1318- // buffered data as everything has been already written and `readable.read()`
1319- // will return `null`. If instead, the socket is paused, any possible buffered
1320- // data will be read as a single chunk.
1316+ // buffered data as everything has been already written. If instead, the
1317+ // socket is paused, any possible buffered data will be read as a single
1318+ // chunk.
13211319 //
13221320 if (
13231321 ! this . _readableState . endEmitted &&
13241322 ! websocket . _closeFrameReceived &&
13251323 ! websocket . _receiver . _writableState . errorEmitted &&
1326- ( chunk = websocket . _socket . read ( ) ) !== null
1324+ this . _readableState . length !== 0
13271325 ) {
1326+ const chunk = this . read ( this . _readableState . length ) ;
1327+
13281328 websocket . _receiver . write ( chunk ) ;
13291329 }
13301330
You can’t perform that action at this time.
0 commit comments