Skip to content
This repository was archived by the owner on Jul 9, 2023. It is now read-only.

Commit 0320507

Browse files
committed
ConfigureAwait(false)
1 parent 4b86cde commit 0320507

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

Titanium.Web.Proxy/Extensions/StreamExtensions.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -50,19 +50,19 @@ internal static async Task CopyBytesToStreamChunked(this CustomBinaryReader clie
5050
{
5151
while (true)
5252
{
53-
var chuchkHead = await clientStreamReader.ReadLineAsync();
53+
var chuchkHead = await clientStreamReader.ReadLineAsync().ConfigureAwait(false);
5454
var chunkSize = int.Parse(chuchkHead, NumberStyles.HexNumber);
5555

5656
if (chunkSize != 0)
5757
{
5858
var buffer = await clientStreamReader.ReadBytesAsync(chunkSize);
5959
await stream.WriteAsync(buffer, 0, buffer.Length);
6060
//chunk trail
61-
await clientStreamReader.ReadLineAsync();
61+
await clientStreamReader.ReadLineAsync().ConfigureAwait(false);
6262
}
6363
else
6464
{
65-
await clientStreamReader.ReadLineAsync();
65+
await clientStreamReader.ReadLineAsync().ConfigureAwait(false);
6666
break;
6767
}
6868
}

Titanium.Web.Proxy/Http/HttpWebClient.cs

+6-6
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,13 @@ internal async Task SendRequest()
7373
&& responseStatusDescription.ToLower().Equals("continue"))
7474
{
7575
this.Request.Is100Continue = true;
76-
await ProxyClient.ServerStreamReader.ReadLineAsync();
76+
await ProxyClient.ServerStreamReader.ReadLineAsync().ConfigureAwait(false);
7777
}
7878
else if (responseStatusCode.Equals("417")
7979
&& responseStatusDescription.ToLower().Equals("expectation failed"))
8080
{
8181
this.Request.ExpectationFailed = true;
82-
await ProxyClient.ServerStreamReader.ReadLineAsync();
82+
await ProxyClient.ServerStreamReader.ReadLineAsync().ConfigureAwait(false);
8383
}
8484
}
8585
}
@@ -93,7 +93,7 @@ internal async Task ReceiveResponse()
9393

9494
if (string.IsNullOrEmpty(httpResult[0]))
9595
{
96-
await ProxyClient.ServerStreamReader.ReadLineAsync();
96+
await ProxyClient.ServerStreamReader.ReadLineAsync().ConfigureAwait(false);
9797
}
9898

9999
this.Response.HttpVersion = httpResult[0].Trim();
@@ -106,7 +106,7 @@ internal async Task ReceiveResponse()
106106
{
107107
this.Response.Is100Continue = true;
108108
this.Response.ResponseStatusCode = null;
109-
await ProxyClient.ServerStreamReader.ReadLineAsync();
109+
await ProxyClient.ServerStreamReader.ReadLineAsync().ConfigureAwait(false);
110110
await ReceiveResponse();
111111
return;
112112
}
@@ -115,12 +115,12 @@ internal async Task ReceiveResponse()
115115
{
116116
this.Response.ExpectationFailed = true;
117117
this.Response.ResponseStatusCode = null;
118-
await ProxyClient.ServerStreamReader.ReadLineAsync();
118+
await ProxyClient.ServerStreamReader.ReadLineAsync().ConfigureAwait(false);
119119
await ReceiveResponse();
120120
return;
121121
}
122122

123-
List<string> responseLines = await ProxyClient.ServerStreamReader.ReadAllLinesAsync();
123+
List<string> responseLines = await ProxyClient.ServerStreamReader.ReadAllLinesAsync().ConfigureAwait(false);
124124

125125
for (int index = 0; index < responseLines.Count; ++index)
126126
{

Titanium.Web.Proxy/RequestHandler.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ private static async void HandleClient(ExplicitProxyEndPoint endPoint, TcpClient
3434
{
3535
//read the first line HTTP command
3636

37-
var httpCmd = await clientStreamReader.ReadLineAsync();
37+
var httpCmd = await clientStreamReader.ReadLineAsync().ConfigureAwait(false);
3838

3939
if (string.IsNullOrEmpty(httpCmd))
4040
{

0 commit comments

Comments
 (0)