From 41644bbfa92e93c45c17142d261d304d4bd51ef7 Mon Sep 17 00:00:00 2001 From: Jeff Kelley Date: Mon, 14 Mar 2016 11:42:28 +0100 Subject: [PATCH] Implement parameterization of HTTP_BODY_MAXLENGTH maximum as proposed in Mantis 7839. --- .../Scripting/HttpRequest/ScriptsHttpRequests.cs | 4 +++- bin/OpenSim.ini.example | 6 ++++++ bin/OpenSimDefaults.ini | 6 ++++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs b/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs index e1971cfa93..39486675ab 100644 --- a/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs +++ b/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs @@ -365,6 +365,8 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest m_proxyurl = config.Configs["Startup"].GetString("HttpProxy"); m_proxyexcepts = config.Configs["Startup"].GetString("HttpProxyExceptions"); + HttpRequestClass.HttpBodyMaxLenMAX = config.Configs["Network"].GetInt("HttpBodyMaxLenMAX", 16384); + m_outboundUrlFilter = new OutboundUrlFilter("Script HTTP request module", config); int maxThreads = 15; @@ -454,7 +456,7 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest get { return _finished; } } - public const int HttpBodyMaxLenMAX = 16384; + public static int HttpBodyMaxLenMAX = 16384; // Parameter members and default values public int HttpBodyMaxLen = 2048; diff --git a/bin/OpenSim.ini.example b/bin/OpenSim.ini.example index f8c05063c7..840de6b689 100644 --- a/bin/OpenSim.ini.example +++ b/bin/OpenSim.ini.example @@ -522,6 +522,12 @@ ; ; See http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing#CIDR_notation for more information on CIDR notation + ;# {HttpBodyMaxLenMAX} {} {Maximum bytes allowed for HTTP_BODY_MAXLENGTH} {} 16384 + ;; By default, llHTTPRequest limits the response body to 2048 bytes. + ;; This limit can be extended using HTTP_BODY_MAXLENGTH to a maximum + ;; of HttpBodyMaxLenMAX bytes. + ; HttpBodyMaxLenMAX=16384 + ;# {ExternalHostNameForLSL} {} {Hostname to use for HTTP-IN URLs. This should be reachable from the internet.} {} ;; Hostname to use in llRequestURL/llRequestSecureURL ;; if not defined - default machine name is being used diff --git a/bin/OpenSimDefaults.ini b/bin/OpenSimDefaults.ini index f09d2a16e2..3cdd1a7a0f 100644 --- a/bin/OpenSimDefaults.ini +++ b/bin/OpenSimDefaults.ini @@ -527,6 +527,12 @@ ; Password for cert ; cert_pass = "password" + ; Maximum bytes allowed for HTTP_BODY_MAXLENGTH. + ; By default, llHTTPRequest limits the response body to 2048 bytes. + ; This limit can be extended using HTTP_BODY_MAXLENGTH to a maximum + ; of HttpBodyMaxLenMAX bytes. + ; HttpBodyMaxLenMAX=16384 + ; Hostname to use in llRequestURL/llRequestSecureURL ; if not defined - default machine name is being used ; (on Windows this mean NETBIOS name - useably only inside local network)