0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00

http: destroy socket on error

Needs further investigation, the test passed without `--use-uv`.

Fixes failing test:
  test/simple/test-http-dns-fail.js
This commit is contained in:
Ben Noordhuis 2011-08-11 23:39:38 +02:00
parent 3d4ae3ab4d
commit eb09b0644b

View File

@ -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);