request.end() would sometimes try to write a zero-length buffer to the socket.
Don't do that, it triggers an unnecessary EPIPE when the other end has closed
the connection.
Fixes#3257.
Move parsers.free(parser) to a single function, which also
nulls all of the various references we hang on them.
Also, move the parser.on* methods out of the closure, so that
there's one shared definition of each, instead of re-defining
for each parser in a spot where they can close over references
to other request-specific objects.
Conflicts:
lib/http.js
Move parsers.free(parser) to a single function, which also
nulls all of the various references we hang on them.
Also, move the parser.on* methods out of the closure, so that
there's one shared definition of each, instead of re-defining
for each parser in a spot where they can close over references
to other request-specific objects.
fixes#2888
Previously a pair of end events would be emitted if a response was
paused/resumed, and the underlying socket was closed while the
response was paused
ClientRequest.prototype.pause() is not needed. ClientRequest is a writable
stream and deferring to OutgoingMessage.prototype.pause() is broken, the method
does not exist.
As RFC 2616 says we should, assume that servers will provide a persistent
connection by default.
> A significant difference between HTTP/1.1 and earlier versions of
> HTTP is that persistent connections are the default behavior of any
> HTTP connection. That is, unless otherwise indicated, the client
> SHOULD assume that the server will maintain a persistent connection,
> even after error responses from the server.
> HTTP/1.1 applications that do not support persistent connections MUST
> include the "close" connection option in every message.
Fixes#2436.