Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/OutgoingFrameStream.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ function service(stream) {
if (stream._destinationFinished) {
const error = new Error('cannot send frame on closed stream');
stream._frame.emit('error', error);
dequeue(stream);
setTimeout(dequeue.bind(this, stream), 0);
return;
}

Expand All @@ -226,12 +226,12 @@ function service(stream) {

if (!error) {
// Attempt next write operation
service(stream);
setTimeout(service.bind(this, stream), 0);
}
else {
// Send errors to subsequent write cbs and let the next
// frame attempt to write and cause an error
dequeue(stream);
setTimeout(dequeue.bind(this, stream), 0);
}
}

Expand Down