diff --git a/src/Servers/HttpSys/src/RequestProcessing/Request.cs b/src/Servers/HttpSys/src/RequestProcessing/Request.cs index 4c887f7a56e..5b7a9b64473 100644 --- a/src/Servers/HttpSys/src/RequestProcessing/Request.cs +++ b/src/Servers/HttpSys/src/RequestProcessing/Request.cs @@ -45,7 +45,9 @@ namespace Microsoft.AspNetCore.Server.HttpSys _contentBoundaryType = BoundaryType.None; RequestId = requestContext.RequestId; + // For HTTP/2 Http.Sys assigns each request a unique connection id for use with API calls, but the RawConnectionId represents the real connection. UConnectionId = requestContext.ConnectionId; + RawConnectionId = requestContext.RawConnectionId; SslStatus = requestContext.SslStatus; KnownMethod = requestContext.VerbId; @@ -115,8 +117,10 @@ namespace Microsoft.AspNetCore.Server.HttpSys internal ulong UConnectionId { get; } + internal ulong RawConnectionId { get; } + // No ulongs in public APIs... - public long ConnectionId => (long)UConnectionId; + public long ConnectionId => (long)RawConnectionId; internal ulong RequestId { get; } diff --git a/src/Shared/HttpSys/RequestProcessing/NativeRequestContext.cs b/src/Shared/HttpSys/RequestProcessing/NativeRequestContext.cs index 77f8633d7d9..51e734bf504 100644 --- a/src/Shared/HttpSys/RequestProcessing/NativeRequestContext.cs +++ b/src/Shared/HttpSys/RequestProcessing/NativeRequestContext.cs @@ -99,6 +99,8 @@ namespace Microsoft.AspNetCore.HttpSys.Internal internal ulong ConnectionId => NativeRequest->ConnectionId; + internal ulong RawConnectionId => NativeRequest->RawConnectionId; + internal HttpApiTypes.HTTP_VERB VerbId => NativeRequest->Verb; internal ulong UrlContext => NativeRequest->UrlContext;