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
  • Loading branch information
indutny committed Apr 15, 2015
1 parent 7170741 commit 6b03dd8
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 6b03dd8

Please sign in to comment.