Skip to content
Closed
Changes from 1 commit
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 @@ -14,6 +14,7 @@
using Microsoft.DotNet.XUnitExtensions;
using Xunit;
using Xunit.Abstractions;
using TestUtilities;

namespace System.Net.Http.Functional.Tests
{
Expand Down Expand Up @@ -73,6 +74,7 @@ await LoopbackServerFactory.CreateClientAndServerAsync(async uri =>
[InlineData(15)]
public async Task LargeSingleHeader_ThrowsException(int maxResponseHeadersLength)
{
using var _ = new TestEventListener(Console.Out, TestEventListener.NetworkingEvents);
var semaphore = new SemaphoreSlim(0);
using HttpClientHandler handler = CreateHttpClientHandler();
handler.MaxResponseHeadersLength = maxResponseHeadersLength;
Expand All @@ -97,7 +99,7 @@ await LoopbackServerFactory.CreateClientAndServerAsync(async uri =>
// Client can respond by closing/aborting the underlying stream while we are still sending the headers, ignore these exceptions
catch (IOException ex) when (ex.InnerException is SocketException se && se.SocketErrorCode == SocketError.Shutdown) { }
#if !WINHTTPHANDLER_TEST
catch (QuicException ex) when (ex.QuicError == QuicError.StreamAborted && ex.ApplicationErrorCode == Http3ExcessiveLoad) {}
catch (QuicException ex) when (ex.QuicError == QuicError.StreamAborted && ex.ApplicationErrorCode == Http3ExcessiveLoad) { }
#endif
finally
{
Expand All @@ -114,6 +116,7 @@ await LoopbackServerFactory.CreateClientAndServerAsync(async uri =>
[InlineData(int.MaxValue / 800, 100 * 1024)] // Capped at int.MaxValue
public async Task ThresholdExceeded_ThrowsException(int? maxResponseHeadersLength, int headersLengthEstimate)
{
using var _ = new TestEventListener(Console.Out, TestEventListener.NetworkingEvents);
var semaphore = new SemaphoreSlim(0);
await LoopbackServerFactory.CreateClientAndServerAsync(async uri =>
{
Expand Down
Loading