| | | 1 | | // Licensed to the .NET Foundation under one or more agreements. |
| | | 2 | | // The .NET Foundation licenses this file to you under the MIT license. |
| | | 3 | | |
| | | 4 | | using System.Threading; |
| | | 5 | | using System.Threading.Tasks; |
| | | 6 | | |
| | | 7 | | namespace System.Net.Http |
| | | 8 | | { |
| | | 9 | | internal sealed class HttpConnectionHandler : HttpMessageHandlerStage |
| | | 10 | | { |
| | | 11 | | private readonly HttpConnectionPoolManager _poolManager; |
| | | 12 | | private readonly bool _doRequestAuth; |
| | | 13 | | |
| | 0 | 14 | | public HttpConnectionHandler(HttpConnectionPoolManager poolManager, bool doRequestAuth) |
| | 0 | 15 | | { |
| | 0 | 16 | | _poolManager = poolManager; |
| | 0 | 17 | | _doRequestAuth = doRequestAuth; |
| | 0 | 18 | | } |
| | | 19 | | |
| | | 20 | | internal override ValueTask<HttpResponseMessage> SendAsync(HttpRequestMessage request, bool async, CancellationT |
| | 0 | 21 | | { |
| | 0 | 22 | | bool doRequestAuth = _doRequestAuth && !request.IsAuthDisabled(); |
| | 0 | 23 | | return _poolManager.SendAsync(request, async, doRequestAuth, cancellationToken); |
| | 0 | 24 | | } |
| | | 25 | | |
| | | 26 | | protected override void Dispose(bool disposing) |
| | 0 | 27 | | { |
| | 0 | 28 | | if (disposing) |
| | 0 | 29 | | { |
| | 0 | 30 | | _poolManager.Dispose(); |
| | 0 | 31 | | } |
| | | 32 | | |
| | 0 | 33 | | base.Dispose(disposing); |
| | 0 | 34 | | } |
| | | 35 | | } |
| | | 36 | | } |