Skip to content

Commit

Permalink
http_server: prefinish vs finish
Browse files Browse the repository at this point in the history
Do not detach the socket from the response until all data is actually
sent to the other side.

See: nodejs#1373
  • Loading branch information
indutny committed Apr 13, 2015
1 parent b6b37a5 commit 2811b0c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/_http_server.js
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,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
Expand Down

0 comments on commit 2811b0c

Please sign in to comment.