Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

server: terminate connection when on socket close #8

Merged
merged 1 commit into from

2 participants

@indutny

Probable fix for #3.

The thing is that you're not handling spdy socket's close event, you only push data from server to client, regardless of client's status. Secure proxy may also be affected by this, by I haven't checked it yet.

@igrigorik igrigorik merged commit 235b265 into igrigorik:master
@igrigorik
Owner

Thanks, will give it a try.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 13, 2012
  1. @indutny
This page is out of date. Refresh to see the latest.
Showing with 7 additions and 0 deletions.
  1. +7 −0 lib/server.js
View
7 lib/server.js
@@ -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) {
@@ -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) {
Something went wrong with that request. Please try again.