Skip to content

Commit f87b3a7

Browse files
committed
tls: add CHECK for impossible condition
PR-URL: #26843 Reviewed-By: Sam Roberts <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Minwoo Jung <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
1 parent 553c876 commit f87b3a7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/tls_wrap.cc

+4-4
Original file line numberDiff line numberDiff line change
@@ -747,10 +747,10 @@ void TLSWrap::OnStreamRead(ssize_t nread, const uv_buf_t& buf) {
747747
return;
748748
}
749749

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_);
754754

755755
// Commit the amount of data actually read into the peeked/allocated buffer
756756
// from the underlying stream.

0 commit comments

Comments
 (0)