fix: prevent Target closed errors on streams (#7728)
This change prevents Target closed errors when reading streams which were caused by ending the stream before IO.close returns.
This commit is contained in:
parent
07febca04b
commit
5b792de7a9
@ -364,9 +364,9 @@ async function getReadableFromProtocolStream(
|
|||||||
const response = await client.send('IO.read', { handle, size });
|
const response = await client.send('IO.read', { handle, size });
|
||||||
this.push(response.data, response.base64Encoded ? 'base64' : undefined);
|
this.push(response.data, response.base64Encoded ? 'base64' : undefined);
|
||||||
if (response.eof) {
|
if (response.eof) {
|
||||||
this.push(null);
|
|
||||||
eof = true;
|
eof = true;
|
||||||
await client.send('IO.close', { handle });
|
await client.send('IO.close', { handle });
|
||||||
|
this.push(null);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user