aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Servers/BaseHttpServer.cs
diff options
context:
space:
mode:
authorTeravus Ovares2008-10-10 12:59:16 +0000
committerTeravus Ovares2008-10-10 12:59:16 +0000
commitd19400db4479015fe334d81801025e13deec26a8 (patch)
tree908486899abb1d0265bc8c12ebc4583103c0f0d9 /OpenSim/Framework/Servers/BaseHttpServer.cs
parentSome more decrufting (diff)
downloadopensim-SC-d19400db4479015fe334d81801025e13deec26a8.zip
opensim-SC-d19400db4479015fe334d81801025e13deec26a8.tar.gz
opensim-SC-d19400db4479015fe334d81801025e13deec26a8.tar.bz2
opensim-SC-d19400db4479015fe334d81801025e13deec26a8.tar.xz
* Just some OGP maintenance. Standards adherence type stuff.
Diffstat (limited to 'OpenSim/Framework/Servers/BaseHttpServer.cs')
-rw-r--r--OpenSim/Framework/Servers/BaseHttpServer.cs35
1 files changed, 34 insertions, 1 deletions
diff --git a/OpenSim/Framework/Servers/BaseHttpServer.cs b/OpenSim/Framework/Servers/BaseHttpServer.cs
index 558b383..644deb3 100644
--- a/OpenSim/Framework/Servers/BaseHttpServer.cs
+++ b/OpenSim/Framework/Servers/BaseHttpServer.cs
@@ -587,7 +587,40 @@ namespace OpenSim.Framework.Servers
587 } 587 }
588 else 588 else
589 { 589 {
590 //HandleLLSDRequests(request, response);
591 response.ContentType = "text/plain";
592 response.StatusCode = 404;
593 response.StatusDescription = "Not Found";
594 response.ProtocolVersion = "HTTP/1.0";
595 byte[] buf = Encoding.UTF8.GetBytes("Not found");
596 response.KeepAlive = false;
597
590 m_log.ErrorFormat("[BASE HTTP SERVER] Handler not found for http request {0}", request.RawUrl); 598 m_log.ErrorFormat("[BASE HTTP SERVER] Handler not found for http request {0}", request.RawUrl);
599
600 response.SendChunked = false;
601 response.ContentLength64 = buf.Length;
602 response.ContentEncoding = Encoding.UTF8;
603 try
604 {
605 response.OutputStream.Write(buf, 0, buf.Length);
606 }
607 catch (Exception ex)
608 {
609 m_log.Warn("[HTTPD]: Error - " + ex.Message);
610 }
611 finally
612 {
613 try
614 {
615 response.Send();
616 }
617 catch (SocketException e)
618 {
619 // This has to be here to prevent a Linux/Mono crash
620 m_log.WarnFormat("[BASE HTTP SERVER] XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux.", e);
621 }
622 }
623 return;
591 responseString = "Error"; 624 responseString = "Error";
592 } 625 }
593 } 626 }
@@ -1207,7 +1240,7 @@ namespace OpenSim.Framework.Servers
1207 public void SendHTML404(OSHttpResponse response, string host) 1240 public void SendHTML404(OSHttpResponse response, string host)
1208 { 1241 {
1209 // I know this statuscode is dumb, but the client doesn't respond to 404s and 500s 1242 // I know this statuscode is dumb, but the client doesn't respond to 404s and 500s
1210 response.StatusCode = (int)OSHttpStatusCode.SuccessOk; 1243 response.StatusCode = 404;
1211 response.AddHeader("Content-type", "text/html"); 1244 response.AddHeader("Content-type", "text/html");
1212 1245
1213 string responseString = GetHTTP404(host); 1246 string responseString = GetHTTP404(host);