Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
dotNET Platform
runtime
提交
472f11c1
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,发现更多精彩内容 >>
未验证
提交
472f11c1
编写于
6月 18, 2021
作者:
T
Tomas Weinfurt
提交者:
GitHub
6月 18, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix MsQuicStream counting on failure (#54249)
上级
f721cf41
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
6 addition
and
8 deletion
+6
-8
src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/MsQuic/MsQuicStream.cs
...rc/System/Net/Quic/Implementations/MsQuic/MsQuicStream.cs
+4
-4
src/libraries/System.Net.Quic/tests/FunctionalTests/MsQuicTests.cs
...ries/System.Net.Quic/tests/FunctionalTests/MsQuicTests.cs
+2
-4
未找到文件。
src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/MsQuic/MsQuicStream.cs
浏览文件 @
472f11c1
...
@@ -74,7 +74,6 @@ private sealed class State
...
@@ -74,7 +74,6 @@ private sealed class State
internal
MsQuicStream
(
MsQuicConnection
.
State
connectionState
,
SafeMsQuicStreamHandle
streamHandle
,
QUIC_STREAM_OPEN_FLAGS
flags
)
internal
MsQuicStream
(
MsQuicConnection
.
State
connectionState
,
SafeMsQuicStreamHandle
streamHandle
,
QUIC_STREAM_OPEN_FLAGS
flags
)
{
{
_state
.
Handle
=
streamHandle
;
_state
.
Handle
=
streamHandle
;
_state
.
ConnectionState
=
connectionState
;
_canRead
=
true
;
_canRead
=
true
;
_canWrite
=
!
flags
.
HasFlag
(
QUIC_STREAM_OPEN_FLAGS
.
UNIDIRECTIONAL
);
_canWrite
=
!
flags
.
HasFlag
(
QUIC_STREAM_OPEN_FLAGS
.
UNIDIRECTIONAL
);
_started
=
true
;
_started
=
true
;
...
@@ -99,6 +98,8 @@ internal MsQuicStream(MsQuicConnection.State connectionState, SafeMsQuicStreamHa
...
@@ -99,6 +98,8 @@ internal MsQuicStream(MsQuicConnection.State connectionState, SafeMsQuicStreamHa
throw
new
ObjectDisposedException
(
nameof
(
QuicConnection
));
throw
new
ObjectDisposedException
(
nameof
(
QuicConnection
));
}
}
_state
.
ConnectionState
=
connectionState
;
if
(
NetEventSource
.
Log
.
IsEnabled
())
if
(
NetEventSource
.
Log
.
IsEnabled
())
{
{
NetEventSource
.
Info
(
NetEventSource
.
Info
(
...
@@ -113,10 +114,8 @@ internal MsQuicStream(MsQuicConnection.State connectionState, QUIC_STREAM_OPEN_F
...
@@ -113,10 +114,8 @@ internal MsQuicStream(MsQuicConnection.State connectionState, QUIC_STREAM_OPEN_F
{
{
Debug
.
Assert
(
connectionState
.
Handle
!=
null
);
Debug
.
Assert
(
connectionState
.
Handle
!=
null
);
_state
.
ConnectionState
=
connectionState
;
_canRead
=
!
flags
.
HasFlag
(
QUIC_STREAM_OPEN_FLAGS
.
UNIDIRECTIONAL
);
_canRead
=
!
flags
.
HasFlag
(
QUIC_STREAM_OPEN_FLAGS
.
UNIDIRECTIONAL
);
_canWrite
=
true
;
_canWrite
=
true
;
_stateHandle
=
GCHandle
.
Alloc
(
_state
);
_stateHandle
=
GCHandle
.
Alloc
(
_state
);
try
try
{
{
...
@@ -146,6 +145,8 @@ internal MsQuicStream(MsQuicConnection.State connectionState, QUIC_STREAM_OPEN_F
...
@@ -146,6 +145,8 @@ internal MsQuicStream(MsQuicConnection.State connectionState, QUIC_STREAM_OPEN_F
throw
new
ObjectDisposedException
(
nameof
(
QuicConnection
));
throw
new
ObjectDisposedException
(
nameof
(
QuicConnection
));
}
}
_state
.
ConnectionState
=
connectionState
;
if
(
NetEventSource
.
Log
.
IsEnabled
())
if
(
NetEventSource
.
Log
.
IsEnabled
())
{
{
NetEventSource
.
Info
(
NetEventSource
.
Info
(
...
@@ -569,7 +570,6 @@ private void Dispose(bool disposing)
...
@@ -569,7 +570,6 @@ private void Dispose(bool disposing)
Marshal
.
FreeHGlobal
(
_state
.
SendQuicBuffers
);
Marshal
.
FreeHGlobal
(
_state
.
SendQuicBuffers
);
if
(
_stateHandle
.
IsAllocated
)
_stateHandle
.
Free
();
if
(
_stateHandle
.
IsAllocated
)
_stateHandle
.
Free
();
CleanupSendState
(
_state
);
CleanupSendState
(
_state
);
Debug
.
Assert
(
_state
.
ConnectionState
!=
null
);
_state
.
ConnectionState
?.
RemoveStream
(
this
);
_state
.
ConnectionState
?.
RemoveStream
(
this
);
if
(
NetEventSource
.
Log
.
IsEnabled
())
if
(
NetEventSource
.
Log
.
IsEnabled
())
...
...
src/libraries/System.Net.Quic/tests/FunctionalTests/MsQuicTests.cs
浏览文件 @
472f11c1
...
@@ -116,7 +116,6 @@ public async Task ConnectWithCertificateChain()
...
@@ -116,7 +116,6 @@ public async Task ConnectWithCertificateChain()
}
}
[
Fact
]
[
Fact
]
[
ActiveIssue
(
"https://github.com/dotnet/runtime/issues/52048"
)]
public
async
Task
WaitForAvailableUnidirectionStreamsAsyncWorks
()
public
async
Task
WaitForAvailableUnidirectionStreamsAsyncWorks
()
{
{
using
QuicListener
listener
=
CreateQuicListener
(
maxUnidirectionalStreams
:
1
);
using
QuicListener
listener
=
CreateQuicListener
(
maxUnidirectionalStreams
:
1
);
...
@@ -126,7 +125,7 @@ public async Task WaitForAvailableUnidirectionStreamsAsyncWorks()
...
@@ -126,7 +125,7 @@ public async Task WaitForAvailableUnidirectionStreamsAsyncWorks()
using
QuicConnection
serverConnection
=
await
listener
.
AcceptConnectionAsync
();
using
QuicConnection
serverConnection
=
await
listener
.
AcceptConnectionAsync
();
await
clientTask
;
await
clientTask
;
// No stream open
n
ed yet, should return immediately.
// No stream opened yet, should return immediately.
Assert
.
True
(
clientConnection
.
WaitForAvailableUnidirectionalStreamsAsync
().
IsCompletedSuccessfully
);
Assert
.
True
(
clientConnection
.
WaitForAvailableUnidirectionalStreamsAsync
().
IsCompletedSuccessfully
);
// Open one stream, should wait till it closes.
// Open one stream, should wait till it closes.
...
@@ -141,7 +140,6 @@ public async Task WaitForAvailableUnidirectionStreamsAsyncWorks()
...
@@ -141,7 +140,6 @@ public async Task WaitForAvailableUnidirectionStreamsAsyncWorks()
}
}
[
Fact
]
[
Fact
]
[
ActiveIssue
(
"https://github.com/dotnet/runtime/issues/52048"
)]
public
async
Task
WaitForAvailableBidirectionStreamsAsyncWorks
()
public
async
Task
WaitForAvailableBidirectionStreamsAsyncWorks
()
{
{
using
QuicListener
listener
=
CreateQuicListener
(
maxBidirectionalStreams
:
1
);
using
QuicListener
listener
=
CreateQuicListener
(
maxBidirectionalStreams
:
1
);
...
@@ -151,7 +149,7 @@ public async Task WaitForAvailableBidirectionStreamsAsyncWorks()
...
@@ -151,7 +149,7 @@ public async Task WaitForAvailableBidirectionStreamsAsyncWorks()
using
QuicConnection
serverConnection
=
await
listener
.
AcceptConnectionAsync
();
using
QuicConnection
serverConnection
=
await
listener
.
AcceptConnectionAsync
();
await
clientTask
;
await
clientTask
;
// No stream open
n
ed yet, should return immediately.
// No stream opened yet, should return immediately.
Assert
.
True
(
clientConnection
.
WaitForAvailableBidirectionalStreamsAsync
().
IsCompletedSuccessfully
);
Assert
.
True
(
clientConnection
.
WaitForAvailableBidirectionalStreamsAsync
().
IsCompletedSuccessfully
);
// Open one stream, should wait till it closes.
// Open one stream, should wait till it closes.
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录