tls: add CHECK for impossible condition · nodejs/node@f87b3a7 (original) (raw)

Original file line number Diff line number Diff line change
@@ -747,10 +747,10 @@ void TLSWrap::OnStreamRead(ssize_t nread, const uv_buf_t& buf) {
747 747 return;
748 748 }
749 749
750 -if (ssl_ == nullptr) {
751 - EmitRead(UV_EPROTO);
752 - return;
753 -}
750 +// DestroySSL() is the only thing that un-sets ssl_, but that also removes
751 +// this TLSWrap as a stream listener, so we should not receive OnStreamRead()
752 +// calls anymore.
753 +CHECK(ssl_);
754 754
755 755 // Commit the amount of data actually read into the peeked/allocated buffer
756 756 // from the underlying stream.