Crafter.Network/implementations
Repository files (latest commit first)
Filename Latest commit message Latest commit date
catbot 42a34de244 fix(quic): stop ~ClientQUIC racing the callback to close the connection
MsQuicConnectionClose was reachable twice for one handle: ~ClientQUIC
called it unconditionally, and the SHUTDOWN_COMPLETE callback also called
it whenever AppCloseInProgress was clear -- which it is for the whole
window between the destructor's ConnectionShutdown and its ConnectionClose.
The second call trips CXPLAT_TEL_ASSERT(!Connection->State.HandleClosed)
and aborts the process. Clearing impl->connection from the callback did not
help: the destructor had already loaded it.

`connection` is now a claim token, taken under the mutex, and only whoever
wins the claim closes. The callback keeps closing peer-dropped connections
so they do not leak while their ClientQUIC lives on.

Separately, the destructor now waits (bounded, 5s) for the connection's
streams to reach StreamClose before closing it. QUICStream::Stop only
initiates a shutdown whose async completion does the close, so a
connection could otherwise be closed with streams msquic still considers
open. The count lives in a shared StreamRegistry rather than behind the
ClientQUIC*, so a stream finalising after the wait gave up decrements a
live object.

A failed handshake also closes its connection and configuration now.
Throwing from the constructor body means ~ClientQUIC never runs, so both
handles leaked -- and the connection callback holds the impl that was
about to be destroyed with the half-built object.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-25 17:06:51 +00:00
..
Crafter.Network-ClientHTTP-Browser.cpp SPDX license 2026-07-22 17:55:45 +02:00
Crafter.Network-ClientHTTP.cpp SPDX license 2026-07-22 17:55:45 +02:00
Crafter.Network-ClientHTTP1.cpp feat(tls): add a libssl TLS transport and an https:// HTTP/1.1 stack 2026-07-28 20:13:30 +00:00
Crafter.Network-ClientQUIC-Browser.cpp SPDX license 2026-07-22 17:55:45 +02:00
Crafter.Network-ClientQUIC.cpp fix(quic): stop ~ClientQUIC racing the callback to close the connection 2026-08-25 17:06:51 +00:00
Crafter.Network-ClientTCP.cpp fix(tcp): resolve, connect, bind and send failures were silent or wrong 2026-07-27 00:44:56 +00:00
Crafter.Network-ListenerHTTP.cpp feat(http): give ListenerHTTP the same fallback and query-strip routing 2026-07-28 19:42:06 +00:00
Crafter.Network-ListenerHTTP1.cpp test(https): give the TLS tests ports of their own 2026-07-28 20:34:23 +00:00
Crafter.Network-ListenerQUIC.cpp SPDX license 2026-07-22 17:55:45 +02:00
Crafter.Network-ListenerTCP.cpp fix(tcp): resolve, connect, bind and send failures were silent or wrong 2026-07-27 00:44:56 +00:00
Crafter.Network-Stream.cpp feat(tls): add a libssl TLS transport and an https:// HTTP/1.1 stack 2026-07-28 20:13:30 +00:00
Crafter.Network-TLS.cpp fix(tls): stop a peer that closed first from killing the process 2026-07-28 20:18:51 +00:00
Crafter.Network-WebTransport.cpp SPDX license 2026-07-22 17:55:45 +02:00