Skip to content

Commit c666056

Browse files
jasnelladuh95
authored andcommitted
quic: fix premature unref of endpoint when listening
Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: #63267 Backport-PR-URL: #64675 Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
1 parent 9a72949 commit c666056

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/quic/endpoint.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -736,7 +736,9 @@ void Endpoint::RemoveSession(const CID& cid,
736736
}
737737
}
738738
if (primary_session_count_ > 0 && --primary_session_count_ == 0) {
739-
udp_.Unref();
739+
if (!is_listening()) {
740+
udp_.Unref();
741+
}
740742
session_manager().RemoveSession(cid);
741743
// The endpoint may be idle (no sessions, not listening). MaybeDestroy
742744
// handles both closing (immediate destroy) and idle timeout (start

0 commit comments

Comments
 (0)