Skip to content

Commit 1f761f5

Browse files
authored
Remove assert from Http3Connection.SendAsync (#74348)
* Remove assert in System.Net.Http.Http3Connection.SendAsync * Minor change
1 parent be6399b commit 1f761f5

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/Http3Connection.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ public async Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, lon
240240
catch (QuicException ex) when (ex.QuicError == QuicError.OperationAborted)
241241
{
242242
// This will happen if we aborted _connection somewhere and we have pending OpenOutboundStreamAsync call.
243-
Debug.Assert(_abortException is not null);
243+
// note that _abortException may be null if we closed the connection in response to a GOAWAY frame
244244
throw new HttpRequestException(SR.net_http_client_execution_error, _abortException, RequestRetryType.RetryOnConnectionFailure);
245245
}
246246
finally
@@ -567,6 +567,10 @@ private async Task ProcessServerStreamAsync(QuicStream stream)
567567
}
568568
}
569569
}
570+
catch (QuicException ex) when (ex.QuicError == QuicError.OperationAborted)
571+
{
572+
// ignore the exception, we have already closed the connection
573+
}
570574
catch (Exception ex)
571575
{
572576
Abort(ex);

0 commit comments

Comments
 (0)