Commit 03205075 authored by justcoding121's avatar justcoding121

ConfigureAwait(false)

parent 4b86cde8
...@@ -50,7 +50,7 @@ namespace Titanium.Web.Proxy.Extensions ...@@ -50,7 +50,7 @@ namespace Titanium.Web.Proxy.Extensions
{ {
while (true) while (true)
{ {
var chuchkHead = await clientStreamReader.ReadLineAsync(); var chuchkHead = await clientStreamReader.ReadLineAsync().ConfigureAwait(false);
var chunkSize = int.Parse(chuchkHead, NumberStyles.HexNumber); var chunkSize = int.Parse(chuchkHead, NumberStyles.HexNumber);
if (chunkSize != 0) if (chunkSize != 0)
...@@ -58,11 +58,11 @@ namespace Titanium.Web.Proxy.Extensions ...@@ -58,11 +58,11 @@ namespace Titanium.Web.Proxy.Extensions
var buffer = await clientStreamReader.ReadBytesAsync(chunkSize); var buffer = await clientStreamReader.ReadBytesAsync(chunkSize);
await stream.WriteAsync(buffer, 0, buffer.Length); await stream.WriteAsync(buffer, 0, buffer.Length);
//chunk trail //chunk trail
await clientStreamReader.ReadLineAsync(); await clientStreamReader.ReadLineAsync().ConfigureAwait(false);
} }
else else
{ {
await clientStreamReader.ReadLineAsync(); await clientStreamReader.ReadLineAsync().ConfigureAwait(false);
break; break;
} }
} }
......
...@@ -73,13 +73,13 @@ namespace Titanium.Web.Proxy.Http ...@@ -73,13 +73,13 @@ namespace Titanium.Web.Proxy.Http
&& responseStatusDescription.ToLower().Equals("continue")) && responseStatusDescription.ToLower().Equals("continue"))
{ {
this.Request.Is100Continue = true; this.Request.Is100Continue = true;
await ProxyClient.ServerStreamReader.ReadLineAsync(); await ProxyClient.ServerStreamReader.ReadLineAsync().ConfigureAwait(false);
} }
else if (responseStatusCode.Equals("417") else if (responseStatusCode.Equals("417")
&& responseStatusDescription.ToLower().Equals("expectation failed")) && responseStatusDescription.ToLower().Equals("expectation failed"))
{ {
this.Request.ExpectationFailed = true; this.Request.ExpectationFailed = true;
await ProxyClient.ServerStreamReader.ReadLineAsync(); await ProxyClient.ServerStreamReader.ReadLineAsync().ConfigureAwait(false);
} }
} }
} }
...@@ -93,7 +93,7 @@ namespace Titanium.Web.Proxy.Http ...@@ -93,7 +93,7 @@ namespace Titanium.Web.Proxy.Http
if (string.IsNullOrEmpty(httpResult[0])) if (string.IsNullOrEmpty(httpResult[0]))
{ {
await ProxyClient.ServerStreamReader.ReadLineAsync(); await ProxyClient.ServerStreamReader.ReadLineAsync().ConfigureAwait(false);
} }
this.Response.HttpVersion = httpResult[0].Trim(); this.Response.HttpVersion = httpResult[0].Trim();
...@@ -106,7 +106,7 @@ namespace Titanium.Web.Proxy.Http ...@@ -106,7 +106,7 @@ namespace Titanium.Web.Proxy.Http
{ {
this.Response.Is100Continue = true; this.Response.Is100Continue = true;
this.Response.ResponseStatusCode = null; this.Response.ResponseStatusCode = null;
await ProxyClient.ServerStreamReader.ReadLineAsync(); await ProxyClient.ServerStreamReader.ReadLineAsync().ConfigureAwait(false);
await ReceiveResponse(); await ReceiveResponse();
return; return;
} }
...@@ -115,12 +115,12 @@ namespace Titanium.Web.Proxy.Http ...@@ -115,12 +115,12 @@ namespace Titanium.Web.Proxy.Http
{ {
this.Response.ExpectationFailed = true; this.Response.ExpectationFailed = true;
this.Response.ResponseStatusCode = null; this.Response.ResponseStatusCode = null;
await ProxyClient.ServerStreamReader.ReadLineAsync(); await ProxyClient.ServerStreamReader.ReadLineAsync().ConfigureAwait(false);
await ReceiveResponse(); await ReceiveResponse();
return; return;
} }
List<string> responseLines = await ProxyClient.ServerStreamReader.ReadAllLinesAsync(); List<string> responseLines = await ProxyClient.ServerStreamReader.ReadAllLinesAsync().ConfigureAwait(false);
for (int index = 0; index < responseLines.Count; ++index) for (int index = 0; index < responseLines.Count; ++index)
{ {
......
...@@ -34,7 +34,7 @@ namespace Titanium.Web.Proxy ...@@ -34,7 +34,7 @@ namespace Titanium.Web.Proxy
{ {
//read the first line HTTP command //read the first line HTTP command
var httpCmd = await clientStreamReader.ReadLineAsync(); var httpCmd = await clientStreamReader.ReadLineAsync().ConfigureAwait(false);
if (string.IsNullOrEmpty(httpCmd)) if (string.IsNullOrEmpty(httpCmd))
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment