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>
This commit is contained in:
parent
ef2c8cd4ec
commit
11e4249227
@ -431,7 +431,7 @@ function connectionListener(socket) {
|
|||||||
|
|
||||||
// When we're finished writing the response, check if this is the last
|
// When we're finished writing the response, check if this is the last
|
||||||
// respose, if so destroy the socket.
|
// respose, if so destroy the socket.
|
||||||
res.on('prefinish', resOnFinish);
|
res.on('finish', resOnFinish);
|
||||||
function resOnFinish() {
|
function resOnFinish() {
|
||||||
// Usually the first incoming element should be our request. it may
|
// Usually the first incoming element should be our request. it may
|
||||||
// be that in the case abortIncoming() was called that the incoming
|
// be that in the case abortIncoming() was called that the incoming
|
||||||
|
Loading…
x
Reference in New Issue
Block a user