1
0
Fork 0
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:
Starbeamrainbowlabs 2016-07-17 16:17:43 +01:00
parent b0b569dbf3
commit d1343a472e

View file

@ -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
); );