Skip to content

Commit

Permalink
blindly rip out a whole bunch of ConfigureAwait(false) because I read…
Browse files Browse the repository at this point in the history
… in an MS blog 'in applevel code do not use configureawait'
  • Loading branch information
scbedd committed Feb 1, 2023
1 parent 3d342d1 commit ebf00ed
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tools/test-proxy/Azure.Sdk.Tools.TestProxy/RecordingHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ public async Task HandleRecordRequestAsync(string recordingId, HttpRequest incom
throw new HttpException(HttpStatusCode.BadRequest, $"There is no active recording session under id {recordingId}.");
}

var entry = await CreateEntryAsync(incomingRequest).ConfigureAwait(false);
var entry = await CreateEntryAsync(incomingRequest);

var upstreamRequest = CreateUpstreamRequest(incomingRequest, CompressionUtilities.CompressBody(entry.Request.Body, entry.Request.Headers));

Expand Down Expand Up @@ -222,11 +222,11 @@ public async Task HandleRecordRequestAsync(string recordingId, HttpRequest incom

if (HandleRedirects)
{
upstreamResponse = await (session.Client ?? RedirectableClient).SendAsync(upstreamRequest).ConfigureAwait(false);
upstreamResponse = await (session.Client ?? RedirectableClient).SendAsync(upstreamRequest);
}
else
{
upstreamResponse = await (session.Client ?? RedirectlessClient).SendAsync(upstreamRequest).ConfigureAwait(false);
upstreamResponse = await (session.Client ?? RedirectlessClient).SendAsync(upstreamRequest);
}

await DebugLogger.LogResponseDetailsAsync(upstreamResponse);
Expand All @@ -235,7 +235,7 @@ public async Task HandleRecordRequestAsync(string recordingId, HttpRequest incom
// HEAD requests do NOT have a body regardless of the value of the Content-Length header
if (incomingRequest.Method.ToUpperInvariant() != "HEAD")
{
body = CompressionUtilities.DecompressBody((MemoryStream)await upstreamResponse.Content.ReadAsStreamAsync().ConfigureAwait(false), upstreamResponse.Content.Headers);
body = CompressionUtilities.DecompressBody((MemoryStream)await upstreamResponse.Content.ReadAsStreamAsync(), upstreamResponse.Content.Headers);
}

entry.Response.Body = body.Length == 0 ? null : body;
Expand Down Expand Up @@ -272,7 +272,7 @@ public async Task HandleRecordRequestAsync(string recordingId, HttpRequest incom
{
var bodyData = CompressionUtilities.CompressBody(entry.Response.Body, entry.Response.Headers);
outgoingResponse.ContentLength = bodyData.Length;
await outgoingResponse.Body.WriteAsync(bodyData).ConfigureAwait(false);
await outgoingResponse.Body.WriteAsync(bodyData);
}
}

Expand Down

0 comments on commit ebf00ed

Please sign in to comment.