Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
dotNET Platform
runtime
提交
cf10c2dc
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,发现更多精彩内容 >>
未验证
提交
cf10c2dc
编写于
6月 11, 2021
作者:
T
Tomas Weinfurt
提交者:
GitHub
6月 11, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
make MsQuicStatusCodes platform specific (#54031)
* make MsQuicStatusCodes platform specific * add missing StreamLimit
上级
9ea8c200
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
139 addition
and
125 deletion
+139
-125
src/libraries/System.Net.Quic/src/System.Net.Quic.csproj
src/libraries/System.Net.Quic/src/System.Net.Quic.csproj
+15
-1
src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/MsQuic/Interop/MsQuicStatusCodes.Linux.cs
...Implementations/MsQuic/Interop/MsQuicStatusCodes.Linux.cs
+32
-0
src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/MsQuic/Interop/MsQuicStatusCodes.OSX.cs
...c/Implementations/MsQuic/Interop/MsQuicStatusCodes.OSX.cs
+32
-0
src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/MsQuic/Interop/MsQuicStatusCodes.Windows.cs
...plementations/MsQuic/Interop/MsQuicStatusCodes.Windows.cs
+32
-0
src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/MsQuic/Interop/MsQuicStatusCodes.cs
.../Quic/Implementations/MsQuic/Interop/MsQuicStatusCodes.cs
+28
-124
未找到文件。
src/libraries/System.Net.Quic/src/System.Net.Quic.csproj
浏览文件 @
cf10c2dc
...
...
@@ -15,7 +15,16 @@
<Compile Include="System\Net\Quic\Implementations\Mock\*.cs" />
<Compile Include="System\Net\Quic\Implementations\MsQuic\*.cs" />
<Compile Include="System\Net\Quic\Implementations\MsQuic\Internal\*.cs" />
<Compile Include="System\Net\Quic\Implementations\MsQuic\Interop\*.cs" />
<Compile Include="System\Net\Quic\Implementations\MsQuic\Interop\MsQuicAlpnHelper.cs" />
<Compile Include="System\Net\Quic\Implementations\MsQuic\Interop\MsQuicEnums.cs" />
<Compile Include="System\Net\Quic\Implementations\MsQuic\Interop\MsQuicNativeMethods.cs" />
<Compile Include="System\Net\Quic\Implementations\MsQuic\Interop\MsQuicStatusCodes.cs" />
<Compile Include="System\Net\Quic\Implementations\MsQuic\Interop\MsQuicStatusHelper.cs" />
<Compile Include="System\Net\Quic\Implementations\MsQuic\Interop\SafeMsQuicConfigurationHandle.cs" />
<Compile Include="System\Net\Quic\Implementations\MsQuic\Interop\SafeMsQuicConnectionHandle.cs" />
<Compile Include="System\Net\Quic\Implementations\MsQuic\Interop\SafeMsQuicListenerHandle.cs" />
<Compile Include="System\Net\Quic\Implementations\MsQuic\Interop\SafeMsQuicRegistrationHandle.cs" />
<Compile Include="System\Net\Quic\Implementations\MsQuic\Interop\SafeMsQuicStreamHandle.cs" />
</ItemGroup>
<!-- System.Net common -->
<ItemGroup Condition="'$(TargetsAnyOS)' != 'true'">
...
...
@@ -28,18 +37,23 @@
<!-- Windows specific files -->
<ItemGroup Condition=" '$(TargetsWindows)' == 'true'">
<Compile Include="$(CommonPath)Interop\Windows\Interop.Libraries.cs" Link="Common\Interop\Windows\Interop.Libraries.cs" />
<Compile Include="System\Net\Quic\Implementations\MsQuic\Interop\MsQuicStatusCodes.Windows.cs" />
</ItemGroup>
<!-- Linux specific files -->
<ItemGroup Condition="'$(TargetsLinux)' == 'true'">
<Compile Include="$(CommonPath)Interop\Linux\Interop.Libraries.cs" Link="Common\Interop\Linux\Interop.Libraries.cs" />
<Compile Include="System\Net\Quic\Implementations\MsQuic\Interop\MsQuicStatusCodes.Linux.cs" />
</ItemGroup>
<!-- FreeBSD specific files -->
<ItemGroup Condition="'$(TargetsFreeBSD)' == 'true' ">
<Compile Include="$(CommonPath)Interop\FreeBSD\Interop.Libraries.cs" Link="Common\Interop\FreeBSD\Interop.Libraries.cs" />
<!-- Assume similarity with OSX for now -->
<Compile Include="System\Net\Quic\Implementations\MsQuic\Interop\MsQuicStatusCodes.OSX.cs" />
</ItemGroup>
<!-- OSX specific files -->
<ItemGroup Condition=" '$(TargetsOSX)' == 'true'">
<Compile Include="$(CommonPath)Interop\OSX\Interop.Libraries.cs" Link="Common\Interop\OSX\Interop.Libraries.cs" />
<Compile Include="System\Net\Quic\Implementations\MsQuic\Interop\MsQuicStatusCodes.OSX.cs" />
</ItemGroup>
<!-- Project references -->
<ItemGroup>
...
...
src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/MsQuic/Interop/MsQuicStatusCodes.Linux.cs
0 → 100644
浏览文件 @
cf10c2dc
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
namespace
System.Net.Quic.Implementations.MsQuic.Internal
{
internal
static
partial
class
MsQuicStatusCodes
{
internal
const
uint
Success
=
0
;
internal
const
uint
Pending
=
unchecked
((
uint
)-
2
);
internal
const
uint
Continue
=
unchecked
((
uint
)-
1
);
internal
const
uint
OutOfMemory
=
12
;
// ENOMEM
internal
const
uint
InvalidParameter
=
22
;
// EINVAL
internal
const
uint
InvalidState
=
1
;
// EPERM
internal
const
uint
NotSupported
=
95
;
// EOPNOTSUPP
internal
const
uint
NotFound
=
2
;
// ENOENT
internal
const
uint
BufferTooSmall
=
75
;
// EOVERFLOW
internal
const
uint
HandshakeFailure
=
103
;
// ECONNABORTED
internal
const
uint
Aborted
=
125
;
// ECANCELED
internal
const
uint
AddressInUse
=
98
;
// EADDRINUSE
internal
const
uint
ConnectionTimeout
=
110
;
// ETIMEDOUT
internal
const
uint
ConnectionIdle
=
62
;
// ETIME
internal
const
uint
HostUnreachable
=
113
;
// EHOSTUNREACH
internal
const
uint
InternalError
=
5
;
// EIO
internal
const
uint
ConnectionRefused
=
111
;
// ECONNREFUSED
internal
const
uint
ProtocolError
=
71
;
// EPROTO
internal
const
uint
VerNegError
=
93
;
// EPROTONOSUPPORT
internal
const
uint
TlsError
=
126
;
// ENOKEY
internal
const
uint
UserCanceled
=
130
;
// EOWNERDEAD
internal
const
uint
AlpnNegotiationFailure
=
92
;
// ENOPROTOOPT
internal
const
uint
StreamLimit
=
86
;
// ESTRPIPE
}
}
src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/MsQuic/Interop/MsQuicStatusCodes.OSX.cs
0 → 100644
浏览文件 @
cf10c2dc
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
namespace
System.Net.Quic.Implementations.MsQuic.Internal
{
internal
static
partial
class
MsQuicStatusCodes
{
internal
const
uint
Success
=
0
;
internal
const
uint
Pending
=
unchecked
((
uint
)-
2
);
internal
const
uint
Continue
=
unchecked
((
uint
)-
1
);
internal
const
uint
OutOfMemory
=
12
;
// ENOMEM
internal
const
uint
InvalidParameter
=
22
;
// EINVAL
internal
const
uint
InvalidState
=
1
;
// EPERM
internal
const
uint
NotSupported
=
102
;
// EOPNOTSUPP
internal
const
uint
NotFound
=
2
;
// ENOENT
internal
const
uint
BufferTooSmall
=
84
;
// EOVERFLOW
internal
const
uint
HandshakeFailure
=
53
;
// ECONNABORTED
internal
const
uint
Aborted
=
89
;
// ECANCELED
internal
const
uint
AddressInUse
=
48
;
// EADDRINUSE
internal
const
uint
ConnectionTimeout
=
60
;
// ETIMEDOUT
internal
const
uint
ConnectionIdle
=
101
;
// ETIME
internal
const
uint
HostUnreachable
=
65
;
// EHOSTUNREACH
internal
const
uint
InternalError
=
5
;
// EIO
internal
const
uint
ConnectionRefused
=
61
;
// ECONNREFUSED
internal
const
uint
ProtocolError
=
100
;
// EPROTO
internal
const
uint
VerNegError
=
43
;
// EPROTONOSUPPORT
internal
const
uint
TlsError
=
126
;
// ENOKEY Linux value
internal
const
uint
UserCanceled
=
105
;
// EOWNERDEAD
internal
const
uint
AlpnNegotiationFailure
=
42
;
// ENOPROTOOPT
internal
const
uint
StreamLimit
=
86
;
// ESTRPIPE Linux value
}
}
src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/MsQuic/Interop/MsQuicStatusCodes.Windows.cs
0 → 100644
浏览文件 @
cf10c2dc
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
namespace
System.Net.Quic.Implementations.MsQuic.Internal
{
internal
static
partial
class
MsQuicStatusCodes
{
internal
const
uint
Success
=
0
;
internal
const
uint
Pending
=
0x703E5
;
internal
const
uint
Continue
=
0x704DE
;
internal
const
uint
OutOfMemory
=
0x8007000E
;
internal
const
uint
InvalidParameter
=
0x80070057
;
internal
const
uint
InvalidState
=
0x8007139F
;
internal
const
uint
NotSupported
=
0x80004002
;
internal
const
uint
NotFound
=
0x80070490
;
internal
const
uint
BufferTooSmall
=
0x8007007A
;
internal
const
uint
HandshakeFailure
=
0x80410000
;
internal
const
uint
Aborted
=
0x80004004
;
internal
const
uint
AddressInUse
=
0x80072740
;
internal
const
uint
ConnectionTimeout
=
0x80410006
;
internal
const
uint
ConnectionIdle
=
0x80410005
;
internal
const
uint
HostUnreachable
=
0x800704D0
;
internal
const
uint
InternalError
=
0x80410003
;
internal
const
uint
ConnectionRefused
=
0x800704C9
;
internal
const
uint
ProtocolError
=
0x80410004
;
internal
const
uint
VerNegError
=
0x80410001
;
internal
const
uint
TlsError
=
0x80072B18
;
internal
const
uint
UserCanceled
=
0x80410002
;
internal
const
uint
AlpnNegotiationFailure
=
0x80410007
;
internal
const
uint
StreamLimit
=
0x80410008
;
}
}
src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/MsQuic/Interop/MsQuicStatusCodes.cs
浏览文件 @
cf10c2dc
...
...
@@ -3,134 +3,38 @@
namespace
System.Net.Quic.Implementations.MsQuic.Internal
{
internal
static
class
MsQuicStatusCodes
internal
static
partial
class
MsQuicStatusCodes
{
internal
static
uint
Success
=>
OperatingSystem
.
IsWindows
()
?
Windows
.
Success
:
Posix
.
Success
;
internal
static
uint
Pending
=>
OperatingSystem
.
IsWindows
()
?
Windows
.
Pending
:
Posix
.
Pending
;
internal
static
uint
InternalError
=>
OperatingSystem
.
IsWindows
()
?
Windows
.
InternalError
:
Posix
.
InternalError
;
internal
static
uint
InvalidState
=>
OperatingSystem
.
IsWindows
()
?
Windows
.
InvalidState
:
Posix
.
InvalidState
;
internal
static
uint
HandshakeFailure
=>
OperatingSystem
.
IsWindows
()
?
Windows
.
HandshakeFailure
:
Posix
.
HandshakeFailure
;
internal
static
uint
UserCanceled
=>
OperatingSystem
.
IsWindows
()
?
Windows
.
UserCanceled
:
Posix
.
UserCanceled
;
// TODO return better error messages here.
public
static
string
GetError
(
uint
status
)
=>
OperatingSystem
.
IsWindows
()
?
Windows
.
GetError
(
status
)
:
Posix
.
GetError
(
status
);
private
static
class
Windows
{
internal
const
uint
Success
=
0
;
internal
const
uint
Pending
=
0x703E5
;
internal
const
uint
Continue
=
0x704DE
;
internal
const
uint
OutOfMemory
=
0x8007000E
;
internal
const
uint
InvalidParameter
=
0x80070057
;
internal
const
uint
InvalidState
=
0x8007139F
;
internal
const
uint
NotSupported
=
0x80004002
;
internal
const
uint
NotFound
=
0x80070490
;
internal
const
uint
BufferTooSmall
=
0x8007007A
;
internal
const
uint
HandshakeFailure
=
0x80410000
;
internal
const
uint
Aborted
=
0x80004004
;
internal
const
uint
AddressInUse
=
0x80072740
;
internal
const
uint
ConnectionTimeout
=
0x80410006
;
internal
const
uint
ConnectionIdle
=
0x80410005
;
internal
const
uint
HostUnreachable
=
0x800704D0
;
internal
const
uint
InternalError
=
0x80410003
;
internal
const
uint
ConnectionRefused
=
0x800704C9
;
internal
const
uint
ProtocolError
=
0x80410004
;
internal
const
uint
VerNegError
=
0x80410001
;
internal
const
uint
TlsError
=
0x80072B18
;
internal
const
uint
UserCanceled
=
0x80410002
;
internal
const
uint
AlpnNegotiationFailure
=
0x80410007
;
// TODO return better error messages here.
public
static
string
GetError
(
uint
status
)
{
return
status
switch
{
Success
=>
"SUCCESS"
,
Pending
=>
"PENDING"
,
Continue
=>
"CONTINUE"
,
OutOfMemory
=>
"OUT_OF_MEMORY"
,
InvalidParameter
=>
"INVALID_PARAMETER"
,
InvalidState
=>
"INVALID_STATE"
,
NotSupported
=>
"NOT_SUPPORTED"
,
NotFound
=>
"NOT_FOUND"
,
BufferTooSmall
=>
"BUFFER_TOO_SMALL"
,
HandshakeFailure
=>
"HANDSHAKE_FAILURE"
,
Aborted
=>
"ABORTED"
,
AddressInUse
=>
"ADDRESS_IN_USE"
,
ConnectionTimeout
=>
"CONNECTION_TIMEOUT"
,
ConnectionIdle
=>
"CONNECTION_IDLE"
,
HostUnreachable
=>
"UNREACHABLE"
,
InternalError
=>
"INTERNAL_ERROR"
,
ConnectionRefused
=>
"CONNECTION_REFUSED"
,
ProtocolError
=>
"PROTOCOL_ERROR"
,
VerNegError
=>
"VER_NEG_ERROR"
,
TlsError
=>
"TLS_ERROR"
,
UserCanceled
=>
"USER_CANCELED"
,
AlpnNegotiationFailure
=>
"ALPN_NEG_FAILURE"
,
_
=>
$"0x
{
status
:
X8
}
"
};
}
}
private
static
class
Posix
public
static
string
GetError
(
uint
status
)
{
internal
const
uint
Success
=
0
;
internal
const
uint
Pending
=
unchecked
((
uint
)-
2
);
internal
const
uint
Continue
=
unchecked
((
uint
)-
1
);
internal
const
uint
OutOfMemory
=
12
;
internal
const
uint
InvalidParameter
=
22
;
internal
const
uint
InvalidState
=
200000002
;
internal
const
uint
NotSupported
=
95
;
internal
const
uint
NotFound
=
2
;
internal
const
uint
BufferTooSmall
=
75
;
internal
const
uint
HandshakeFailure
=
200000009
;
internal
const
uint
Aborted
=
200000008
;
internal
const
uint
AddressInUse
=
98
;
internal
const
uint
ConnectionTimeout
=
110
;
internal
const
uint
ConnectionIdle
=
200000011
;
internal
const
uint
InternalError
=
200000012
;
internal
const
uint
ConnectionRefused
=
200000007
;
internal
const
uint
ProtocolError
=
200000013
;
internal
const
uint
VerNegError
=
200000014
;
internal
const
uint
EpollError
=
200000015
;
internal
const
uint
DnsResolutionError
=
200000016
;
internal
const
uint
SocketError
=
200000017
;
internal
const
uint
TlsError
=
200000018
;
internal
const
uint
UserCanceled
=
200000019
;
internal
const
uint
AlpnNegotiationFailure
=
200000020
;
// TODO return better error messages here.
public
static
string
GetError
(
uint
status
)
return
status
switch
{
return
status
switch
{
Success
=>
"SUCCESS"
,
Pending
=>
"PENDING"
,
Continue
=>
"CONTINUE"
,
OutOfMemory
=>
"OUT_OF_MEMORY"
,
InvalidParameter
=>
"INVALID_PARAMETER"
,
InvalidState
=>
"INVALID_STATE"
,
NotSupported
=>
"NOT_SUPPORTED"
,
NotFound
=>
"NOT_FOUND"
,
BufferTooSmall
=>
"BUFFER_TOO_SMALL"
,
HandshakeFailure
=>
"HANDSHAKE_FAILURE"
,
Aborted
=>
"ABORTED"
,
AddressInUse
=>
"ADDRESS_IN_USE"
,
ConnectionTimeout
=>
"CONNECTION_TIMEOUT"
,
ConnectionIdle
=>
"CONNECTION_IDLE"
,
InternalError
=>
"INTERNAL_ERROR"
,
ConnectionRefused
=>
"CONNECTION_REFUSED"
,
ProtocolError
=>
"PROTOCOL_ERROR"
,
VerNegError
=>
"VER_NEG_ERROR"
,
EpollError
=>
"EPOLL_ERROR"
,
DnsResolutionError
=>
"DNS_RESOLUTION_ERROR"
,
SocketError
=>
"SOCKET_ERROR"
,
TlsError
=>
"TLS_ERROR"
,
UserCanceled
=>
"USER_CANCELED"
,
AlpnNegotiationFailure
=>
"ALPN_NEG_FAILURE"
,
_
=>
$"0x
{
status
:
X8
}
"
};
}
Success
=>
"SUCCESS"
,
Pending
=>
"PENDING"
,
Continue
=>
"CONTINUE"
,
OutOfMemory
=>
"OUT_OF_MEMORY"
,
InvalidParameter
=>
"INVALID_PARAMETER"
,
InvalidState
=>
"INVALID_STATE"
,
NotSupported
=>
"NOT_SUPPORTED"
,
NotFound
=>
"NOT_FOUND"
,
BufferTooSmall
=>
"BUFFER_TOO_SMALL"
,
HandshakeFailure
=>
"HANDSHAKE_FAILURE"
,
Aborted
=>
"ABORTED"
,
AddressInUse
=>
"ADDRESS_IN_USE"
,
ConnectionTimeout
=>
"CONNECTION_TIMEOUT"
,
ConnectionIdle
=>
"CONNECTION_IDLE"
,
HostUnreachable
=>
"UNREACHABLE"
,
InternalError
=>
"INTERNAL_ERROR"
,
ConnectionRefused
=>
"CONNECTION_REFUSED"
,
ProtocolError
=>
"PROTOCOL_ERROR"
,
VerNegError
=>
"VER_NEG_ERROR"
,
TlsError
=>
"TLS_ERROR"
,
UserCanceled
=>
"USER_CANCELED"
,
AlpnNegotiationFailure
=>
"ALPN_NEG_FAILURE"
,
StreamLimit
=>
"STREAM_LIMIT_REACHED"
,
_
=>
$"0x
{
status
:
X8
}
"
};
}
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录