diff options
author | Fedor Indutny <fedor.indutny@gmail.com> | 2013-05-28 17:50:38 +0400 |
---|---|---|
committer | Fedor Indutny <fedor.indutny@gmail.com> | 2013-05-28 20:14:44 +0400 |
commit | fa170dd2b241bc0f22f88071158686075c3b269e (patch) | |
tree | 4cf4ceb0114a1db802bda56a8aa5a90747c27cdc /lib/tls.js | |
parent | 28f4c15eb49e9b7f1a430f39f0f930c38adeff60 (diff) | |
download | nodejs-fa170dd2b241bc0f22f88071158686075c3b269e.tar.gz nodejs-fa170dd2b241bc0f22f88071158686075c3b269e.tar.bz2 nodejs-fa170dd2b241bc0f22f88071158686075c3b269e.zip |
tls: ignore .shutdown() syscall error
Quote from SSL_shutdown man page:
The output of SSL_get_error(3) may be misleading,
as an erroneous SSL_ERROR_SYSCALL may be flagged even though
no error occurred.
Also, handle all other errors to prevent assertion in `ClearError()`.
Diffstat (limited to 'lib/tls.js')
-rw-r--r-- | lib/tls.js | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/tls.js b/lib/tls.js index 7bf0ca188..4441bd1d6 100644 --- a/lib/tls.js +++ b/lib/tls.js @@ -282,8 +282,14 @@ function onCryptoStreamFinish() { // NOTE: first call checks if client has sent us shutdown, // second call enqueues shutdown into the BIO. if (this.pair.ssl.shutdown() !== 1) { + if (this.pair.ssl && this.pair.ssl.error) + return this.pair.error(); + this.pair.ssl.shutdown(); } + + if (this.pair.ssl && this.pair.ssl.error) + return this.pair.error(); } } else { debug('encrypted.onfinish'); |