Skip to content

Commit 2cd63ca

Browse files
addaleaxBethGriggs
authored andcommitted
tls: add CHECK for impossible condition
Backport-PR-URL: #27967 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 502555a commit 2cd63ca

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/tls_wrap.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -680,10 +680,10 @@ void TLSWrap::OnStreamRead(ssize_t nread, const uv_buf_t& buf) {
680680
return;
681681
}
682682

683-
if (ssl_ == nullptr) {
684-
EmitRead(UV_EPROTO);
685-
return;
686-
}
683+
// DestroySSL() is the only thing that un-sets ssl_, but that also removes
684+
// this TLSWrap as a stream listener, so we should not receive OnStreamRead()
685+
// calls anymore.
686+
CHECK(ssl_);
687687

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

0 commit comments

Comments
 (0)