luci-base: uci.js: add extended section syntax support, improve loading
[oweals/luci.git] / modules / luci-base / luasrc / http.lua
index 16fb04c549890f8c3acd63dc8dc7f397685f903a..20b55f2854ff3304de29748131472a1419c66f4c 100644 (file)
@@ -14,7 +14,7 @@ local table, ipairs, pairs, type, tostring, tonumber, error =
 
 module "luci.http"
 
-HTTP_MAX_CONTENT      = 1024*8         -- 8 kB maximum content size
+HTTP_MAX_CONTENT      = 1024*100               -- 100 kB maximum content size
 
 context = util.threadlocal()
 
@@ -335,13 +335,13 @@ end
 -- Content-Type. Stores all extracted data associated with its parameter name
 -- in the params table within the given message object. Multiple parameter
 -- values are stored as tables, ordinary ones as strings.
--- If an optional file callback function is given then it is feeded with the
+-- If an optional file callback function is given then it is fed with the
 -- file contents chunk by chunk and only the extracted file name is stored
 -- within the params table. The callback function will be called subsequently
 -- with three arguments:
 --  o Table containing decoded (name, file) and raw (headers) mime header data
 --  o String value containing a chunk of the file data
---  o Boolean which indicates wheather the current chunk is the last one (eof)
+--  o Boolean which indicates whether the current chunk is the last one (eof)
 function mimedecode_message_body(src, msg, file_cb)
        local parser, header, field
        local len, maxlen = 0, tonumber(msg.env.CONTENT_LENGTH or nil)
@@ -416,7 +416,7 @@ function mimedecode_message_body(src, msg, file_cb)
                end
 
                return true
-       end)
+       end, HTTP_MAX_CONTENT)
 
        return ltn12.pump.all(src, function (chunk)
                len = len + (chunk and #chunk or 0)
@@ -460,7 +460,7 @@ function urldecode_message_body(src, msg)
                end
 
                return true
-       end)
+       end, HTTP_MAX_CONTENT)
 
        return ltn12.pump.all(src, function (chunk)
                len = len + (chunk and #chunk or 0)