|
|
@ -1244,9 +1244,15 @@ Agent.prototype._establishNewConnection = function() { |
|
|
|
parser.onIncoming = function(res, shouldKeepAlive) { |
|
|
|
debug('AGENT incoming response!'); |
|
|
|
|
|
|
|
var req = socket._httpMessage; |
|
|
|
assert(req); |
|
|
|
// If we're receiving a message but we don't have a corresponding
|
|
|
|
// request - then somehow the server is seriously messed up and sending
|
|
|
|
// multiple responses at us. In this case we'll just bail.
|
|
|
|
if (!socket._httpMessage) { |
|
|
|
socket.destroy(); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
var req = socket._httpMessage; |
|
|
|
req.res = res; |
|
|
|
|
|
|
|
// Responses to HEAD requests are AWFUL. Ask Ryan.
|
|
|
|