mirror of
https://github.com/nodejs/node.git
synced 2026-11-24 21:50:36 -05:00
http: clear chunked state before invoking callbacks
Fixes a possible case where the chunked state is lost if updated through callback.
This commit is contained in:
1 parent
8a41d9b636
commit
487b7cbe0c
1 file changed
+3
-3
@@ -336,6 +336,9 @@ OutgoingMessage.prototype.uncork = function() {
|
||||
const len = this[kChunkedLength];
|
||||
const buf = this[kChunkedBuffer];
|
||||
|
||||
this[kChunkedBuffer].length = 0;
|
||||
this[kChunkedLength] = 0;
|
||||
|
||||
assert(this.chunkedEncoding);
|
||||
|
||||
let callbacks;
|
||||
@@ -353,9 +356,6 @@ OutgoingMessage.prototype.uncork = function() {
|
||||
callback(err);
|
||||
}
|
||||
} : null);
|
||||
|
||||
this[kChunkedBuffer].length = 0;
|
||||
this[kChunkedLength] = 0;
|
||||
};
|
||||
|
||||
OutgoingMessage.prototype.setTimeout = function setTimeout(msecs, callback) {
|
||||
|
||||
Reference in new issue
Block a user