joyent/node — pull request #5772 by tjfontaine (2013-07-01 18:48:27+00:00)
Title: tls: only wait for finish if we haven't seen it

A pooled https agent may get a Connection: close, but never finish
destroying the socket as the prior request had already emitted finish
likely from a pipe.

Since the socket is not marked as destroyed it may get reused by the
agent pool and result in an ECONNRESET.

re: #5712 #5739