diff -r c37f2b5ee55b -r 0bad639907a3 Utilities/HttpServer.cs --- a/Utilities/HttpServer.cs Sun Jun 09 17:50:45 2013 +0000 +++ b/Utilities/HttpServer.cs Sun Jun 09 19:25:44 2013 +0000 @@ -5,7 +5,7 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/. Copyright (C) 2012 Prince Samuel - Copyright (C) 2012 Michael Möller + Copyright (C) 2012-2013 Michael Möller */ @@ -37,6 +37,7 @@ try { listener = new HttpListener(); + listener.IgnoreWriteExceptions = true; } catch (PlatformNotSupportedException) { listener = null; } @@ -156,10 +157,12 @@ while ((len = stream.Read(buffer, 0, buffer.Length)) > 0) { output.Write(buffer, 0, len); } - output.Close(); - } catch (HttpListenerException) { + output.Flush(); + output.Close(); + response.Close(); + } catch (HttpListenerException) { + } catch (InvalidOperationException) { } - response.Close(); return; } }