mirror of
https://github.com/nodejs/node.git
synced 2026-11-21 12:59:16 -05:00
tls_wrap: ignore ZERO_RETURN after close_notify
Do not call SSL_read() and ignore ZERO_RETURN if the connection was shutdown and there could not be any reads. Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> PR-URL: https://github.com/joyent/node/pull/8519
This commit is contained in:
1 parent
cb97bcd6f9
commit
da188d13aa
1 file changed
+8
@@ -447,6 +447,10 @@ void TLSCallbacks::ClearOut() {
|
||||
if (!hello_parser_.IsEnded())
|
||||
return;
|
||||
|
||||
// No reads after EOF
|
||||
if (eof_)
|
||||
return;
|
||||
|
||||
HandleScope handle_scope(env()->isolate());
|
||||
Context::Scope context_scope(env()->context());
|
||||
|
||||
@@ -476,6 +480,10 @@ void TLSCallbacks::ClearOut() {
|
||||
int err;
|
||||
Local<Value> arg = GetSSLError(read, &err, NULL);
|
||||
|
||||
// Ignore ZERO_RETURN after EOF, it is basically not a error
|
||||
if (err == SSL_ERROR_ZERO_RETURN && eof_)
|
||||
return;
|
||||
|
||||
if (!arg.IsEmpty()) {
|
||||
// When TLS Alert are stored in wbio,
|
||||
// it should be flushed to socket before destroyed.
|
||||
|
||||
Reference in new issue
Block a user