Created
March 3, 2014 17:34
-
-
Save tjfontaine/9330165 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/lib/_http_server.js b/lib/_http_server.js | |
index eab7d64..8b2d2b3 100644 | |
--- a/lib/_http_server.js | |
+++ b/lib/_http_server.js | |
@@ -349,6 +349,14 @@ function connectionListener(socket) { | |
// TODO(isaacs): Move all these functions out of here | |
function socketOnError(e) { | |
self.emit('clientError', e, this); | |
+ | |
+ if (e.syscall === 'write' && this._httpMessage) { | |
+ debug('emitting error on response', e); | |
+ this._httpMessage.emit('error', e); | |
+ } else if (e.syscall === 'read' && this.parser && this.parser.incoming) { | |
+ debug('emitting error on request', e); | |
+ this.parser.incoming.emit('error', e); | |
+ } | |
} | |
function socketOnData(d) { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment