Skip to content

Commit 8474d8c

Browse files
committed
Adding a missed ConfigureAwait(false) within MyGetResponseAsync. Without this the async call invokes the UnitySynchronizationContext which is not needed and also causes incorrect behavior as it then requires the main unity thread to execute pending tasks.
1 parent 4efb2bb commit 8474d8c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mcs/class/System/System.Net/HttpWebRequest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1010,7 +1010,7 @@ async Task<HttpWebResponse> MyGetResponseAsync (CancellationToken cancellationTo
10101010

10111011
WebConnection.Debug ($"HWR GET RESPONSE LOOP: Req={ID} Op={operation?.ID} {auth_state.NtlmAuthState}");
10121012

1013-
writeStream = await operation.GetRequestStreamInternal ();
1013+
writeStream = await operation.GetRequestStreamInternal ().ConfigureAwait (false);
10141014
await writeStream.WriteRequestAsync (cancellationToken).ConfigureAwait (false);
10151015

10161016
stream = await operation.GetResponseStream ();

0 commit comments

Comments
 (0)