1
0
Fork 0

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
1 changed files with 2 additions and 1 deletions

View File

@ -77,6 +77,7 @@ namespace GalleryShare
/// <param name="cycle">The Http request to handle.</param>
private async Task Handle(HttpListenerContext cycle)
{
IPEndPoint remoteEndpoint = cycle.Request.RemoteEndPoint;
try
{
await router.RouteRequest(cycle);
@ -86,7 +87,7 @@ namespace GalleryShare
{
Console.WriteLine("[{0}] [{1}] [Error] {2} ({3})",
DateTime.Now.ToString("hh:m tt"),
cycle.Request.RemoteEndPoint,
remoteEndpoint,
cycle.Request.RawUrl,
error.Message
);