From c4454d2efc144ed0ba2d1d8d3585932e58b869ae Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Mon, 22 Aug 2011 19:06:42 -0700 Subject: [PATCH] net_uv: Don't error on ECONNRESET Fixes #1571. --- Makefile | 1 + lib/net_uv.js | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index e53a4ffd107..0d5ae5f11a3 100644 --- a/Makefile +++ b/Makefile @@ -191,6 +191,7 @@ UVTEST += simple/test-readuint UVTEST += simple/test-regress-GH-746 UVTEST += simple/test-regress-GH-819 UVTEST += simple/test-regress-GH-897 +UVTEST += simple/test-regress-GH-1531 UVTEST += simple/test-regression-object-prototype UVTEST += simple/test-repl UVTEST += simple/test-require-cache diff --git a/lib/net_uv.js b/lib/net_uv.js index 7a97e46e21e..d6f6d231f37 100644 --- a/lib/net_uv.js +++ b/lib/net_uv.js @@ -316,7 +316,11 @@ function onread(buffer, offset, length) { if (self.onend) self.onend(); } else { // Error - self.destroy(errnoException(errno, 'read')); + if (errno == 'ECONNRESET') { + self.destroy(); + } else { + self.destroy(errnoException(errno, 'read')); + } } }