diff options
author | UbitUmarov | 2019-02-24 07:25:50 +0000 |
---|---|---|
committer | UbitUmarov | 2019-02-24 07:25:50 +0000 |
commit | 800f6d6529516be22d4ee79cd8e9161479f4df34 (patch) | |
tree | a489698150d5f0f80731fa9a29f50e14b9945965 /OpenSim/Region/ScriptEngine/Shared | |
parent | update script sintaxe (diff) | |
download | opensim-SC-800f6d6529516be22d4ee79cd8e9161479f4df34.zip opensim-SC-800f6d6529516be22d4ee79cd8e9161479f4df34.tar.gz opensim-SC-800f6d6529516be22d4ee79cd8e9161479f4df34.tar.bz2 opensim-SC-800f6d6529516be22d4ee79cd8e9161479f4df34.tar.xz |
several changes to llHttpRequest processing: options section renamed ScriptsHttpRequestModule; throttle by prim (PrimRequestsBurst = 3, PrimRequestsPerSec = 1) and max concurrent connections per instance (MaxPoolThreads = 5), llhttprequest returns if error, nullkey if throttled, reqid otherwise
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 19 | ||||
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/HttpRequest.cs | 13 |
2 files changed, 13 insertions, 19 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 943141c..6cea821 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -13945,14 +13945,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
13945 | 13945 | ||
13946 | public LSL_Key llHTTPRequest(string url, LSL_List parameters, string body) | 13946 | public LSL_Key llHTTPRequest(string url, LSL_List parameters, string body) |
13947 | { | 13947 | { |
13948 | // Partial implementation: support for parameter flags needed | ||
13949 | // see http://wiki.secondlife.com/wiki/LlHTTPRequest | ||
13950 | // parameter flags support are implemented in ScriptsHttpRequests.cs | ||
13951 | // in StartHttpRequest | ||
13952 | |||
13953 | m_host.AddScriptLPS(1); | 13948 | m_host.AddScriptLPS(1); |
13954 | IHttpRequestModule httpScriptMod = | 13949 | IHttpRequestModule httpScriptMod = m_ScriptEngine.World.RequestModuleInterface<IHttpRequestModule>(); |
13955 | m_ScriptEngine.World.RequestModuleInterface<IHttpRequestModule>(); | 13950 | if(httpScriptMod == null) |
13951 | return ""; | ||
13952 | |||
13953 | if(!httpScriptMod.CheckThrottle(m_host.LocalId)) | ||
13954 | return UUID.Zero.ToString(); | ||
13955 | |||
13956 | List<string> param = new List<string>(); | 13956 | List<string> param = new List<string>(); |
13957 | bool ok; | 13957 | bool ok; |
13958 | Int32 flag; | 13958 | Int32 flag; |
@@ -14123,8 +14123,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
14123 | } | 14123 | } |
14124 | 14124 | ||
14125 | HttpInitialRequestStatus status; | 14125 | HttpInitialRequestStatus status; |
14126 | UUID reqID | 14126 | UUID reqID = httpScriptMod.StartHttpRequest(m_host.LocalId, m_item.ItemID, url, param, httpHeaders, body, out status); |
14127 | = httpScriptMod.StartHttpRequest(m_host.LocalId, m_item.ItemID, url, param, httpHeaders, body, out status); | ||
14128 | 14127 | ||
14129 | if (status == HttpInitialRequestStatus.DISALLOWED_BY_FILTER) | 14128 | if (status == HttpInitialRequestStatus.DISALLOWED_BY_FILTER) |
14130 | Error("llHttpRequest", string.Format("Request to {0} disallowed by filter", url)); | 14129 | Error("llHttpRequest", string.Format("Request to {0} disallowed by filter", url)); |
@@ -14132,7 +14131,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
14132 | if (reqID != UUID.Zero) | 14131 | if (reqID != UUID.Zero) |
14133 | return reqID.ToString(); | 14132 | return reqID.ToString(); |
14134 | else | 14133 | else |
14135 | return null; | 14134 | return ""; |
14136 | } | 14135 | } |
14137 | 14136 | ||
14138 | 14137 | ||
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/HttpRequest.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/HttpRequest.cs index 629b14b..166f2d9 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/HttpRequest.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/HttpRequest.cs | |||
@@ -48,14 +48,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins | |||
48 | if (m_CmdManager.m_ScriptEngine.World == null) | 48 | if (m_CmdManager.m_ScriptEngine.World == null) |
49 | return; | 49 | return; |
50 | 50 | ||
51 | IHttpRequestModule iHttpReq = | 51 | IHttpRequestModule iHttpReq = m_CmdManager.m_ScriptEngine.World.RequestModuleInterface<IHttpRequestModule>(); |
52 | m_CmdManager.m_ScriptEngine.World.RequestModuleInterface<IHttpRequestModule>(); | 52 | if(iHttpReq == null) |
53 | 53 | return; | |
54 | HttpRequestClass httpInfo = null; | ||
55 | |||
56 | if (iHttpReq != null) | ||
57 | httpInfo = (HttpRequestClass)iHttpReq.GetNextCompletedRequest(); | ||
58 | 54 | ||
55 | HttpRequestClass httpInfo = (HttpRequestClass)iHttpReq.GetNextCompletedRequest(); | ||
59 | while (httpInfo != null) | 56 | while (httpInfo != null) |
60 | { | 57 | { |
61 | //m_log.Debug("[AsyncLSL]:" + httpInfo.response_body + httpInfo.status); | 58 | //m_log.Debug("[AsyncLSL]:" + httpInfo.response_body + httpInfo.status); |
@@ -67,8 +64,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins | |||
67 | // implemented here yet anyway. Should be fixed if/when maxsize | 64 | // implemented here yet anyway. Should be fixed if/when maxsize |
68 | // is supported | 65 | // is supported |
69 | 66 | ||
70 | iHttpReq.RemoveCompletedRequest(httpInfo.ReqID); | ||
71 | |||
72 | object[] resobj = new object[] | 67 | object[] resobj = new object[] |
73 | { | 68 | { |
74 | new LSL_Types.LSLString(httpInfo.ReqID.ToString()), | 69 | new LSL_Types.LSLString(httpInfo.ReqID.ToString()), |