Skip to content
Open
Changes from 1 commit
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
8 changes: 7 additions & 1 deletion lib/_http_outgoing.js
Original file line number Diff line number Diff line change
Expand Up @@ -287,14 +287,20 @@ OutgoingMessage.prototype.uncork = function uncork() {
callbacks.push(buf[n + 2]);
}
}
this._send(crlf_buf, null, callbacks.length ? (err) => {
const ret = this._send(crlf_buf, null, callbacks.length ? (err) => {
for (const callback of callbacks) {
callback(err);
}
} : null);

this[kChunkedBuffer].length = 0;
this[kChunkedLength] = 0;

// If we successfully flushed and had pending drain, emit it
if (ret && this[kNeedDrain]) {
this[kNeedDrain] = false;
this.emit('drain');
}
};

OutgoingMessage.prototype.setTimeout = function setTimeout(msecs, callback) {
Expand Down