Skip to content

Commit

Permalink
Remove assert in System.Net.Http.Http3Connection.SendAsync
Browse files Browse the repository at this point in the history
  • Loading branch information
rzikm committed Aug 22, 2022
1 parent 304ee17 commit 59e06e8
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ public async Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, lon
catch (QuicException ex) when (ex.QuicError == QuicError.OperationAborted)
{
// This will happen if we aborted _connection somewhere and we have pending OpenOutboundStreamAsync call.
Debug.Assert(_abortException is not null);
// note that _abortException may be null if we closed the connection in response to a GOAWAY frame
throw new HttpRequestException(SR.net_http_client_execution_error, _abortException, RequestRetryType.RetryOnConnectionFailure);
}
finally
Expand Down Expand Up @@ -569,7 +569,14 @@ private async Task ProcessServerStreamAsync(QuicStream stream)
}
catch (Exception ex)
{
Abort(ex);
if (ex is QuicException qe && qe.QuicError == QuicError.OperationAborted)
{
// ignore the exception, we have already closed the connection
}
else
{
Abort(ex);
}
}
finally
{
Expand Down

0 comments on commit 59e06e8

Please sign in to comment.