From fa844d7e6ee88552d9095dc7a6330eeba767b3e9 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Mon, 27 Apr 2020 16:40:54 +0100 Subject: [PATCH] add soem try/catch (and yes..yes right on last commit should hed been write... --- .../Servers/HttpServer/SimpleOSDMapHandler.cs | 16 ++++++++++++---- .../Servers/HttpServer/SimpleStreamHandler.cs | 17 +++++++++++++---- 2 files changed, 25 insertions(+), 8 deletions(-) diff --git a/OpenSim/Framework/Servers/HttpServer/SimpleOSDMapHandler.cs b/OpenSim/Framework/Servers/HttpServer/SimpleOSDMapHandler.cs index 48b53f22c1..8b3838f4ae 100644 --- a/OpenSim/Framework/Servers/HttpServer/SimpleOSDMapHandler.cs +++ b/OpenSim/Framework/Servers/HttpServer/SimpleOSDMapHandler.cs @@ -117,10 +117,18 @@ namespace OpenSim.Framework.Servers.HttpServer return; } } - if(m_processRequest != null) - m_processRequest(httpRequest, httpResponse, args); - else - ProcessRequest(httpRequest, httpResponse, args); + try + { + if(m_processRequest != null) + m_processRequest(httpRequest, httpResponse, args); + else + ProcessRequest(httpRequest, httpResponse, args); + } + catch + { + httpResponse.StatusCode = (int)HttpStatusCode.InternalServerError; + } + RequestsHandled++; } diff --git a/OpenSim/Framework/Servers/HttpServer/SimpleStreamHandler.cs b/OpenSim/Framework/Servers/HttpServer/SimpleStreamHandler.cs index 3b411ff655..6badb7b424 100644 --- a/OpenSim/Framework/Servers/HttpServer/SimpleStreamHandler.cs +++ b/OpenSim/Framework/Servers/HttpServer/SimpleStreamHandler.cs @@ -88,10 +88,19 @@ namespace OpenSim.Framework.Servers.HttpServer return; } } - if(m_processRequest != null) - m_processRequest(httpRequest, httpResponse); - else - ProcessRequest(httpRequest, httpResponse); + + try + { + if (m_processRequest != null) + m_processRequest(httpRequest, httpResponse); + else + ProcessRequest(httpRequest, httpResponse); + } + catch + { + httpResponse.StatusCode = (int)HttpStatusCode.InternalServerError; + } + RequestsHandled++; }