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 Aug 4, 2015
1 parent ef2c8cd commit 11e4249
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 11e4249

Please sign in to comment.