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: #1373
PR-URL: #1411
Reviewed-By: Chris Dickinson <[email protected]>
Reviewed-By: Jeremiah Senkpiel <[email protected]>
  • Loading branch information
indutny authored and rvagg committed Jul 22, 2015
1 parent acac161 commit ce1acd5
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 @@ -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
Expand Down

0 comments on commit ce1acd5

Please sign in to comment.