From eb09b0644b3cb910d318d1d2a80cd2215b63cdcc Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Thu, 11 Aug 2011 23:39:38 +0200 Subject: [PATCH] http: destroy socket on error Needs further investigation, the test passed without `--use-uv`. Fixes failing test: test/simple/test-http-dns-fail.js --- lib/http2.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/http2.js b/lib/http2.js index be2c9596ebc..8a5d83adfe4 100644 --- a/lib/http2.js +++ b/lib/http2.js @@ -1088,6 +1088,7 @@ ClientRequest.prototype.onSocket = function(socket) { // and we need to make sure we don't double-fire the error event. req._hadError = true; parser.finish(); + socket.destroy(); } socket.on('error', errorListener);