diff --git a/lib/net.js b/lib/net.js index 0b1a81d321..1246901f81 100644 --- a/lib/net.js +++ b/lib/net.js @@ -505,11 +505,7 @@ function onread(buffer, offset, length) { } else { debug('error', errno); // Error - if (errno == 'ECONNRESET') { - self._destroy(); - } else { - self._destroy(errnoException(errno, 'read')); - } + self._destroy(errnoException(errno, 'read')); } } diff --git a/test/pummel/test-https-ci-reneg-attack.js b/test/pummel/test-https-ci-reneg-attack.js index 83b76b4585..f7b0ac5d95 100644 --- a/test/pummel/test-https-ci-reneg-attack.js +++ b/test/pummel/test-https-ci-reneg-attack.js @@ -89,7 +89,7 @@ function test(next) { var closed = false; child.stdin.on('error', function(err) { - assert.equal(err.code, 'EPIPE'); + assert.equal(err.code, 'ECONNRESET'); closed = true; }); child.stdin.on('close', function() { diff --git a/test/pummel/test-tls-ci-reneg-attack.js b/test/pummel/test-tls-ci-reneg-attack.js index 778e288ca7..b077ef4b2f 100644 --- a/test/pummel/test-tls-ci-reneg-attack.js +++ b/test/pummel/test-tls-ci-reneg-attack.js @@ -87,7 +87,7 @@ function test(next) { var closed = false; child.stdin.on('error', function(err) { - assert.equal(err.code, 'EPIPE'); + assert.equal(err.code, 'ECONNRESET'); closed = true; }); child.stdin.on('close', function() {