Skip to content

Commit 225417b

Browse files
addaleaxBethGriggs
authored andcommitted
tls: add CHECK for impossible condition
Backport-PR-URL: #26951 PR-URL: #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>
1 parent 109c097 commit 225417b

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)