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

◆ HttpConnectionPool()

System.Net.Http.HttpConnectionPool.HttpConnectionPool ( HttpConnectionPoolManager poolManager,
HttpConnectionKind kind,
string host,
int port,
string sslHostName,
Uri proxyUri )
inline

Definition at line 239 of file HttpConnectionPool.cs.

240 {
242 _kind = kind;
245 if (host != null)
246 {
247 _originAuthority = new HttpAuthority(host, port);
248 }
249 _http2Enabled = _poolManager.Settings._maxHttpVersion >= HttpVersion.Version20;
250 if (IsHttp3Supported())
251 {
252 _http3Enabled = _poolManager.Settings._maxHttpVersion >= HttpVersion.Version30 && (_poolManager.Settings._quicImplementationProvider ?? QuicImplementationProviders.Default).IsSupported;
253 }
254 switch (kind)
255 {
256 case HttpConnectionKind.Http:
257 _http3Enabled = false;
258 break;
259 case HttpConnectionKind.Proxy:
260 _http2Enabled = false;
261 _http3Enabled = false;
262 break;
263 case HttpConnectionKind.ProxyTunnel:
264 _http2Enabled = false;
265 _http3Enabled = false;
266 break;
267 case HttpConnectionKind.SslProxyTunnel:
268 _http3Enabled = false;
269 break;
270 case HttpConnectionKind.ProxyConnect:
271 _maxHttp11Connections = int.MaxValue;
272 _http2Enabled = false;
273 _http3Enabled = false;
274 break;
275 case HttpConnectionKind.SocksTunnel:
276 case HttpConnectionKind.SslSocksTunnel:
277 _http3Enabled = false;
278 break;
279 }
280 if (!_http3Enabled)
281 {
282 _altSvcEnabled = false;
283 }
284 string text = null;
285 if (_originAuthority != null)
286 {
287 text = ((_originAuthority.Port != ((sslHostName == null) ? 80 : 443)) ? $"{_originAuthority.IdnHost}:{_originAuthority.Port}" : _originAuthority.IdnHost);
289 if (sslHostName == null)
290 {
293 }
294 }
295 if (sslHostName != null)
296 {
298 _sslOptionsHttp11.ApplicationProtocols = null;
299 if (_http2Enabled)
300 {
302 _sslOptionsHttp2.ApplicationProtocols = s_http2ApplicationProtocols;
304 _sslOptionsHttp2Only.ApplicationProtocols = s_http2OnlyApplicationProtocols;
307 }
309 {
311 _sslOptionsHttp3.ApplicationProtocols = s_http3ApplicationProtocols;
312 }
313 }
315 {
316 PreAuthCredentials = new CredentialCache();
317 }
318 if (System.Net.NetEventSource.Log.IsEnabled())
319 {
320 Trace($"{this}", ".ctor");
321 }
322 }
static byte[] EncodeLiteralHeaderFieldWithoutIndexingToAllocatedArray(int index)
readonly SslClientAuthenticationOptions _sslOptionsHttp2
static readonly List< SslApplicationProtocol > s_http2ApplicationProtocols
readonly SslClientAuthenticationOptions _sslOptionsHttp3
readonly HttpConnectionKind _kind
static readonly List< SslApplicationProtocol > s_http3ApplicationProtocols
static readonly List< SslApplicationProtocol > s_http2OnlyApplicationProtocols
static SslClientAuthenticationOptions ConstructSslOptions(HttpConnectionPoolManager poolManager, string sslHostName)
void Trace(string message, [CallerMemberName] string memberName=null)
readonly HttpConnectionPoolManager _poolManager
readonly SslClientAuthenticationOptions _sslOptionsHttp2Only
readonly SslClientAuthenticationOptions _sslOptionsHttp11
static byte[] EncodeLiteralHeaderFieldWithStaticNameReferenceToArray(int index)
static readonly System.Net.NetEventSource Log
static Encoding ASCII
Definition Encoding.cs:511

References System.Net.Http.HttpConnectionPool._altSvcEnabled, System.Net.Http.HttpConnectionPool._hostHeaderValueBytes, System.Net.Http.HttpConnectionPool._http2Enabled, System.Net.Http.HttpConnectionPool._http2EncodedAuthorityHostHeader, System.Net.Http.HttpConnectionPool._http3Enabled, System.Net.Http.HttpConnectionPool._http3EncodedAuthorityHostHeader, System.Net.Http.HttpConnectionPool._kind, System.Net.Http.HttpConnectionSettings._maxConnectionsPerServer, System.Net.Http.HttpConnectionPool._maxHttp11Connections, System.Net.Http.HttpConnectionPool._originAuthority, System.Net.Http.HttpConnectionPool._poolManager, System.Net.Http.HttpConnectionSettings._preAuthenticate, System.Net.Http.HttpConnectionPool._proxyUri, System.Net.Http.HttpConnectionPool._sslOptionsHttp11, System.Net.Http.HttpConnectionPool._sslOptionsHttp2, System.Net.Http.HttpConnectionPool._sslOptionsHttp2Only, System.Net.Http.HttpConnectionPool._sslOptionsHttp3, System.Text.Encoding.ASCII, System.Net.Http.HttpConnectionPool.ConstructSslOptions(), System.Net.Quic.QuicImplementationProviders.Default, System.Net.Http.HPack.HPackEncoder.EncodeLiteralHeaderFieldWithoutIndexingToAllocatedArray(), System.Net.Http.QPack.QPackEncoder.EncodeLiteralHeaderFieldWithStaticNameReferenceToArray(), System.Net.Http.HttpAuthority.IdnHost, System.Net.Http.HttpConnectionPool.IsHttp3Supported(), System.Net.NetEventSource.Log, System.Net.Http.HttpConnectionPool.PreAuthCredentials, System.Net.Http.HttpConnectionPool.s_http2ApplicationProtocols, System.Net.Http.HttpConnectionPool.s_http2OnlyApplicationProtocols, System.Net.Http.HttpConnectionPool.s_http3ApplicationProtocols, System.Net.Http.HttpConnectionPool.Settings, System.Net.Http.HttpConnectionPoolManager.Settings, System.text, System.Net.Http.HttpConnectionPool.Trace(), and System.Net.HttpVersion.Version20.