diff options
author | Anto Aravinth <anto.aravinth.cse@gmail.com> | 2018-08-21 19:50:04 +0530 |
---|---|---|
committer | Matteo Collina <hello@matteocollina.com> | 2018-08-22 09:48:09 +0200 |
commit | 413a7e1deabaf5f0daa633df6e594f8cc1503a12 (patch) | |
tree | 4c95c5b3553a03a56e433cc3b20653c179cd19fe /lib/_http_outgoing.js | |
parent | 98cf84f2c9d13386362386eac6089bc356c017b2 (diff) | |
download | android-node-v8-413a7e1deabaf5f0daa633df6e594f8cc1503a12.tar.gz android-node-v8-413a7e1deabaf5f0daa633df6e594f8cc1503a12.tar.bz2 android-node-v8-413a7e1deabaf5f0daa633df6e594f8cc1503a12.zip |
http: adding doc and debug for calling empty string on write function
PR-URL: https://github.com/nodejs/node/pull/22118
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Diffstat (limited to 'lib/_http_outgoing.js')
-rw-r--r-- | lib/_http_outgoing.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/_http_outgoing.js b/lib/_http_outgoing.js index 7fe4e2133b..67d0090d7d 100644 --- a/lib/_http_outgoing.js +++ b/lib/_http_outgoing.js @@ -599,7 +599,10 @@ function write_(msg, chunk, encoding, callback, fromEnd) { // If we get an empty string or buffer, then just do nothing, and // signal the user to keep writing. - if (chunk.length === 0) return true; + if (chunk.length === 0) { + debug('received empty string or buffer and waiting for more input'); + return true; + } if (!fromEnd && msg.connection && !msg[kIsCorked]) { msg.connection.cork(); |