Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix exception thrown from MsQuicStream writes when connection is aborted by peer. #67651

Merged
merged 2 commits into from
Apr 8, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1292,8 +1292,16 @@ private static uint HandleEventSendComplete(State state, ref StreamEvent evt)
}
else
{
//
// There are multiple reasons the send could have been cancelled:
// - Connection was aborted (either by transport or peer) => error-code already provided on the connection-level event
// - Stream's receive side was aborted by peer => already handled by HandleEventPeerRecvAborted
// and we will not set the exception due to complete == false
// - Stream's send side was aborted locally => no connection-level abort code and we return QuicOperationAbortException
//
state.SendResettableCompletionSource.CompleteException(
ExceptionDispatchInfo.SetCurrentStackTrace(new OperationCanceledException("Write was canceled")));
ExceptionDispatchInfo.SetCurrentStackTrace(
ThrowHelper.GetConnectionAbortedException(state.ConnectionState.AbortErrorCode)));
}
}

Expand Down