Skip to content

Commit

Permalink
Fix SocketsHttpHandlerTest_HttpClientHandlerTest_Http3.ReadAsStreamAs…
Browse files Browse the repository at this point in the history
…ync_Cancellation data race (#101428)

* Fix SocketsHttpHandlerTest_HttpClientHandlerTest_Http3.ReadAsStreamAsync_Cancellation data race

* Fix build
  • Loading branch information
rzikm authored Apr 23, 2024
1 parent f270565 commit d92ac1f
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
using System.Linq;
using System.Net.Http.Headers;
using System.Net.Sockets;
#if !NETFRAMEWORK
using System.Net.Quic;
#endif
using System.Net.Test.Common;
using System.Security.Authentication;
using System.Security.Cryptography;
Expand Down Expand Up @@ -1396,6 +1399,12 @@ await server.AcceptConnectionAsync(async connection =>
await connection.SendResponseAsync(HttpStatusCode.OK, headers: new HttpHeaderData[] { new HttpHeaderData("Transfer-Encoding", "chunked") }, isFinal: false);
await connection.SendResponseBodyAsync("1\r\nh\r\n", false);
}
#if !NETFRAMEWORK
catch (QuicException ex) when (ex.ApplicationErrorCode == 0x10c /*H3_REQUEST_CANCELLED*/)
{
// The request was cancelled before we sent the body, ignore
}
#endif
catch (IOException ex)
{
// when testing in the browser, we are using the WebSocket for the loopback
Expand Down

0 comments on commit d92ac1f

Please sign in to comment.