diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/Scripting/LSLHttp')
-rw-r--r-- | OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs b/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs index c118f33..3f332fa 100644 --- a/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs | |||
@@ -105,7 +105,7 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp | |||
105 | /// </summary> | 105 | /// </summary> |
106 | public int TotalUrls { get; set; } | 106 | public int TotalUrls { get; set; } |
107 | 107 | ||
108 | public Type ReplaceableInterface | 108 | public Type ReplaceableInterface |
109 | { | 109 | { |
110 | get { return null; } | 110 | get { return null; } |
111 | } | 111 | } |
@@ -221,10 +221,10 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp | |||
221 | urlData.allowXss = true; | 221 | urlData.allowXss = true; |
222 | 222 | ||
223 | m_UrlMap[url] = urlData; | 223 | m_UrlMap[url] = urlData; |
224 | 224 | ||
225 | string uri = "/lslhttp/" + urlcode.ToString() + "/"; | 225 | string uri = "/lslhttp/" + urlcode.ToString() + "/"; |
226 | 226 | ||
227 | PollServiceEventArgs args | 227 | PollServiceEventArgs args |
228 | = new PollServiceEventArgs(HttpRequestHandler, uri, HasEvents, GetEvents, NoEvents, Drop, urlcode, 25000); | 228 | = new PollServiceEventArgs(HttpRequestHandler, uri, HasEvents, GetEvents, NoEvents, Drop, urlcode, 25000); |
229 | args.Type = PollServiceEventArgs.EventType.LslHttp; | 229 | args.Type = PollServiceEventArgs.EventType.LslHttp; |
230 | m_HttpServer.AddPollServiceHTTPHandler(uri, args); | 230 | m_HttpServer.AddPollServiceHTTPHandler(uri, args); |
@@ -270,12 +270,12 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp | |||
270 | 270 | ||
271 | if (options != null && options["allowXss"] != null) | 271 | if (options != null && options["allowXss"] != null) |
272 | urlData.allowXss = true; | 272 | urlData.allowXss = true; |
273 | 273 | ||
274 | m_UrlMap[url] = urlData; | 274 | m_UrlMap[url] = urlData; |
275 | 275 | ||
276 | string uri = "/lslhttps/" + urlcode.ToString() + "/"; | 276 | string uri = "/lslhttps/" + urlcode.ToString() + "/"; |
277 | 277 | ||
278 | PollServiceEventArgs args | 278 | PollServiceEventArgs args |
279 | = new PollServiceEventArgs(HttpRequestHandler, uri, HasEvents, GetEvents, NoEvents, Drop, urlcode, 25000); | 279 | = new PollServiceEventArgs(HttpRequestHandler, uri, HasEvents, GetEvents, NoEvents, Drop, urlcode, 25000); |
280 | args.Type = PollServiceEventArgs.EventType.LslHttp; | 280 | args.Type = PollServiceEventArgs.EventType.LslHttp; |
281 | m_HttpsServer.AddPollServiceHTTPHandler(uri, args); | 281 | m_HttpsServer.AddPollServiceHTTPHandler(uri, args); |
@@ -306,7 +306,7 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp | |||
306 | foreach (UUID req in data.requests.Keys) | 306 | foreach (UUID req in data.requests.Keys) |
307 | m_RequestMap.Remove(req); | 307 | m_RequestMap.Remove(req); |
308 | } | 308 | } |
309 | 309 | ||
310 | // m_log.DebugFormat( | 310 | // m_log.DebugFormat( |
311 | // "[URL MODULE]: Releasing url {0} for {1} in {2}", | 311 | // "[URL MODULE]: Releasing url {0} for {1} in {2}", |
312 | // url, data.itemID, data.hostID); | 312 | // url, data.itemID, data.hostID); |
@@ -315,7 +315,7 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp | |||
315 | m_UrlMap.Remove(url); | 315 | m_UrlMap.Remove(url); |
316 | } | 316 | } |
317 | } | 317 | } |
318 | 318 | ||
319 | public void HttpContentType(UUID request, string type) | 319 | public void HttpContentType(UUID request, string type) |
320 | { | 320 | { |
321 | lock (m_UrlMap) | 321 | lock (m_UrlMap) |
@@ -331,7 +331,7 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp | |||
331 | } | 331 | } |
332 | } | 332 | } |
333 | } | 333 | } |
334 | 334 | ||
335 | public void HttpResponse(UUID request, int status, string body) | 335 | public void HttpResponse(UUID request, int status, string body) |
336 | { | 336 | { |
337 | lock (m_RequestMap) | 337 | lock (m_RequestMap) |
@@ -403,7 +403,7 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp | |||
403 | public void ScriptRemoved(UUID itemID) | 403 | public void ScriptRemoved(UUID itemID) |
404 | { | 404 | { |
405 | // m_log.DebugFormat("[URL MODULE]: Removing script {0}", itemID); | 405 | // m_log.DebugFormat("[URL MODULE]: Removing script {0}", itemID); |
406 | 406 | ||
407 | lock (m_UrlMap) | 407 | lock (m_UrlMap) |
408 | { | 408 | { |
409 | List<string> removeURLs = new List<string>(); | 409 | List<string> removeURLs = new List<string>(); |
@@ -495,14 +495,14 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp | |||
495 | return response; | 495 | return response; |
496 | } | 496 | } |
497 | 497 | ||
498 | 498 | ||
499 | return response; | 499 | return response; |
500 | } | 500 | } |
501 | 501 | ||
502 | private bool HasEvents(UUID requestID, UUID sessionID) | 502 | private bool HasEvents(UUID requestID, UUID sessionID) |
503 | { | 503 | { |
504 | UrlData url=null; | 504 | UrlData url=null; |
505 | 505 | ||
506 | lock (m_RequestMap) | 506 | lock (m_RequestMap) |
507 | { | 507 | { |
508 | if (!m_RequestMap.ContainsKey(requestID)) | 508 | if (!m_RequestMap.ContainsKey(requestID)) |
@@ -567,10 +567,10 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp | |||
567 | { | 567 | { |
568 | requestData = url.requests[requestID]; | 568 | requestData = url.requests[requestID]; |
569 | } | 569 | } |
570 | 570 | ||
571 | if (!requestData.requestDone) | 571 | if (!requestData.requestDone) |
572 | return NoEvents(requestID,sessionID); | 572 | return NoEvents(requestID,sessionID); |
573 | 573 | ||
574 | Hashtable response = new Hashtable(); | 574 | Hashtable response = new Hashtable(); |
575 | 575 | ||
576 | if (System.Environment.TickCount - requestData.startTime > 25000) | 576 | if (System.Environment.TickCount - requestData.startTime > 25000) |
@@ -591,7 +591,7 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp | |||
591 | 591 | ||
592 | if (url.allowXss) | 592 | if (url.allowXss) |
593 | response["access_control_allow_origin"] = "*"; | 593 | response["access_control_allow_origin"] = "*"; |
594 | 594 | ||
595 | //remove from map | 595 | //remove from map |
596 | lock (url.requests) | 596 | lock (url.requests) |
597 | { | 597 | { |
@@ -649,7 +649,7 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp | |||
649 | } | 649 | } |
650 | 650 | ||
651 | //for llGetHttpHeader support we need to store original URI here | 651 | //for llGetHttpHeader support we need to store original URI here |
652 | //to make x-path-info / x-query-string / x-script-url / x-remote-ip headers | 652 | //to make x-path-info / x-query-string / x-script-url / x-remote-ip headers |
653 | //as per http://wiki.secondlife.com/wiki/LlGetHTTPHeader | 653 | //as per http://wiki.secondlife.com/wiki/LlGetHTTPHeader |
654 | 654 | ||
655 | RequestData requestData = new RequestData(); | 655 | RequestData requestData = new RequestData(); |
@@ -711,9 +711,9 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp | |||
711 | else | 711 | else |
712 | { | 712 | { |
713 | queryString = queryString + val + "&"; | 713 | queryString = queryString + val + "&"; |
714 | } | ||
715 | } | 714 | } |
716 | } | 715 | } |
716 | } | ||
717 | if (queryString.Length > 1) | 717 | if (queryString.Length > 1) |
718 | queryString = queryString.Substring(0, queryString.Length - 1); | 718 | queryString = queryString.Substring(0, queryString.Length - 1); |
719 | 719 | ||