aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r--OpenSim/Framework/AgentCircuitData.cs30
-rw-r--r--OpenSim/Framework/Capabilities/CapsHandlers.cs2
-rw-r--r--OpenSim/Framework/Serialization/External/UserInventoryItemSerializer.cs2
-rw-r--r--OpenSim/Framework/Servers/BaseOpenSimServer.cs27
-rw-r--r--OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs32
-rw-r--r--OpenSim/Framework/Util.cs10
6 files changed, 88 insertions, 15 deletions
diff --git a/OpenSim/Framework/AgentCircuitData.cs b/OpenSim/Framework/AgentCircuitData.cs
index 1600bdc..3dbc215 100644
--- a/OpenSim/Framework/AgentCircuitData.cs
+++ b/OpenSim/Framework/AgentCircuitData.cs
@@ -220,6 +220,8 @@ namespace OpenSim.Framework
220 args["packed_appearance"] = appmap; 220 args["packed_appearance"] = appmap;
221 } 221 }
222 222
223 // Old, bad way. Keeping it fow now for backwards compatibility
224 // OBSOLETE -- soon to be deleted
223 if (ServiceURLs != null && ServiceURLs.Count > 0) 225 if (ServiceURLs != null && ServiceURLs.Count > 0)
224 { 226 {
225 OSDArray urls = new OSDArray(ServiceURLs.Count * 2); 227 OSDArray urls = new OSDArray(ServiceURLs.Count * 2);
@@ -232,6 +234,19 @@ namespace OpenSim.Framework
232 args["service_urls"] = urls; 234 args["service_urls"] = urls;
233 } 235 }
234 236
237 // again, this time the right way
238 if (ServiceURLs != null && ServiceURLs.Count > 0)
239 {
240 OSDMap urls = new OSDMap();
241 foreach (KeyValuePair<string, object> kvp in ServiceURLs)
242 {
243 //System.Console.WriteLine("XXX " + kvp.Key + "=" + kvp.Value);
244 urls[kvp.Key] = OSD.FromString((kvp.Value == null) ? string.Empty : kvp.Value.ToString());
245 }
246 args["serviceurls"] = urls;
247 }
248
249
235 return args; 250 return args;
236 } 251 }
237 252
@@ -327,7 +342,20 @@ namespace OpenSim.Framework
327 } 342 }
328 343
329 ServiceURLs = new Dictionary<string, object>(); 344 ServiceURLs = new Dictionary<string, object>();
330 if (args.ContainsKey("service_urls") && args["service_urls"] != null && (args["service_urls"]).Type == OSDType.Array) 345 // Try parse the new way, OSDMap
346 if (args.ContainsKey("serviceurls") && args["serviceurls"] != null && (args["serviceurls"]).Type == OSDType.Map)
347 {
348 OSDMap urls = (OSDMap)(args["serviceurls"]);
349 foreach (KeyValuePair<String, OSD> kvp in urls)
350 {
351 ServiceURLs[kvp.Key] = kvp.Value.AsString();
352 //System.Console.WriteLine("XXX " + kvp.Key + "=" + ServiceURLs[kvp.Key]);
353
354 }
355 }
356 // else try the old way, OSDArray
357 // OBSOLETE -- soon to be deleted
358 else if (args.ContainsKey("service_urls") && args["service_urls"] != null && (args["service_urls"]).Type == OSDType.Array)
331 { 359 {
332 OSDArray urls = (OSDArray)(args["service_urls"]); 360 OSDArray urls = (OSDArray)(args["service_urls"]);
333 for (int i = 0; i < urls.Count / 2; i++) 361 for (int i = 0; i < urls.Count / 2; i++)
diff --git a/OpenSim/Framework/Capabilities/CapsHandlers.cs b/OpenSim/Framework/Capabilities/CapsHandlers.cs
index 864e6dd..e1c800e 100644
--- a/OpenSim/Framework/Capabilities/CapsHandlers.cs
+++ b/OpenSim/Framework/Capabilities/CapsHandlers.cs
@@ -88,8 +88,8 @@ namespace OpenSim.Framework.Capabilities
88 /// handler to be removed</param> 88 /// handler to be removed</param>
89 public void Remove(string capsName) 89 public void Remove(string capsName)
90 { 90 {
91 // This line must be here, or caps will break!
92 m_httpListener.RemoveStreamHandler("POST", m_capsHandlers[capsName].Path); 91 m_httpListener.RemoveStreamHandler("POST", m_capsHandlers[capsName].Path);
92 m_httpListener.RemoveStreamHandler("GET", m_capsHandlers[capsName].Path);
93 m_capsHandlers.Remove(capsName); 93 m_capsHandlers.Remove(capsName);
94 } 94 }
95 95
diff --git a/OpenSim/Framework/Serialization/External/UserInventoryItemSerializer.cs b/OpenSim/Framework/Serialization/External/UserInventoryItemSerializer.cs
index d5e84c7..f138437 100644
--- a/OpenSim/Framework/Serialization/External/UserInventoryItemSerializer.cs
+++ b/OpenSim/Framework/Serialization/External/UserInventoryItemSerializer.cs
@@ -303,7 +303,7 @@ namespace OpenSim.Framework.Serialization.External
303 writer.WriteStartElement("GroupOwned"); 303 writer.WriteStartElement("GroupOwned");
304 writer.WriteString(inventoryItem.GroupOwned.ToString()); 304 writer.WriteString(inventoryItem.GroupOwned.ToString());
305 writer.WriteEndElement(); 305 writer.WriteEndElement();
306 if (inventoryItem.CreatorData != null && inventoryItem.CreatorData != string.Empty) 306 if (options.ContainsKey("creators") && inventoryItem.CreatorData != null && inventoryItem.CreatorData != string.Empty)
307 writer.WriteElementString("CreatorData", inventoryItem.CreatorData); 307 writer.WriteElementString("CreatorData", inventoryItem.CreatorData);
308 else if (options.ContainsKey("profile")) 308 else if (options.ContainsKey("profile"))
309 { 309 {
diff --git a/OpenSim/Framework/Servers/BaseOpenSimServer.cs b/OpenSim/Framework/Servers/BaseOpenSimServer.cs
index b28ad69..21e1e09 100644
--- a/OpenSim/Framework/Servers/BaseOpenSimServer.cs
+++ b/OpenSim/Framework/Servers/BaseOpenSimServer.cs
@@ -319,18 +319,21 @@ namespace OpenSim.Framework.Servers
319 return; 319 return;
320 } 320 }
321 321
322 string rawLevel = cmd[3]; 322 if (cmd.Length > 3)
323 323 {
324 ILoggerRepository repository = LogManager.GetRepository(); 324 string rawLevel = cmd[3];
325 Level consoleLevel = repository.LevelMap[rawLevel]; 325
326 326 ILoggerRepository repository = LogManager.GetRepository();
327 if (consoleLevel != null) 327 Level consoleLevel = repository.LevelMap[rawLevel];
328 m_consoleAppender.Threshold = consoleLevel; 328
329 else 329 if (consoleLevel != null)
330 Notice( 330 m_consoleAppender.Threshold = consoleLevel;
331 String.Format( 331 else
332 "{0} is not a valid logging level. Valid logging levels are ALL, DEBUG, INFO, WARN, ERROR, FATAL, OFF", 332 Notice(
333 rawLevel)); 333 String.Format(
334 "{0} is not a valid logging level. Valid logging levels are ALL, DEBUG, INFO, WARN, ERROR, FATAL, OFF",
335 rawLevel));
336 }
334 337
335 Notice(String.Format("Console log level is {0}", m_consoleAppender.Threshold)); 338 Notice(String.Format("Console log level is {0}", m_consoleAppender.Threshold));
336 } 339 }
diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
index d4ee7ba..4c35132 100644
--- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
+++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
@@ -143,6 +143,11 @@ namespace OpenSim.Framework.Servers.HttpServer
143 } 143 }
144 } 144 }
145 145
146 public List<string> GetStreamHandlerKeys()
147 {
148 return new List<string>(m_streamHandlers.Keys);
149 }
150
146 private static string GetHandlerKey(string httpMethod, string path) 151 private static string GetHandlerKey(string httpMethod, string path)
147 { 152 {
148 return httpMethod + ":" + path; 153 return httpMethod + ":" + path;
@@ -179,6 +184,11 @@ namespace OpenSim.Framework.Servers.HttpServer
179 } 184 }
180 } 185 }
181 186
187 public List<string> GetXmlRpcHandlerKeys()
188 {
189 return new List<string>(m_rpcHandlers.Keys);
190 }
191
182 public bool AddHTTPHandler(string methodName, GenericHTTPMethod handler) 192 public bool AddHTTPHandler(string methodName, GenericHTTPMethod handler)
183 { 193 {
184 //m_log.DebugFormat("[BASE HTTP SERVER]: Registering {0}", methodName); 194 //m_log.DebugFormat("[BASE HTTP SERVER]: Registering {0}", methodName);
@@ -196,6 +206,12 @@ namespace OpenSim.Framework.Servers.HttpServer
196 return false; 206 return false;
197 } 207 }
198 208
209 public List<string> GetHTTPHandlerKeys()
210 {
211 return new List<string>(m_HTTPHandlers.Keys);
212 }
213
214
199 public bool AddPollServiceHTTPHandler(string methodName, GenericHTTPMethod handler, PollServiceEventArgs args) 215 public bool AddPollServiceHTTPHandler(string methodName, GenericHTTPMethod handler, PollServiceEventArgs args)
200 { 216 {
201 bool pollHandlerResult = false; 217 bool pollHandlerResult = false;
@@ -214,6 +230,12 @@ namespace OpenSim.Framework.Servers.HttpServer
214 return false; 230 return false;
215 } 231 }
216 232
233 public List<string> GetPollServiceHandlerKeys()
234 {
235 return new List<string>(m_pollHandlers.Keys);
236 }
237
238
217 // Note that the agent string is provided simply to differentiate 239 // Note that the agent string is provided simply to differentiate
218 // the handlers - it is NOT required to be an actual agent header 240 // the handlers - it is NOT required to be an actual agent header
219 // value. 241 // value.
@@ -232,6 +254,11 @@ namespace OpenSim.Framework.Servers.HttpServer
232 return false; 254 return false;
233 } 255 }
234 256
257 public List<string> GetAgentHandlerKeys()
258 {
259 return new List<string>(m_agentHandlers.Keys);
260 }
261
235 public bool AddLLSDHandler(string path, LLSDMethod handler) 262 public bool AddLLSDHandler(string path, LLSDMethod handler)
236 { 263 {
237 lock (m_llsdHandlers) 264 lock (m_llsdHandlers)
@@ -245,6 +272,11 @@ namespace OpenSim.Framework.Servers.HttpServer
245 return false; 272 return false;
246 } 273 }
247 274
275 public List<string> GetLLSDHandlerKeys()
276 {
277 return new List<string>(m_llsdHandlers.Keys);
278 }
279
248 public bool SetDefaultLLSDHandler(DefaultLLSDMethod handler) 280 public bool SetDefaultLLSDHandler(DefaultLLSDMethod handler)
249 { 281 {
250 m_defaultLlsdHandler = handler; 282 m_defaultLlsdHandler = handler;
diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs
index d1d8736..533e53a 100644
--- a/OpenSim/Framework/Util.cs
+++ b/OpenSim/Framework/Util.cs
@@ -1334,6 +1334,11 @@ namespace OpenSim.Framework
1334 return (ipaddr1 != null) ? "http://" + ipaddr1.ToString() + ":" + port1 : uri; 1334 return (ipaddr1 != null) ? "http://" + ipaddr1.ToString() + ":" + port1 : uri;
1335 } 1335 }
1336 1336
1337 public static byte[] StringToBytes256(string str, params object[] args)
1338 {
1339 return StringToBytes256(string.Format(str, args));
1340 }
1341
1337 public static byte[] StringToBytes256(string str) 1342 public static byte[] StringToBytes256(string str)
1338 { 1343 {
1339 if (String.IsNullOrEmpty(str)) { return Utils.EmptyBytes; } 1344 if (String.IsNullOrEmpty(str)) { return Utils.EmptyBytes; }
@@ -1352,6 +1357,11 @@ namespace OpenSim.Framework
1352 return data; 1357 return data;
1353 } 1358 }
1354 1359
1360 public static byte[] StringToBytes1024(string str, params object[] args)
1361 {
1362 return StringToBytes1024(string.Format(str, args));
1363 }
1364
1355 public static byte[] StringToBytes1024(string str) 1365 public static byte[] StringToBytes1024(string str)
1356 { 1366 {
1357 if (String.IsNullOrEmpty(str)) { return Utils.EmptyBytes; } 1367 if (String.IsNullOrEmpty(str)) { return Utils.EmptyBytes; }