Skip to content

Commit

Permalink
server: terminate connection when on socket close
Browse files Browse the repository at this point in the history
  • Loading branch information
indutny committed Oct 13, 2012
1 parent 270929f commit 886ae5c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ var SPDYProxy = function(options) {
// write out headers to handle redirects
res.writeHead(rres.statusCode, '', rres.headers);
rres.pipe(res);

// Res could not write, but it could close connection
res.pipe(rres);
});

rreq.on('error', function(e) {
Expand All @@ -55,6 +58,10 @@ var SPDYProxy = function(options) {
});

req.pipe(rreq);

// Just in case if socket will be shutdown before http.request will connect
// to the server.
res.pipe(rreq);
}

function handleSecure(req, socket) {
Expand Down

0 comments on commit 886ae5c

Please sign in to comment.