Skip to content

Commit e9ab5c9

Browse files
committed
Comment stream cleanup more to resolve nits
1 parent 28daf59 commit e9ab5c9

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

‎src/quic/application.cc‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ Session::Application::ExtractSessionTicketAppData(
210210
void Session::Application::ReceiveStreamClose(stream_id id,
211211
Stream* stream,
212212
QuicError&& error) {
213+
// Stream may be nullptr if our side is already gone
213214
if (stream == nullptr) return;
214215
stream->Destroy(std::move(error));
215216
}

‎src/quic/session.cc‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1582,7 +1582,11 @@ struct Session::Impl final : public MemoryRetainer {
15821582
// If the peer closes a stream, we return the credit to allow a new one:
15831583
session->ExtendMaxStreams(stream_id);
15841584
if (!session->has_application()) return NGTCP2_SUCCESS;
1585+
1586+
// Stream here may be null (e.g. if already destroyed locally) so we also
1587+
// pass stream_id to the calls below as well.
15851588
auto* stream = Stream::From(stream_user_data);
1589+
15861590
if (flags & NGTCP2_STREAM_CLOSE_FLAG_APP_ERROR_CODE_SET) {
15871591
session->application().ReceiveStreamClose(
15881592
stream_id, stream, QuicError::ForApplication(app_error_code));

0 commit comments

Comments
 (0)