diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/Scripting/LSLHttp')
-rw-r--r-- | OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs b/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs index dcf49a7..f4a89bd 100644 --- a/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs | |||
@@ -77,7 +77,9 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp | |||
77 | private Dictionary<string, UrlData> m_UrlMap = | 77 | private Dictionary<string, UrlData> m_UrlMap = |
78 | new Dictionary<string, UrlData>(); | 78 | new Dictionary<string, UrlData>(); |
79 | 79 | ||
80 | 80 | /// <summary> | |
81 | /// Maximum number of external urls that can be set up by this module. | ||
82 | /// </summary> | ||
81 | private int m_TotalUrls = 5000; | 83 | private int m_TotalUrls = 5000; |
82 | 84 | ||
83 | private uint https_port = 0; | 85 | private uint https_port = 0; |
@@ -85,6 +87,10 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp | |||
85 | private IHttpServer m_HttpsServer = null; | 87 | private IHttpServer m_HttpsServer = null; |
86 | 88 | ||
87 | private string m_ExternalHostNameForLSL = ""; | 89 | private string m_ExternalHostNameForLSL = ""; |
90 | public string ExternalHostNameForLSL | ||
91 | { | ||
92 | get { return m_ExternalHostNameForLSL; } | ||
93 | } | ||
88 | 94 | ||
89 | public Type ReplaceableInterface | 95 | public Type ReplaceableInterface |
90 | { | 96 | { |
@@ -104,6 +110,11 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp | |||
104 | { | 110 | { |
105 | https_port = (uint) config.Configs["Network"].GetInt("https_port",0); | 111 | https_port = (uint) config.Configs["Network"].GetInt("https_port",0); |
106 | } | 112 | } |
113 | |||
114 | IConfig llFunctionsConfig = config.Configs["LL-Functions"]; | ||
115 | |||
116 | if (llFunctionsConfig != null) | ||
117 | m_TotalUrls = llFunctionsConfig.GetInt("max_external_urls_per_simulator", m_TotalUrls); | ||
107 | } | 118 | } |
108 | 119 | ||
109 | public void PostInitialise() | 120 | public void PostInitialise() |
@@ -147,6 +158,7 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp | |||
147 | public void Close() | 158 | public void Close() |
148 | { | 159 | { |
149 | } | 160 | } |
161 | |||
150 | public UUID RequestURL(IScriptModule engine, SceneObjectPart host, UUID itemID) | 162 | public UUID RequestURL(IScriptModule engine, SceneObjectPart host, UUID itemID) |
151 | { | 163 | { |
152 | UUID urlcode = UUID.Random(); | 164 | UUID urlcode = UUID.Random(); |
@@ -176,6 +188,10 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp | |||
176 | args.Type = PollServiceEventArgs.EventType.LslHttp; | 188 | args.Type = PollServiceEventArgs.EventType.LslHttp; |
177 | m_HttpServer.AddPollServiceHTTPHandler(uri, args); | 189 | m_HttpServer.AddPollServiceHTTPHandler(uri, args); |
178 | 190 | ||
191 | m_log.DebugFormat( | ||
192 | "[URL MODULE]: Set up incoming request url {0} for {1} in {2} {3}", | ||
193 | uri, itemID, host.Name, host.LocalId); | ||
194 | |||
179 | engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_GRANTED", url }); | 195 | engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_GRANTED", url }); |
180 | } | 196 | } |
181 | 197 | ||
@@ -218,6 +234,10 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp | |||
218 | args.Type = PollServiceEventArgs.EventType.LslHttp; | 234 | args.Type = PollServiceEventArgs.EventType.LslHttp; |
219 | m_HttpsServer.AddPollServiceHTTPHandler(uri, args); | 235 | m_HttpsServer.AddPollServiceHTTPHandler(uri, args); |
220 | 236 | ||
237 | m_log.DebugFormat( | ||
238 | "[URL MODULE]: Set up incoming secure request url {0} for {1} in {2} {3}", | ||
239 | uri, itemID, host.Name, host.LocalId); | ||
240 | |||
221 | engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_GRANTED", url }); | 241 | engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_GRANTED", url }); |
222 | } | 242 | } |
223 | 243 | ||
@@ -241,6 +261,10 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp | |||
241 | m_RequestMap.Remove(req); | 261 | m_RequestMap.Remove(req); |
242 | } | 262 | } |
243 | 263 | ||
264 | // m_log.DebugFormat( | ||
265 | // "[URL MODULE]: Releasing url {0} for {1} in {2}", | ||
266 | // url, data.itemID, data.hostID); | ||
267 | |||
244 | RemoveUrl(data); | 268 | RemoveUrl(data); |
245 | m_UrlMap.Remove(url); | 269 | m_UrlMap.Remove(url); |
246 | } | 270 | } |