projects
/
lua-filemanager.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Приведение в более приличный вид с выносом используемых базовых функций в отдельную...
[lua-filemanager.git]
/
usr
/
lib
/
lua
/
cgi.lua
diff --git
a/usr/lib/lua/cgi.lua
b/usr/lib/lua/cgi.lua
index f5108ee77e494002c3de497f9e0deecfc30271ab..e9068e536ae7f77063b6079606e9fb70e03944d1 100644
(file)
--- a/
usr/lib/lua/cgi.lua
+++ b/
usr/lib/lua/cgi.lua
@@
-1,5
+1,9
@@
-- cgi util module
-- cgi util module
+local uci = require("uci")
+local u_c = uci.cursor()
+local tmppath = u_c.get("filemanager","config","tmpdir")
+
local prevbuf = ""
local blocksize = 4096
local _M = {}
local prevbuf = ""
local blocksize = 4096
local _M = {}
@@
-31,7
+35,7
@@
function _M.new(req)
req.boundary = "--" .. req.boundary
end
-- this is useful only if you have /tmp on tmpfs like in openwrt. otherwise can be set to ""
req.boundary = "--" .. req.boundary
end
-- this is useful only if you have /tmp on tmpfs like in openwrt. otherwise can be set to ""
- req.tempdir =
"/tmp"
+ req.tempdir =
tmppath
req.post = {}
end
req.post = {}
end
@@
-113,4
+117,4
@@
function _M.parse_request_body (req)
return 400, "Malformed POST. Boundary not properly ended with CRLF or --."
end
return 400, "Malformed POST. Boundary not properly ended with CRLF or --."
end
-return _M
\ No newline at end of file
+return _M