summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBen Noordhuis <info@bnoordhuis.nl>2013-10-09 17:46:17 +0200
committerBen Noordhuis <info@bnoordhuis.nl>2013-10-09 19:25:47 +0200
commit9777890f5d9ce95f15c64d29f1c0a55c12d24c3e (patch)
treecf6ddf06933d078830084bf1d5c1fe1d0898861c /lib
parent98c57c7c0724a3518f18a01a63fcc7bef2daf9f6 (diff)
downloadandroid-node-v8-9777890f5d9ce95f15c64d29f1c0a55c12d24c3e.tar.gz
android-node-v8-9777890f5d9ce95f15c64d29f1c0a55c12d24c3e.tar.bz2
android-node-v8-9777890f5d9ce95f15c64d29f1c0a55c12d24c3e.zip
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.
Diffstat (limited to 'lib')
-rw-r--r--lib/tls.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/tls.js b/lib/tls.js
index fe94a5121f..dcdd99a193 100644
--- a/lib/tls.js
+++ b/lib/tls.js
@@ -1400,7 +1400,7 @@ function pipe(pair, socket) {
// Encrypted should be unpiped from socket to prevent possible
// write after destroy.
pair.encrypted.unpipe(socket);
- socket.destroy();
+ socket.destroySoon();
});
});