| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- commit cfd974337da492149fd7bb55688286d8b603b64b
- Author: Chris Ross (ASP.NET) <[email protected]>
- Date: Fri Nov 3 09:45:45 2017 -0700
- Improved request error handling.
- diff --git a/src/Microsoft.AspNetCore.Server.HttpSys/AsyncAcceptContext.cs b/src/Microsoft.AspNetCore.Server.HttpSys/AsyncAcceptContext.cs
- index 01e74c19904..4c0cd867563 100644
- --- a/src/Microsoft.AspNetCore.Server.HttpSys/AsyncAcceptContext.cs
- +++ b/src/Microsoft.AspNetCore.Server.HttpSys/AsyncAcceptContext.cs
- @@ -6,6 +6,7 @@ using System.Diagnostics.CodeAnalysis;
- using System.Runtime.InteropServices;
- using System.Threading;
- using System.Threading.Tasks;
- +using Microsoft.AspNetCore.Http;
- using Microsoft.AspNetCore.HttpSys.Internal;
-
- namespace Microsoft.AspNetCore.Server.HttpSys
- @@ -80,6 +81,11 @@ namespace Microsoft.AspNetCore.Server.HttpSys
- complete = true;
- }
- }
- + catch (Exception)
- + {
- + server.SendError(asyncResult._nativeRequestContext.RequestId, StatusCodes.Status400BadRequest);
- + throw;
- + }
- finally
- {
- // The request has been handed to the user, which means this code can't reuse the blob. Reset it here.
- diff --git a/src/Microsoft.AspNetCore.Server.HttpSys/HttpSysListener.cs b/src/Microsoft.AspNetCore.Server.HttpSys/HttpSysListener.cs
- index 2c70016e3f2..a1ad7493d8b 100644
- --- a/src/Microsoft.AspNetCore.Server.HttpSys/HttpSysListener.cs
- +++ b/src/Microsoft.AspNetCore.Server.HttpSys/HttpSysListener.cs
- @@ -316,7 +316,7 @@ namespace Microsoft.AspNetCore.Server.HttpSys
- return true;
- }
-
- - private unsafe void SendError(ulong requestId, int httpStatusCode, IList<string> authChallenges)
- + internal unsafe void SendError(ulong requestId, int httpStatusCode, IList<string> authChallenges = null)
- {
- HttpApiTypes.HTTP_RESPONSE_V2 httpResponse = new HttpApiTypes.HTTP_RESPONSE_V2();
- httpResponse.Response_V1.Version = new HttpApiTypes.HTTP_VERSION();
- diff --git a/src/Microsoft.AspNetCore.Server.HttpSys/MessagePump.cs b/src/Microsoft.AspNetCore.Server.HttpSys/MessagePump.cs
- index 2b060669363..e70c52d89cb 100644
- --- a/src/Microsoft.AspNetCore.Server.HttpSys/MessagePump.cs
- +++ b/src/Microsoft.AspNetCore.Server.HttpSys/MessagePump.cs
- @@ -168,7 +168,7 @@ namespace Microsoft.AspNetCore.Server.HttpSys
- {
- LogHelper.LogException(_logger, "ListenForNextRequestAsync", exception);
- }
- - return;
- + continue;
- }
- try
- {
|