Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ SendAsync()

ValueTask< HttpResponseMessage > System.Net.Http.HttpConnectionPoolManager.SendAsync ( HttpRequestMessage request,
bool async,
bool doRequestAuth,
CancellationToken cancellationToken )
inline

Definition at line 299 of file HttpConnectionPoolManager.cs.

300 {
301 if (_proxy == null)
302 {
304 }
305 Uri uri = null;
306 try
307 {
308 if (!_proxy.IsBypassed(request.RequestUri))
309 {
310 if (_proxy is IMultiWebProxy multiWebProxy)
311 {
312 MultiProxy multiProxy = multiWebProxy.GetMultiProxy(request.RequestUri);
313 if (multiProxy.ReadNext(out uri, out var isFinalProxy) && !isFinalProxy)
314 {
316 }
317 }
318 else
319 {
320 uri = _proxy.GetProxy(request.RequestUri);
321 }
322 }
323 }
324 catch (Exception ex)
325 {
326 if (System.Net.NetEventSource.Log.IsEnabled())
327 {
328 System.Net.NetEventSource.Error(this, $"Exception from {_proxy.GetType().Name}.GetProxy({request.RequestUri}): {ex}", "SendAsync");
329 }
330 }
331 if (uri != null && !HttpUtilities.IsSupportedProxyScheme(uri.Scheme))
332 {
333 throw new NotSupportedException(System.SR.net_http_invalid_proxy_scheme);
334 }
336 }
ValueTask< HttpResponseMessage > SendAsyncCore(HttpRequestMessage request, Uri proxyUri, bool async, bool doRequestAuth, bool isProxyConnect, CancellationToken cancellationToken)
async ValueTask< HttpResponseMessage > SendAsyncMultiProxy(HttpRequestMessage request, bool async, bool doRequestAuth, MultiProxy multiProxy, Uri firstProxy, CancellationToken cancellationToken)
static readonly System.Net.NetEventSource Log
static void Error(object thisOrContextObject, FormattableString formattableString, [CallerMemberName] string memberName=null)
static string net_http_invalid_proxy_scheme
Definition SR.cs:130
Definition SR.cs:7
Uri? GetProxy(Uri destination)
bool IsBypassed(Uri host)

References System.Net.Http.HttpConnectionPoolManager._proxy, System.cancellationToken, System.Net.NetEventSource.Error(), System.Net.IWebProxy.GetProxy(), System.Net.IWebProxy.IsBypassed(), System.Net.Http.HttpUtilities.IsSupportedProxyScheme(), System.Net.NetEventSource.Log, System.SR.net_http_invalid_proxy_scheme, System.Uri.Scheme, System.Net.Http.HttpConnectionPoolManager.SendAsyncCore(), and System.Net.Http.HttpConnectionPoolManager.SendAsyncMultiProxy().

Referenced by System.Net.Http.HttpAuthenticatedConnectionHandler.SendAsync(), and System.Net.Http.HttpConnectionHandler.SendAsync().