Commit 4790102c authored by justcoding121's avatar justcoding121

No need for ConfigureAwait(false) when SynchronizationContext is null

Task.Run don't have sync context anyway, so will resume in threadpool
thread.

http://stackoverflow.com/questions/36654472/why-configureawaitfalse-does-not-work-while-task-run-works
parent 86e05914
......@@ -95,7 +95,7 @@ namespace Titanium.Web.Proxy
}
var username = decoded.Substring(0, decoded.IndexOf(':'));
var password = decoded.Substring(decoded.IndexOf(':') + 1);
return await AuthenticateUserFunc(username, password).ConfigureAwait(false);
return await AuthenticateUserFunc(username, password);
}
catch (Exception e)
{
......
......@@ -231,14 +231,14 @@ namespace Titanium.Web.Proxy
{
if (GetCustomUpStreamHttpProxyFunc != null)
{
customUpStreamHttpProxy = await GetCustomUpStreamHttpProxyFunc(args).ConfigureAwait(false);
customUpStreamHttpProxy = await GetCustomUpStreamHttpProxyFunc(args);
}
}
else
{
if (GetCustomUpStreamHttpsProxyFunc != null)
{
customUpStreamHttpsProxy = await GetCustomUpStreamHttpsProxyFunc(args).ConfigureAwait(false);
customUpStreamHttpsProxy = await GetCustomUpStreamHttpsProxyFunc(args);
}
}
......@@ -498,7 +498,7 @@ namespace Titanium.Web.Proxy
}
//construct the web request that we are going to issue on behalf of the client.
await HandleHttpSessionRequestInternal(null, args, customUpStreamHttpProxy, customUpStreamHttpsProxy, false).ConfigureAwait(false);
await HandleHttpSessionRequestInternal(null, args, customUpStreamHttpProxy, customUpStreamHttpsProxy, false);
if (args.WebSession.Request.CancelRequest)
......
......@@ -52,7 +52,7 @@ namespace Titanium.Web.Proxy
if(args.ReRequest)
{
await HandleHttpSessionRequestInternal(null, args, null, null, true).ConfigureAwait(false);
await HandleHttpSessionRequestInternal(null, args, null, null, true);
return;
}
......
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