Improved request error handling.
This commit is contained in:
Родитель
28d56fe3fc
Коммит
a8e4f69fc7
|
@ -127,7 +127,7 @@ namespace Microsoft.AspNetCore.Server.WebListener
|
||||||
{
|
{
|
||||||
LogHelper.LogException(_logger, "ListenForNextRequestAsync", exception);
|
LogHelper.LogException(_logger, "ListenForNextRequestAsync", exception);
|
||||||
}
|
}
|
||||||
return;
|
continue;
|
||||||
}
|
}
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
|
@ -79,6 +79,11 @@ namespace Microsoft.Net.Http.Server
|
||||||
complete = true;
|
complete = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
catch (Exception)
|
||||||
|
{
|
||||||
|
server.SendError(asyncResult._nativeRequestContext.RequestId, HttpStatusCode.BadRequest);
|
||||||
|
throw;
|
||||||
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
if (stoleBlob)
|
if (stoleBlob)
|
||||||
|
|
|
@ -318,7 +318,7 @@ namespace Microsoft.Net.Http.Server
|
||||||
return true;
|
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();
|
HttpApi.HTTP_RESPONSE_V2 httpResponse = new HttpApi.HTTP_RESPONSE_V2();
|
||||||
httpResponse.Response_V1.Version = new HttpApi.HTTP_VERSION();
|
httpResponse.Response_V1.Version = new HttpApi.HTTP_VERSION();
|
||||||
|
|
Загрузка…
Ссылка в новой задаче