diff --git a/src/Servers/HttpSys/src/NativeInterop/RequestQueue.cs b/src/Servers/HttpSys/src/NativeInterop/RequestQueue.cs index ca3d2e7940..bebfa09f96 100644 --- a/src/Servers/HttpSys/src/NativeInterop/RequestQueue.cs +++ b/src/Servers/HttpSys/src/NativeInterop/RequestQueue.cs @@ -24,7 +24,7 @@ namespace Microsoft.AspNetCore.Server.HttpSys { try { - UrlGroup = new UrlGroup(this, UrlPrefix.Create(urlPrefix)); + UrlGroup = new UrlGroup(this, UrlPrefix.Create(urlPrefix), logger); } catch { diff --git a/src/Servers/HttpSys/src/NativeInterop/UrlGroup.cs b/src/Servers/HttpSys/src/NativeInterop/UrlGroup.cs index 1c1f0b72c7..ea6c657813 100644 --- a/src/Servers/HttpSys/src/NativeInterop/UrlGroup.cs +++ b/src/Servers/HttpSys/src/NativeInterop/UrlGroup.cs @@ -16,8 +16,9 @@ namespace Microsoft.AspNetCore.Server.HttpSys private static readonly int RequestPropertyInfoSize = Marshal.SizeOf(); + private readonly ILogger _logger; + private ServerSession _serverSession; - private ILogger _logger; private bool _disposed; private bool _created; @@ -40,8 +41,10 @@ namespace Microsoft.AspNetCore.Server.HttpSys Id = urlGroupId; } - internal unsafe UrlGroup(RequestQueue requestQueue, UrlPrefix url) + internal unsafe UrlGroup(RequestQueue requestQueue, UrlPrefix url, ILogger logger) { + _logger = logger; + ulong urlGroupId = 0; _created = false; var statusCode = HttpApi.HttpFindUrlGroupId( diff --git a/src/Servers/HttpSys/src/RequestProcessing/RequestContext.cs b/src/Servers/HttpSys/src/RequestProcessing/RequestContext.cs index cc7cee0df3..a23c1218e5 100644 --- a/src/Servers/HttpSys/src/RequestProcessing/RequestContext.cs +++ b/src/Servers/HttpSys/src/RequestProcessing/RequestContext.cs @@ -326,6 +326,10 @@ namespace Microsoft.AspNetCore.Server.HttpSys internal unsafe void Delegate(DelegationRule destination) { + if (destination == null) + { + throw new ArgumentNullException(nameof(destination)); + } if (Request.HasRequestBodyStarted) { throw new InvalidOperationException("This request cannot be delegated, the request body has already started.");