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
  • Loading branch information
rzikm committed Apr 23, 2024
1 parent 9068070 commit 7900958
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using System.Linq;
using System.Net.Http.Headers;
using System.Net.Sockets;
using System.Net.Quic;
using System.Net.Test.Common;
using System.Security.Authentication;
using System.Security.Cryptography;
Expand Down Expand Up @@ -1396,6 +1397,10 @@ 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);
}
catch (QuicException ex) when (ex.ApplicationErrorCode == 0x10c /*H3_REQUEST_CANCELLED*/)
{
// The request was cancelled before we sent the body, ignore
}
catch (IOException ex)
{
// when testing in the browser, we are using the WebSocket for the loopback
Expand Down

0 comments on commit 7900958

Please sign in to comment.