From bf7e7b2c57d9b1d7d00f76bbae41093eaf267921 Mon Sep 17 00:00:00 2001 From: Charles Krinke Date: Wed, 16 Apr 2008 03:55:21 +0000 Subject: Thank you very much, Kmeisthax for: This patch makes the "Show in Search" checkbox on the viewer work. Additionally, I also discovered that show-in-search objects use the JointWheel flag, so this patch currently uses that flag. LibSL needs to add a flag to enum LLObject.ObjectFlags, "IncludeSearch = 32768" so we aren't using a legacy flag. Additionally this patch also contains a small fix to BaseHTTPServer that lets the response content-type to be something other than text/html. For some reason this didn't get submitted with the DataSnapshot merge. --- OpenSim/Framework/IClientAPI.cs | 4 +++- OpenSim/Framework/Servers/BaseHttpServer.cs | 15 +++++++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs index cd59fa0..c0f7fce 100644 --- a/OpenSim/Framework/IClientAPI.cs +++ b/OpenSim/Framework/IClientAPI.cs @@ -435,6 +435,8 @@ namespace OpenSim.Framework public delegate void EconomyDataRequest(LLUUID agentID); + public delegate void ObjectIncludeInSearch(IClientAPI remoteClient, bool IncludeInSearch, uint localID); + public interface IClientAPI { event ImprovedInstantMessage OnInstantMessage; @@ -549,7 +551,7 @@ namespace OpenSim.Framework event UpdateAvatarProperties OnUpdateAvatarProperties; event ParcelBuy OnParcelBuy; - + event ObjectIncludeInSearch OnObjectIncludeInSearch; LLVector3 StartPos { get; set; } diff --git a/OpenSim/Framework/Servers/BaseHttpServer.cs b/OpenSim/Framework/Servers/BaseHttpServer.cs index 0baddb8..de15923 100644 --- a/OpenSim/Framework/Servers/BaseHttpServer.cs +++ b/OpenSim/Framework/Servers/BaseHttpServer.cs @@ -440,6 +440,7 @@ namespace OpenSim.Framework.Servers string[] querystringkeys = request.QueryString.AllKeys; string[] rHeaders = request.Headers.AllKeys; + foreach (string queryname in querystringkeys) { keysvals.Add(queryname, request.QueryString[queryname]); @@ -487,7 +488,16 @@ namespace OpenSim.Framework.Servers { int responsecode = (int)responsedata["int_response_code"]; string responseString = (string)responsedata["str_response_string"]; - + string contentType = (string)responsedata["content_type"]; + + //Even though only one other part of the entire code uses HTTPHandlers, we shouldn't expect this + //and should check for NullReferenceExceptions + + if (contentType == null || contentType == "") + { + contentType = "text/html"; + } + // We're forgoing the usual error status codes here because the client // ignores anything but 200 and 301 @@ -498,7 +508,8 @@ namespace OpenSim.Framework.Servers response.RedirectLocation = (string)responsedata["str_redirect_location"]; response.StatusCode = responsecode; } - response.AddHeader("Content-type", "text/html"); + + response.AddHeader("Content-type", contentType); byte[] buffer = Encoding.UTF8.GetBytes(responseString); -- cgit v1.1