diff --git a/ln.http/HTTPServer.cs b/ln.http/HTTPServer.cs index 24212e1..873a40c 100644 --- a/ln.http/HTTPServer.cs +++ b/ln.http/HTTPServer.cs @@ -151,8 +151,15 @@ namespace ln.http .Content(String.Format("An internal error occured ({0})", exception.ToString())); } - httpContext.Response.WriteTo(connection.GetStream()); - httpContext.Response?.ContentStream?.Dispose(); + try + { + httpContext.Response.WriteTo(connection.GetStream()); + httpContext.Response?.ContentStream?.Dispose(); + } + catch (IOException ioexception) + { + break; + } keepalive = httpContext.Response.GetHeader("connection", "keep-alive").Equals("keep-alive") && httpRequest .GetRequestHeader("connection",