summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAnna Henningsen <anna@addaleax.net>2019-03-21 16:45:44 +0100
committerAnna Henningsen <anna@addaleax.net>2019-03-26 12:00:52 +0100
commitf87b3a72cde17788bfd87eda16dd24117f5f4b02 (patch)
tree2a457a99c0a84b94c019180287f54c9f4d64fa4f /src
parent553c876a24e237b745ae7f8d47e2c9c9eae1263f (diff)
downloadandroid-node-v8-f87b3a72cde17788bfd87eda16dd24117f5f4b02.tar.gz
android-node-v8-f87b3a72cde17788bfd87eda16dd24117f5f4b02.tar.bz2
android-node-v8-f87b3a72cde17788bfd87eda16dd24117f5f4b02.zip
tls: add CHECK for impossible condition
PR-URL: https://github.com/nodejs/node/pull/26843 Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Minwoo Jung <minwoo@nodesource.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Diffstat (limited to 'src')
-rw-r--r--src/tls_wrap.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/tls_wrap.cc b/src/tls_wrap.cc
index 0ca7ad7845..e092458dd9 100644
--- a/src/tls_wrap.cc
+++ b/src/tls_wrap.cc
@@ -747,10 +747,10 @@ void TLSWrap::OnStreamRead(ssize_t nread, const uv_buf_t& buf) {
return;
}
- if (ssl_ == nullptr) {
- EmitRead(UV_EPROTO);
- return;
- }
+ // DestroySSL() is the only thing that un-sets ssl_, but that also removes
+ // this TLSWrap as a stream listener, so we should not receive OnStreamRead()
+ // calls anymore.
+ CHECK(ssl_);
// Commit the amount of data actually read into the peeked/allocated buffer
// from the underlying stream.