From 5b3897a4af247a14dfd36fa00bb6999e0a1078d5 Mon Sep 17 00:00:00 2001 From: lbsa71 Date: Mon, 25 Feb 2008 15:36:24 +0000 Subject: * Caught HttpListenerException and swallowed if with output * Moved Flush into Close since it's always done in that order. * Minor renamings * Reversed if for clarity --- OpenSim/Framework/Servers/BaseHttpServer.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'OpenSim/Framework/Servers/BaseHttpServer.cs') diff --git a/OpenSim/Framework/Servers/BaseHttpServer.cs b/OpenSim/Framework/Servers/BaseHttpServer.cs index dc540f9..e61cc80 100644 --- a/OpenSim/Framework/Servers/BaseHttpServer.cs +++ b/OpenSim/Framework/Servers/BaseHttpServer.cs @@ -154,8 +154,16 @@ namespace OpenSim.Framework.Servers request.InputStream.Close(); response.ContentType = requestHandler.ContentType; response.ContentLength64 = buffer.LongLength; - response.OutputStream.Write(buffer, 0, buffer.Length); - response.OutputStream.Close(); + + try + { + response.OutputStream.Write(buffer, 0, buffer.Length); + response.OutputStream.Close(); + } + catch (HttpListenerException e) + { + m_log.InfoFormat("[BASEHTTPSERVER] Http request abnormally terminated."); + } } else { -- cgit v1.1