OpenSim
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
UrlModule.cs
Go to the documentation of this file.
1 /*
2  * Copyright (c) Contributors, http://opensimulator.org/
3  * See CONTRIBUTORS.TXT for a full list of copyright holders.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  * * Redistributions of source code must retain the above copyright
8  * notice, this list of conditions and the following disclaimer.
9  * * Redistributions in binary form must reproduce the above copyright
10  * notice, this list of conditions and the following disclaimer in the
11  * documentation and/or other materials provided with the distribution.
12  * * Neither the name of the OpenSimulator Project nor the
13  * names of its contributors may be used to endorse or promote products
14  * derived from this software without specific prior written permission.
15  *
16  * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19  * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26  */
27 
28 using System;
29 using System.Threading;
30 using System.Collections.Generic;
31 using System.Collections;
32 using System.Reflection;
33 using log4net;
34 using Mono.Addins;
35 using Nini.Config;
36 using OpenMetaverse;
37 using OpenSim.Framework;
38 using OpenSim.Framework.Servers;
39 using OpenSim.Framework.Servers.HttpServer;
40 using OpenSim.Region.Framework.Interfaces;
41 using OpenSim.Region.Framework.Scenes;
42 
43 namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
44 {
45  public class UrlData
46  {
47  public UUID hostID;
48  public UUID itemID;
50  public string url;
51  public UUID urlcode;
52  public Dictionary<UUID, RequestData> requests;
53  public bool isSsl;
54  public Scene scene;
55  public bool allowXss;
56  }
57 
58  public class RequestData
59  {
60  public UUID requestID;
61  public Dictionary<string, string> headers;
62  public string body;
63  public int responseCode;
64  public string responseBody;
65  public string responseType = "text/plain";
66  //public ManualResetEvent ev;
67  public bool requestDone;
68  public int startTime;
69  public bool responseSent;
70  public string uri;
71  public bool allowResponseType = false;
72  public UUID hostID;
73  public Scene scene;
74  }
75 
79  [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "UrlModule")]
81  {
82  private static readonly ILog m_log =
83  LogManager.GetLogger(
84  MethodBase.GetCurrentMethod().DeclaringType);
85 
86  private Dictionary<UUID, UrlData> m_RequestMap =
87  new Dictionary<UUID, UrlData>();
88 
89  private Dictionary<string, UrlData> m_UrlMap =
90  new Dictionary<string, UrlData>();
91 
92  private uint m_HttpsPort = 0;
93  private IHttpServer m_HttpServer = null;
94  private IHttpServer m_HttpsServer = null;
95 
96  public string ExternalHostNameForLSL { get; private set; }
97 
101  public const int DefaultTotalUrls = 15000;
102 
106  public int TotalUrls { get; set; }
107 
108  public Type ReplaceableInterface
109  {
110  get { return null; }
111  }
112 
113  public string Name
114  {
115  get { return "UrlModule"; }
116  }
117 
118  public void Initialise(IConfigSource config)
119  {
120  IConfig networkConfig = config.Configs["Network"];
121 
122  if (networkConfig != null)
123  {
124  ExternalHostNameForLSL = config.Configs["Network"].GetString("ExternalHostNameForLSL", null);
125 
126  bool ssl_enabled = config.Configs["Network"].GetBoolean("https_listener", false);
127 
128  if (ssl_enabled)
129  m_HttpsPort = (uint)config.Configs["Network"].GetInt("https_port", (int)m_HttpsPort);
130  }
131 
132  if (ExternalHostNameForLSL == null)
133  ExternalHostNameForLSL = System.Environment.MachineName;
134 
135  IConfig llFunctionsConfig = config.Configs["LL-Functions"];
136 
137  if (llFunctionsConfig != null)
138  TotalUrls = llFunctionsConfig.GetInt("max_external_urls_per_simulator", DefaultTotalUrls);
139  else
140  TotalUrls = DefaultTotalUrls;
141  }
142 
143  public void PostInitialise()
144  {
145  }
146 
147  public void AddRegion(Scene scene)
148  {
149  if (m_HttpServer == null)
150  {
151  // There can only be one
152  //
153  m_HttpServer = MainServer.Instance;
154  //
155  // We can use the https if it is enabled
156  if (m_HttpsPort > 0)
157  {
158  m_HttpsServer = MainServer.GetHttpServer(m_HttpsPort);
159  }
160  }
161 
162  scene.RegisterModuleInterface<IUrlModule>(this);
163 
164  scene.EventManager.OnScriptReset += OnScriptReset;
165  }
166 
167  public void RegionLoaded(Scene scene)
168  {
169  IScriptModule[] scriptModules = scene.RequestModuleInterfaces<IScriptModule>();
170  foreach (IScriptModule scriptModule in scriptModules)
171  {
172  scriptModule.OnScriptRemoved += ScriptRemoved;
173  scriptModule.OnObjectRemoved += ObjectRemoved;
174  }
175  }
176 
177  public void RemoveRegion(Scene scene)
178  {
179  // Drop references to that scene
180  foreach (KeyValuePair<string, UrlData> kvp in m_UrlMap)
181  {
182  if (kvp.Value.scene == scene)
183  kvp.Value.scene = null;
184  }
185  foreach (KeyValuePair<UUID, UrlData> kvp in m_RequestMap)
186  {
187  if (kvp.Value.scene == scene)
188  kvp.Value.scene = null;
189  }
190  }
191 
192  public void Close()
193  {
194  }
195 
196  public UUID RequestURL(IScriptModule engine, SceneObjectPart host, UUID itemID, Hashtable options)
197  {
198  UUID urlcode = UUID.Random();
199 
200  lock (m_UrlMap)
201  {
202  if (m_UrlMap.Count >= TotalUrls)
203  {
204  engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_DENIED", "" });
205  return urlcode;
206  }
207  string url = "http://" + ExternalHostNameForLSL + ":" + m_HttpServer.Port.ToString() + "/lslhttp/" + urlcode.ToString() + "/";
208 
209  UrlData urlData = new UrlData();
210  urlData.hostID = host.UUID;
211  urlData.itemID = itemID;
212  urlData.engine = engine;
213  urlData.url = url;
214  urlData.urlcode = urlcode;
215  urlData.isSsl = false;
216  urlData.requests = new Dictionary<UUID, RequestData>();
217  urlData.scene = host.ParentGroup.Scene;
218  urlData.allowXss = false;
219 
220  if (options != null && options["allowXss"] != null)
221  urlData.allowXss = true;
222 
223  m_UrlMap[url] = urlData;
224 
225  string uri = "/lslhttp/" + urlcode.ToString() + "/";
226 
228  = new PollServiceEventArgs(HttpRequestHandler, uri, HasEvents, GetEvents, NoEvents, urlcode, 25000);
229  args.Type = PollServiceEventArgs.EventType.LslHttp;
230  m_HttpServer.AddPollServiceHTTPHandler(uri, args);
231 
232 // m_log.DebugFormat(
233 // "[URL MODULE]: Set up incoming request url {0} for {1} in {2} {3}",
234 // uri, itemID, host.Name, host.LocalId);
235 
236  engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_GRANTED", url });
237  }
238 
239  return urlcode;
240  }
241 
242  public UUID RequestSecureURL(IScriptModule engine, SceneObjectPart host, UUID itemID, Hashtable options)
243  {
244  UUID urlcode = UUID.Random();
245 
246  if (m_HttpsServer == null)
247  {
248  engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_DENIED", "" });
249  return urlcode;
250  }
251 
252  lock (m_UrlMap)
253  {
254  if (m_UrlMap.Count >= TotalUrls)
255  {
256  engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_DENIED", "" });
257  return urlcode;
258  }
259  string url = "https://" + ExternalHostNameForLSL + ":" + m_HttpsServer.Port.ToString() + "/lslhttps/" + urlcode.ToString() + "/";
260 
261  UrlData urlData = new UrlData();
262  urlData.hostID = host.UUID;
263  urlData.itemID = itemID;
264  urlData.engine = engine;
265  urlData.url = url;
266  urlData.urlcode = urlcode;
267  urlData.isSsl = true;
268  urlData.requests = new Dictionary<UUID, RequestData>();
269  urlData.allowXss = false;
270 
271  if (options != null && options["allowXss"] != null)
272  urlData.allowXss = true;
273 
274  m_UrlMap[url] = urlData;
275 
276  string uri = "/lslhttps/" + urlcode.ToString() + "/";
277 
279  = new PollServiceEventArgs(HttpRequestHandler, uri, HasEvents, GetEvents, NoEvents, urlcode, 25000);
280  args.Type = PollServiceEventArgs.EventType.LslHttp;
281  m_HttpsServer.AddPollServiceHTTPHandler(uri, args);
282 
283 // m_log.DebugFormat(
284 // "[URL MODULE]: Set up incoming secure request url {0} for {1} in {2} {3}",
285 // uri, itemID, host.Name, host.LocalId);
286 
287  engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_GRANTED", url });
288  }
289 
290  return urlcode;
291  }
292 
293  public void ReleaseURL(string url)
294  {
295  lock (m_UrlMap)
296  {
297  UrlData data;
298 
299  if (!m_UrlMap.TryGetValue(url, out data))
300  {
301  return;
302  }
303 
304  lock (m_RequestMap)
305  {
306  foreach (UUID req in data.requests.Keys)
307  m_RequestMap.Remove(req);
308  }
309 
310 // m_log.DebugFormat(
311 // "[URL MODULE]: Releasing url {0} for {1} in {2}",
312 // url, data.itemID, data.hostID);
313 
314  RemoveUrl(data);
315  m_UrlMap.Remove(url);
316  }
317  }
318 
319  public void HttpContentType(UUID request, string type)
320  {
321  lock (m_UrlMap)
322  {
323  if (m_RequestMap.ContainsKey(request))
324  {
325  UrlData urlData = m_RequestMap[request];
326  urlData.requests[request].responseType = type;
327  }
328  else
329  {
330  m_log.Info("[HttpRequestHandler] There is no http-in request with id " + request.ToString());
331  }
332  }
333  }
334 
335  public void HttpResponse(UUID request, int status, string body)
336  {
337  lock (m_RequestMap)
338  {
339  if (m_RequestMap.ContainsKey(request))
340  {
341  UrlData urlData = m_RequestMap[request];
342  if (!urlData.requests[request].responseSent)
343  {
344  string responseBody = body;
345 
346  // If we have no OpenID from built-in browser, disable this
347  if (!urlData.requests[request].allowResponseType)
348  urlData.requests[request].responseType = "text/plain";
349 
350  if (urlData.requests[request].responseType.Equals("text/plain"))
351  {
352  string value;
353  if (urlData.requests[request].headers.TryGetValue("user-agent", out value))
354  {
355  if (value != null && value.IndexOf("MSIE") >= 0)
356  {
357  // wrap the html escaped response if the target client is IE
358  // It ignores "text/plain" if the body is html
359  responseBody = "<html>" + System.Web.HttpUtility.HtmlEncode(body) + "</html>";
360  }
361  }
362  }
363 
364  urlData.requests[request].responseCode = status;
365  urlData.requests[request].responseBody = responseBody;
366  //urlData.requests[request].ev.Set();
367  urlData.requests[request].requestDone = true;
368  urlData.requests[request].responseSent = true;
369  }
370  }
371  else
372  {
373  m_log.Info("[HttpRequestHandler] There is no http-in request with id " + request.ToString());
374  }
375  }
376  }
377 
378  public string GetHttpHeader(UUID requestId, string header)
379  {
380  lock (m_RequestMap)
381  {
382  if (m_RequestMap.ContainsKey(requestId))
383  {
384  UrlData urlData = m_RequestMap[requestId];
385  string value;
386  if (urlData.requests[requestId].headers.TryGetValue(header, out value))
387  return value;
388  }
389  else
390  {
391  m_log.Warn("[HttpRequestHandler] There was no http-in request with id " + requestId);
392  }
393  }
394  return String.Empty;
395  }
396 
397  public int GetFreeUrls()
398  {
399  lock (m_UrlMap)
400  return TotalUrls - m_UrlMap.Count;
401  }
402 
403  public void ScriptRemoved(UUID itemID)
404  {
405 // m_log.DebugFormat("[URL MODULE]: Removing script {0}", itemID);
406 
407  lock (m_UrlMap)
408  {
409  List<string> removeURLs = new List<string>();
410 
411  foreach (KeyValuePair<string, UrlData> url in m_UrlMap)
412  {
413  if (url.Value.itemID == itemID)
414  {
415  RemoveUrl(url.Value);
416  removeURLs.Add(url.Key);
417  lock (m_RequestMap)
418  {
419  foreach (UUID req in url.Value.requests.Keys)
420  m_RequestMap.Remove(req);
421  }
422  }
423  }
424 
425  foreach (string urlname in removeURLs)
426  m_UrlMap.Remove(urlname);
427  }
428  }
429 
430  public void ObjectRemoved(UUID objectID)
431  {
432  lock (m_UrlMap)
433  {
434  List<string> removeURLs = new List<string>();
435 
436  foreach (KeyValuePair<string, UrlData> url in m_UrlMap)
437  {
438  if (url.Value.hostID == objectID)
439  {
440  RemoveUrl(url.Value);
441  removeURLs.Add(url.Key);
442  lock (m_RequestMap)
443  {
444  foreach (UUID req in url.Value.requests.Keys)
445  m_RequestMap.Remove(req);
446  }
447  }
448  }
449 
450  foreach (string urlname in removeURLs)
451  m_UrlMap.Remove(urlname);
452  }
453  }
454 
455 
456  private void RemoveUrl(UrlData data)
457  {
458  if (data.isSsl)
459  m_HttpsServer.RemoveHTTPHandler("", "/lslhttps/"+data.urlcode.ToString()+"/");
460  else
461  m_HttpServer.RemoveHTTPHandler("", "/lslhttp/"+data.urlcode.ToString()+"/");
462  }
463 
464  private Hashtable NoEvents(UUID requestID, UUID sessionID)
465  {
466  Hashtable response = new Hashtable();
467  UrlData url;
468  int startTime = 0;
469  lock (m_RequestMap)
470  {
471  if (!m_RequestMap.ContainsKey(requestID))
472  return response;
473  url = m_RequestMap[requestID];
474  startTime = url.requests[requestID].startTime;
475  }
476 
477  if (System.Environment.TickCount - startTime > 25000)
478  {
479  response["int_response_code"] = 500;
480  response["str_response_string"] = "Script timeout";
481  response["content_type"] = "text/plain";
482  response["keepalive"] = false;
483  response["reusecontext"] = false;
484 
485  //remove from map
486  lock (url.requests)
487  {
488  url.requests.Remove(requestID);
489  }
490  lock (m_RequestMap)
491  {
492  m_RequestMap.Remove(requestID);
493  }
494 
495  return response;
496  }
497 
498 
499  return response;
500  }
501 
502  private bool HasEvents(UUID requestID, UUID sessionID)
503  {
504  UrlData url=null;
505 
506  lock (m_RequestMap)
507  {
508  if (!m_RequestMap.ContainsKey(requestID))
509  {
510  return false;
511  }
512  url = m_RequestMap[requestID];
513  }
514  lock (url.requests)
515  {
516  if (!url.requests.ContainsKey(requestID))
517  {
518  return false;
519  }
520  else
521  {
522  if (System.Environment.TickCount - url.requests[requestID].startTime > 25000)
523  {
524  return true;
525  }
526  if (url.requests[requestID].requestDone)
527  return true;
528  else
529  return false;
530  }
531  }
532  }
533  private Hashtable GetEvents(UUID requestID, UUID sessionID)
534  {
535  UrlData url = null;
536  RequestData requestData = null;
537 
538  lock (m_RequestMap)
539  {
540  if (!m_RequestMap.ContainsKey(requestID))
541  return NoEvents(requestID,sessionID);
542  url = m_RequestMap[requestID];
543  }
544  lock (url.requests)
545  {
546  requestData = url.requests[requestID];
547  }
548 
549  if (!requestData.requestDone)
550  return NoEvents(requestID,sessionID);
551 
552  Hashtable response = new Hashtable();
553 
554  if (System.Environment.TickCount - requestData.startTime > 25000)
555  {
556  response["int_response_code"] = 500;
557  response["str_response_string"] = "Script timeout";
558  response["content_type"] = "text/plain";
559  response["keepalive"] = false;
560  response["reusecontext"] = false;
561  return response;
562  }
563  //put response
564  response["int_response_code"] = requestData.responseCode;
565  response["str_response_string"] = requestData.responseBody;
566  response["content_type"] = requestData.responseType;
567  response["keepalive"] = false;
568  response["reusecontext"] = false;
569 
570  if (url.allowXss)
571  response["access_control_allow_origin"] = "*";
572 
573  //remove from map
574  lock (url.requests)
575  {
576  url.requests.Remove(requestID);
577  }
578  lock (m_RequestMap)
579  {
580  m_RequestMap.Remove(requestID);
581  }
582 
583  return response;
584  }
585 
586  public void HttpRequestHandler(UUID requestID, Hashtable request)
587  {
588  lock (request)
589  {
590  string uri = request["uri"].ToString();
591  bool is_ssl = uri.Contains("lslhttps");
592 
593  try
594  {
595  Hashtable headers = (Hashtable)request["headers"];
596 
597 // string uri_full = "http://" + ExternalHostNameForLSL + ":" + m_HttpServer.Port.ToString() + uri;// "/lslhttp/" + urlcode.ToString() + "/";
598 
599  int pos1 = uri.IndexOf("/");// /lslhttp
600  int pos2 = uri.IndexOf("/", pos1 + 1);// /lslhttp/
601  int pos3 = uri.IndexOf("/", pos2 + 1); // /lslhttp/urlcode
602 
603  string uri_tmp = uri.Substring(0, pos3 + 1);
604  //HTTP server code doesn't provide us with QueryStrings
605  string pathInfo;
606  string queryString;
607  queryString = "";
608 
609  pathInfo = uri.Substring(pos3);
610 
611  UrlData url = null;
612  string urlkey;
613  if (!is_ssl)
614  urlkey = "http://" + ExternalHostNameForLSL + ":" + m_HttpServer.Port.ToString() + uri_tmp;
615  //m_UrlMap[];
616  else
617  urlkey = "https://" + ExternalHostNameForLSL + ":" + m_HttpsServer.Port.ToString() + uri_tmp;
618 
619  if (m_UrlMap.ContainsKey(urlkey))
620  {
621  url = m_UrlMap[urlkey];
622  }
623  else
624  {
625  //m_log.Warn("[HttpRequestHandler]: http-in request failed; no such url: "+urlkey.ToString());
626  return;
627  }
628 
629  //for llGetHttpHeader support we need to store original URI here
630  //to make x-path-info / x-query-string / x-script-url / x-remote-ip headers
631  //as per http://wiki.secondlife.com/wiki/LlGetHTTPHeader
632 
633  RequestData requestData = new RequestData();
634  requestData.requestID = requestID;
635  requestData.requestDone = false;
636  requestData.startTime = System.Environment.TickCount;
637  requestData.uri = uri;
638  requestData.hostID = url.hostID;
639  requestData.scene = url.scene;
640  if (requestData.headers == null)
641  requestData.headers = new Dictionary<string, string>();
642 
643  foreach (DictionaryEntry header in headers)
644  {
645  string key = (string)header.Key;
646  string value = (string)header.Value;
647  requestData.headers.Add(key, value);
648  if (key == "cookie")
649  {
650  string[] parts = value.Split(new char[] {'='});
651  if (parts[0] == "agni_sl_session_id" && parts.Length > 1)
652  {
653  string cookie = Uri.UnescapeDataString(parts[1]);
654  string[] crumbs = cookie.Split(new char[] {':'});
655  UUID owner;
656  if (crumbs.Length == 2 && UUID.TryParse(crumbs[0], out owner))
657  {
658  if (crumbs[1].Length == 32)
659  {
660  Scene scene = requestData.scene;
661  if (scene != null)
662  {
663  SceneObjectPart host = scene.GetSceneObjectPart(requestData.hostID);
664  if (host != null)
665  {
666  if (host.OwnerID == owner)
667  requestData.allowResponseType = true;
668  }
669  }
670  }
671  }
672  }
673  }
674  }
675  foreach (DictionaryEntry de in request)
676  {
677  if (de.Key.ToString() == "querystringkeys")
678  {
679  System.String[] keys = (System.String[])de.Value;
680  foreach (String key in keys)
681  {
682  if (request.ContainsKey(key))
683  {
684  string val = (String)request[key];
685  if (key != "")
686  {
687  queryString = queryString + key + "=" + val + "&";
688  }
689  else
690  {
691  queryString = queryString + val + "&";
692  }
693  }
694  }
695  if (queryString.Length > 1)
696  queryString = queryString.Substring(0, queryString.Length - 1);
697 
698  }
699 
700  }
701 
702  //if this machine is behind DNAT/port forwarding, currently this is being
703  //set to address of port forwarding router
704  requestData.headers["x-remote-ip"] = requestData.headers["remote_addr"];
705  requestData.headers["x-path-info"] = pathInfo;
706  requestData.headers["x-query-string"] = queryString;
707  requestData.headers["x-script-url"] = url.url;
708 
709  //requestData.ev = new ManualResetEvent(false);
710  lock (url.requests)
711  {
712  url.requests.Add(requestID, requestData);
713  }
714  lock (m_RequestMap)
715  {
716  //add to request map
717  m_RequestMap.Add(requestID, url);
718  }
719 
720  url.engine.PostScriptEvent(url.itemID, "http_request", new Object[] { requestID.ToString(), request["http-method"].ToString(), request["body"].ToString() });
721 
722  //send initial response?
723 // Hashtable response = new Hashtable();
724 
725  return;
726 
727  }
728  catch (Exception we)
729  {
730  //Hashtable response = new Hashtable();
731  m_log.Warn("[HttpRequestHandler]: http-in request failed");
732  m_log.Warn(we.Message);
733  m_log.Warn(we.StackTrace);
734  }
735  }
736  }
737 
738  private void OnScriptReset(uint localID, UUID itemID)
739  {
740  ScriptRemoved(itemID);
741  }
742  }
743 }
void HttpRequestHandler(UUID requestID, Hashtable request)
Definition: UrlModule.cs:586
UUID RequestSecureURL(IScriptModule engine, SceneObjectPart host, UUID itemID, Hashtable options)
Definition: UrlModule.cs:242
This module provides external URLs for in-world scripts.
Definition: UrlModule.cs:80
void PostInitialise()
This is called exactly once after all the shared region-modules have been instanciated and IRegionMod...
Definition: UrlModule.cs:143
UUID RequestURL(IScriptModule engine, SceneObjectPart host, UUID itemID, Hashtable options)
Definition: UrlModule.cs:196
void HttpContentType(UUID request, string type)
Definition: UrlModule.cs:319
Interface to OpenSimulator's built in HTTP server. Use this to register handlers (http, llsd, xmlrpc, etc.) for given URLs.
Definition: IHttpServer.cs:36
OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLString key
Definition: ICM_Api.cs:31
delegate void ObjectRemoved(UUID prim)
void Initialise(IConfigSource config)
This is called to initialize the region module. For shared modules, this is called exactly once...
Definition: UrlModule.cs:118
void HttpResponse(UUID request, int status, string body)
Definition: UrlModule.cs:335
void RemoveRegion(Scene scene)
This is called whenever a Scene is removed. For shared modules, this can happen several times...
Definition: UrlModule.cs:177
Interactive OpenSim region server
Definition: OpenSim.cs:55
string GetHttpHeader(UUID requestId, string header)
Definition: UrlModule.cs:378
delegate void ScriptRemoved(UUID script)
void Close()
This is the inverse to Initialise. After a Close(), this instance won't be usable anymore...
Definition: UrlModule.cs:192
void RegionLoaded(Scene scene)
This will be called once for every scene loaded. In a shared module this will be multiple times in on...
Definition: UrlModule.cs:167
void AddRegion(Scene scene)
This is called whenever a Scene is added. For shared modules, this can happen several times...
Definition: UrlModule.cs:147
Dictionary< UUID, RequestData > requests
Definition: UrlModule.cs:52