Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
dotNET Platform
runtime
提交
56196485
R
runtime
项目概览
dotNET Platform
/
runtime
12 个月 前同步成功
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
runtime
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
56196485
编写于
4月 04, 2023
作者:
T
Tomas Weinfurt
提交者:
GitHub
4月 04, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
don't load MsQuic unless needed by HttpClient (#83494)
* don't load MsQuic unless needed by HttpClient * feedback from review
上级
50c9dca3
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
20 addition
and
13 deletion
+20
-13
src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpConnectionPool.cs
.../System/Net/Http/SocketsHttpHandler/HttpConnectionPool.cs
+20
-13
未找到文件。
src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpConnectionPool.cs
浏览文件 @
56196485
...
...
@@ -93,7 +93,7 @@ internal sealed class HttpConnectionPool : IDisposable
private
bool
_http2Enabled
;
private
byte
[]?
_http2AltSvcOriginUri
;
internal
readonly
byte
[]?
_http2EncodedAuthorityHostHeader
;
private
readonly
bool
_http3Enabled
;
private
bool
_http3Enabled
;
private
Http3Connection
?
_http3Connection
;
private
SemaphoreSlim
?
_http3ConnectionCreateLock
;
internal
readonly
byte
[]?
_http3EncodedAuthorityHostHeader
;
...
...
@@ -113,7 +113,7 @@ internal sealed class HttpConnectionPool : IDisposable
private
readonly
SslClientAuthenticationOptions
?
_sslOptionsHttp11
;
private
readonly
SslClientAuthenticationOptions
?
_sslOptionsHttp2
;
private
readonly
SslClientAuthenticationOptions
?
_sslOptionsHttp2Only
;
private
readonly
SslClientAuthenticationOptions
?
_sslOptionsHttp3
;
private
SslClientAuthenticationOptions
?
_sslOptionsHttp3
;
/// <summary>Whether the pool has been used since the last time a cleanup occurred.</summary>
private
bool
_usedSinceLastCleanup
=
true
;
...
...
@@ -146,7 +146,7 @@ public HttpConnectionPool(HttpConnectionPoolManager poolManager, HttpConnectionK
if
(
IsHttp3Supported
())
{
_http3Enabled
=
_poolManager
.
Settings
.
_maxHttpVersion
>=
HttpVersion
.
Version30
&&
QuicConnection
.
IsSupported
;
_http3Enabled
=
_poolManager
.
Settings
.
_maxHttpVersion
>=
HttpVersion
.
Version30
;
}
switch
(
kind
)
...
...
@@ -288,15 +288,6 @@ public HttpConnectionPool(HttpConnectionPoolManager poolManager, HttpConnectionK
_http2EncodedAuthorityHostHeader
=
HPackEncoder
.
EncodeLiteralHeaderFieldWithoutIndexingToAllocatedArray
(
H2StaticTable
.
Authority
,
hostHeader
);
_http3EncodedAuthorityHostHeader
=
QPackEncoder
.
EncodeLiteralHeaderFieldWithStaticNameReferenceToArray
(
H3StaticTable
.
Authority
,
hostHeader
);
}
if
(
IsHttp3Supported
())
{
if
(
_http3Enabled
)
{
_sslOptionsHttp3
=
ConstructSslOptions
(
poolManager
,
sslHostName
);
_sslOptionsHttp3
.
ApplicationProtocols
=
s_http3ApplicationProtocols
;
}
}
}
// Set up for PreAuthenticate. Access to this cache is guarded by a lock on the cache itself.
...
...
@@ -1047,7 +1038,23 @@ public async ValueTask<HttpResponseMessage> SendWithVersionDetectionAndRetryAsyn
!
request
.
IsExtendedConnectRequest
)
{
Debug
.
Assert
(
async
);
response
=
await
TrySendUsingHttp3Async
(
request
,
cancellationToken
).
ConfigureAwait
(
false
);
if
(
QuicConnection
.
IsSupported
)
{
if
(
_sslOptionsHttp3
==
null
)
{
// deferred creation. We use atomic exchange to be sure all threads point to single object to mimic ctor behavior.
SslClientAuthenticationOptions
sslOptionsHttp3
=
ConstructSslOptions
(
_poolManager
,
_sslOptionsHttp11
!.
TargetHost
!);
sslOptionsHttp3
.
ApplicationProtocols
=
s_http3ApplicationProtocols
;
Interlocked
.
CompareExchange
(
ref
_sslOptionsHttp3
,
sslOptionsHttp3
,
null
);
}
response
=
await
TrySendUsingHttp3Async
(
request
,
cancellationToken
).
ConfigureAwait
(
false
);
}
else
{
_altSvcEnabled
=
false
;
_http3Enabled
=
false
;
}
}
if
(
response
is
null
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录