aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorTeravus Ovares2008-10-10 12:59:16 +0000
committerTeravus Ovares2008-10-10 12:59:16 +0000
commitd19400db4479015fe334d81801025e13deec26a8 (patch)
tree908486899abb1d0265bc8c12ebc4583103c0f0d9
parentSome more decrufting (diff)
downloadopensim-SC_OLD-d19400db4479015fe334d81801025e13deec26a8.zip
opensim-SC_OLD-d19400db4479015fe334d81801025e13deec26a8.tar.gz
opensim-SC_OLD-d19400db4479015fe334d81801025e13deec26a8.tar.bz2
opensim-SC_OLD-d19400db4479015fe334d81801025e13deec26a8.tar.xz
* Just some OGP maintenance. Standards adherence type stuff.
-rw-r--r--OpenSim/Framework/Servers/BaseHttpServer.cs35
-rw-r--r--OpenSim/Region/Environment/Modules/InterGrid/OpenGridProtocolModule.cs19
2 files changed, 46 insertions, 8 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);
diff --git a/OpenSim/Region/Environment/Modules/InterGrid/OpenGridProtocolModule.cs b/OpenSim/Region/Environment/Modules/InterGrid/OpenGridProtocolModule.cs
index cb525cc..85e60d7 100644
--- a/OpenSim/Region/Environment/Modules/InterGrid/OpenGridProtocolModule.cs
+++ b/OpenSim/Region/Environment/Modules/InterGrid/OpenGridProtocolModule.cs
@@ -858,11 +858,12 @@ namespace OpenSim.Region.Environment.Modules.InterGrid
858 int rrY = rezResponseMap["region_y"].AsInteger(); 858 int rrY = rezResponseMap["region_y"].AsInteger();
859 m_log.ErrorFormat("X:{0}, Y:{1}", rrX, rrY); 859 m_log.ErrorFormat("X:{0}, Y:{1}", rrX, rrY);
860 UUID rrRID = rezResponseMap["region_id"].AsUUID(); 860 UUID rrRID = rezResponseMap["region_id"].AsUUID();
861 861 LLSDArray RezResponsePositionArray = null;
862 string rrAccess = rezResponseMap["sim_access"].AsString(); 862 string rrAccess = rezResponseMap["sim_access"].AsString();
863 863 if (rezResponseMap.ContainsKey("position"))
864 LLSDArray RezResponsePositionArray = (LLSDArray)rezResponseMap["position"]; 864 {
865 865 RezResponsePositionArray = (LLSDArray)rezResponseMap["position"];
866 }
866 // DEPRECIATED 867 // DEPRECIATED
867 responseMap["seed_capability"] = LLSD.FromString(rezRespSeedCap); 868 responseMap["seed_capability"] = LLSD.FromString(rezRespSeedCap);
868 869
@@ -878,13 +879,17 @@ namespace OpenSim.Region.Environment.Modules.InterGrid
878 responseMap["region_y"] = LLSD.FromInteger(rrY ); 879 responseMap["region_y"] = LLSD.FromInteger(rrY );
879 responseMap["region_id"] = LLSD.FromUUID(rrRID); 880 responseMap["region_id"] = LLSD.FromUUID(rrRID);
880 responseMap["sim_access"] = LLSD.FromString(rrAccess); 881 responseMap["sim_access"] = LLSD.FromString(rrAccess);
881 responseMap["position"] = RezResponsePositionArray; 882
883 if (RezResponsePositionArray != null)
884 {
885 responseMap["position"] = RezResponsePositionArray;
886 }
882 responseMap["look_at"] = lookArray; 887 responseMap["look_at"] = lookArray;
883 responseMap["connect"] = LLSD.FromBoolean(true); 888 responseMap["connect"] = LLSD.FromBoolean(true);
884 889
885 ShutdownConnection(LocalID,this); 890 ShutdownConnection(LocalID,this);
886 891 // PLEASE STOP CHANGING THIS TO an M_LOG, M_LOG DOESN'T WORK ON MULTILINE .TOSTRINGS
887 m_log.Warn("RESPONSEDEREZ: " + responseMap.ToString()); 892 System.Console.WriteLine("RESPONSEDEREZ: " + responseMap.ToString());
888 return responseMap; 893 return responseMap;
889 } 894 }
890 else 895 else