Browse Source

http_server: `prefinish` vs `finish`

Do not detach the socket from the response until all data is actually
sent to the other side.

See: https://github.com/iojs/io.js/pull/1373
PR-URL: https://github.com/nodejs/io.js/pull/1411
Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
v4.0.0-rc
Fedor Indutny 10 years ago
committed by Rod Vagg
parent
commit
11e4249227
  1. 2
      lib/_http_server.js

2
lib/_http_server.js

@ -431,7 +431,7 @@ function connectionListener(socket) {
// When we're finished writing the response, check if this is the last
// respose, if so destroy the socket.
res.on('prefinish', resOnFinish);
res.on('finish', resOnFinish);
function resOnFinish() {
// Usually the first incoming element should be our request. it may
// be that in the case abortIncoming() was called that the incoming

Loading…
Cancel
Save