summaryrefslogtreecommitdiff
path: root/lib/_tls_legacy.js
diff options
context:
space:
mode:
authorFedor Indutny <fedor.indutny@gmail.com>2013-12-10 23:06:56 +0400
committerFedor Indutny <fedor.indutny@gmail.com>2013-12-10 23:06:56 +0400
commit1e066e4a4a88f97af865d965f104b5fe8136797f (patch)
tree8dc3bb7aeb4c58abcf356bcdb9985b6f810b425a /lib/_tls_legacy.js
parentc17449df1675e482fc0350a27bc08b1b22ed261c (diff)
parent4a2792cd2f86403a71edf65d82600b6aad5713bf (diff)
downloadandroid-node-v8-1e066e4a4a88f97af865d965f104b5fe8136797f.tar.gz
android-node-v8-1e066e4a4a88f97af865d965f104b5fe8136797f.tar.bz2
android-node-v8-1e066e4a4a88f97af865d965f104b5fe8136797f.zip
Merge branch 'v0.10'
Conflicts: lib/tls.js src/node_crypto.cc src/node_crypto.h
Diffstat (limited to 'lib/_tls_legacy.js')
-rw-r--r--lib/_tls_legacy.js13
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/_tls_legacy.js b/lib/_tls_legacy.js
index 2f7559d09d..be3c8aff55 100644
--- a/lib/_tls_legacy.js
+++ b/lib/_tls_legacy.js
@@ -314,16 +314,21 @@ CryptoStream.prototype._read = function read(size) {
if (bytesRead === 0) {
// EOF when cleartext has finished and we have nothing to read
- if (this._opposite._finished && this._internallyPendingBytes() === 0) {
+ if (this._opposite._finished && this._internallyPendingBytes() === 0 ||
+ this.pair.ssl && this.pair.ssl.receivedShutdown) {
// Perform graceful shutdown
this._done();
// No half-open, sorry!
- if (this === this.pair.cleartext)
+ if (this === this.pair.cleartext) {
this._opposite._done();
- // EOF
- this.push(null);
+ // EOF
+ this.push(null);
+ } else if (!this.pair.ssl || !this.pair.ssl.receivedShutdown) {
+ // EOF
+ this.push(null);
+ }
} else {
// Bail out
this.push('');