Skip to content

Commit ace0f64

Browse files
geoffkizerGeoffrey Kizer
and
Geoffrey Kizer
authored
fix issue where HTTP/1.1 connections were not being created asynchronously (#56966)
* fix issue where HTTP/1.1 connections were not being created asynchronously Co-authored-by: Geoffrey Kizer <[email protected]>
1 parent f9bcaa3 commit ace0f64

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ private async Task AddHttp11ConnectionAsync(HttpRequestMessage request)
450450
{
451451
try
452452
{
453-
connection = await CreateHttp11ConnectionAsync(request, false, cts.Token).ConfigureAwait(false);
453+
connection = await CreateHttp11ConnectionAsync(request, true, cts.Token).ConfigureAwait(false);
454454
}
455455
catch (OperationCanceledException oce) when (oce.CancellationToken == cts.Token)
456456
{
@@ -596,7 +596,7 @@ private async Task HandleHttp11Downgrade(HttpRequestMessage request, Socket? soc
596596
try
597597
{
598598
// Note, the same CancellationToken from the original HTTP2 connection establishment still applies here.
599-
http11Connection = await ConstructHttp11ConnectionAsync(false, socket, stream, transportContext, request, cancellationToken).ConfigureAwait(false);
599+
http11Connection = await ConstructHttp11ConnectionAsync(true, socket, stream, transportContext, request, cancellationToken).ConfigureAwait(false);
600600
}
601601
catch (OperationCanceledException oce) when (oce.CancellationToken == cancellationToken)
602602
{
@@ -621,7 +621,7 @@ private async Task AddHttp2ConnectionAsync(HttpRequestMessage request)
621621
{
622622
try
623623
{
624-
(Socket? socket, Stream stream, TransportContext? transportContext) = await ConnectAsync(request, false, cts.Token).ConfigureAwait(false);
624+
(Socket? socket, Stream stream, TransportContext? transportContext) = await ConnectAsync(request, true, cts.Token).ConfigureAwait(false);
625625

626626
if (IsSecure)
627627
{

0 commit comments

Comments
 (0)