tls: fix premature connection termination
authorBen Noordhuis <info@bnoordhuis.nl>
Wed, 9 Oct 2013 15:46:17 +0000 (17:46 +0200)
committerBen Noordhuis <info@bnoordhuis.nl>
Wed, 9 Oct 2013 17:25:47 +0000 (19:25 +0200)
commit9777890f5d9ce95f15c64d29f1c0a55c12d24c3e
treecf6ddf06933d078830084bf1d5c1fe1d0898861c
parent98c57c7c0724a3518f18a01a63fcc7bef2daf9f6
tls: fix premature connection termination

Destroying the TLS session implies destroying the underlying socket but
before this commit, that was done with net.Socket#destroy() rather than
net.Socket#destroySoon().  The former closes the connection right away,
even when there is still data to write.  In other words, sometimes the
final TLS record got truncated.

Fixes #6107.
lib/tls.js