Skip to content

Commit

Permalink
tls: add CHECK for impossible condition
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
addaleax authored and BethGriggs committed Jul 16, 2019
1 parent f9e8e88 commit 99dad28
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/tls_wrap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -680,10 +680,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.
Expand Down

0 comments on commit 99dad28

Please sign in to comment.