joyent/node — pull request #5347 by isaacs (2013-04-22 15:53:41+00:00)
Title: http: Don't try to destroy nonexistent sockets

**based on v0.10, but should be ported to v0.8 and master asap**

Fixes #3740

In the case of pipelined requests, you can have a situation where
the socket gets destroyed via one req/res object, but then trying
to destroy *another* req/res on the same socket will cause it to
call undefined.destroy(), since it was already removed from that
message.

Add a guard to OutgoingMessage.destroy and IncomingMessage.destroy
to prevent this error.

Review, please: @bnoordhuis