Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
possible fix for issue with new Agent code in http.js where Agent in an error state stop working
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
You can’t perform that action at this time.