mirror of
https://gitlab.com/sbrl/GalleryShare.git
synced 2018-06-12 22:45:16 +00:00
Bugfix: Prestore remote endpoint so avoid exception when logging errors.
This commit is contained in:
parent
b0b569dbf3
commit
d1343a472e
1 changed files with 2 additions and 1 deletions
|
@ -77,6 +77,7 @@ namespace GalleryShare
|
||||||
/// <param name="cycle">The Http request to handle.</param>
|
/// <param name="cycle">The Http request to handle.</param>
|
||||||
private async Task Handle(HttpListenerContext cycle)
|
private async Task Handle(HttpListenerContext cycle)
|
||||||
{
|
{
|
||||||
|
IPEndPoint remoteEndpoint = cycle.Request.RemoteEndPoint;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
await router.RouteRequest(cycle);
|
await router.RouteRequest(cycle);
|
||||||
|
@ -86,7 +87,7 @@ namespace GalleryShare
|
||||||
{
|
{
|
||||||
Console.WriteLine("[{0}] [{1}] [Error] {2} ({3})",
|
Console.WriteLine("[{0}] [{1}] [Error] {2} ({3})",
|
||||||
DateTime.Now.ToString("hh:m tt"),
|
DateTime.Now.ToString("hh:m tt"),
|
||||||
cycle.Request.RemoteEndPoint,
|
remoteEndpoint,
|
||||||
cycle.Request.RawUrl,
|
cycle.Request.RawUrl,
|
||||||
error.Message
|
error.Message
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in a new issue