Skip to content
This repository has been archived by the owner on Mar 19, 2019. It is now read-only.

Commit

Permalink
Improved request error handling.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tratcher committed Nov 3, 2017
1 parent 5c2e7e9 commit f24a7f2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Microsoft.AspNetCore.Server.WebListener/MessagePump.cs
Expand Up @@ -127,7 +127,7 @@ private async void ProcessRequestsWorker()
{
LogHelper.LogException(_logger, "ListenForNextRequestAsync", exception);
}
return;
continue;
}
try
{
Expand Down
5 changes: 5 additions & 0 deletions src/Microsoft.Net.Http.Server/AsyncAcceptContext.cs
Expand Up @@ -79,6 +79,11 @@ private static void IOCompleted(AsyncAcceptContext asyncResult, uint errorCode,
complete = true;
}
}
catch (Exception)
{
server.SendError(asyncResult._nativeRequestContext.RequestId, HttpStatusCode.BadRequest);
throw;
}
finally
{
if (stoleBlob)
Expand Down
2 changes: 1 addition & 1 deletion src/Microsoft.Net.Http.Server/WebListener.cs
Expand Up @@ -318,7 +318,7 @@ internal unsafe bool ValidateAuth(NativeRequestContext requestMemory)
return true;
}

private unsafe void SendError(ulong requestId, HttpStatusCode httpStatusCode, IList<string> authChallenges)
internal unsafe void SendError(ulong requestId, HttpStatusCode httpStatusCode, IList<string> authChallenges = null)
{
HttpApi.HTTP_RESPONSE_V2 httpResponse = new HttpApi.HTTP_RESPONSE_V2();
httpResponse.Response_V1.Version = new HttpApi.HTTP_VERSION();
Expand Down

0 comments on commit f24a7f2

Please sign in to comment.