Skip to content
7 changes: 5 additions & 2 deletions src/core/connection.c
Original file line number Diff line number Diff line change
Expand Up @@ -692,11 +692,14 @@ QuicConnIndicateEvent(
// MsQuic shouldn't indicate reentrancy to the app when at all possible.
// The general exception to this rule is when the connection is being
// closed because the API MUST block until all work is completed, so we
// have to execute the event callbacks inline.
// have to execute the event callbacks inline. Custom executions always
// have InlineApiExecution set, which makes this reentrancy check
// unreliable, so it is skipped for custom executions.
//
CXPLAT_DBG_ASSERT(
!Connection->State.InlineApiExecution ||
Connection->State.HandleClosed);
Connection->State.HandleClosed ||
MsQuicLib.CustomExecutions);
Status =
Connection->ClientCallbackHandler(
(HQUIC)Connection,
Expand Down
7 changes: 5 additions & 2 deletions src/core/stream.c
Original file line number Diff line number Diff line change
Expand Up @@ -470,13 +470,16 @@ QuicStreamIndicateEvent(
// or stream is being closed because the API MUST block until all work
// is completed, so we have to execute the event callbacks inline. There
// is also one additional exception for start complete when StreamStart
// is called synchronously on an MsQuic thread.
// is called synchronously on an MsQuic thread. Custom executions
// always have InlineApiExecution set, which makes this reentrancy
// check unreliable, so it is skipped for custom executions.
//
CXPLAT_DBG_ASSERT(
!Stream->Connection->State.InlineApiExecution ||
Stream->Connection->State.HandleClosed ||
Stream->Flags.HandleClosed ||
Event->Type == QUIC_STREAM_EVENT_START_COMPLETE);
Event->Type == QUIC_STREAM_EVENT_START_COMPLETE ||
MsQuicLib.CustomExecutions);
Status =
Stream->ClientCallbackHandler(
(HQUIC)Stream,
Expand Down
Loading