Created
February 8, 2011 21:30
-
-
Save rjrodger/817293 to your computer and use it in GitHub Desktop.
possible fix for issue with new Agent code in http.js where Agent in an error state stop working
This file contains hidden or 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
socket.on('error', function(err) { | |
debug('AGENT SOCKET ERROR: ' + err.message); | |
var req; | |
if (socket._httpMessage) { | |
req = socket._httpMessage; | |
} else if (self.queue.length) { | |
req = self.queue.shift(); | |
assert(req._queue === self.queue); | |
req._queue = null; | |
} else { | |
// No requests on queue? Where is the request | |
assert(0); | |
} | |
req.emit('error', err); | |
req._hadError = true; // hacky | |
// MY FIX | |
// DOES THIS WORK? | |
parser.finish(); | |
socket.destroy(); | |
self._removeSocket(socket); | |
parsers.free(parser); | |
self._cycle(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment