http: fix stalled pipeline bug
authorFedor Indutny <fedor@indutny.com>
Tue, 13 Oct 2015 06:16:39 +0000 (02:16 -0400)
committerJames M Snell <jasnell@gmail.com>
Thu, 29 Oct 2015 15:38:40 +0000 (08:38 -0700)
commit0427cdf0943c5bfea4a783d27dd4d0862370c5f0
tree158deacb922e1bf5b912e8f0682df500f9cde6f1
parent4bac5d9ddf3e557ea275c22c2cc0a351ae4056a8
http: fix stalled pipeline bug

This is a two-part fix:

- Fix pending data notification in `OutgoingMessage` to notify server
  about flushed data too
- Fix pause/resume behavior for the consumed socket. `resume` event is
  emitted on a next tick, and `socket._paused` can already be `true` at
  this time. Pause the socket again to avoid PAUSED error on parser.

Fix: https://github.com/nodejs/node/issues/3332
PR-URL: https://github.com/nodejs/node/pull/3342
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
lib/_http_common.js
lib/_http_outgoing.js
lib/_http_server.js
src/node_http_parser.cc
test/parallel/test-http-pipeline-regr-3332.js [new file with mode: 0644]