projects
/
project
/
luci.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge pull request #534 from yousong/add-luci-proto-pppossh
[project/luci.git]
/
modules
/
luci-base
/
luasrc
/
http
/
protocol.lua
diff --git
a/modules/luci-base/luasrc/http/protocol.lua
b/modules/luci-base/luasrc/http/protocol.lua
index
e9efb44
..
0cb62ae
100644
(file)
--- a/
modules/luci-base/luasrc/http/protocol.lua
+++ b/
modules/luci-base/luasrc/http/protocol.lua
@@
-72,7
+72,7
@@
function urlencode( str )
if type(str) == "string" then
str = str:gsub(
if type(str) == "string" then
str = str:gsub(
- "([^a-zA-Z0-9$_%-%.%
+!*'(),
])",
+ "([^a-zA-Z0-9$_%-%.%
~
])",
__chrenc
)
end
__chrenc
)
end
@@
-559,14
+559,23
@@
function parse_message_body( src, msg, filecb )
-- If we have a file callback then feed it
if type(filecb) == "function" then
-- If we have a file callback then feed it
if type(filecb) == "function" then
- sink = filecb
-
+ local meta = {
+ name = "raw",
+ encoding = msg.env.CONTENT_TYPE
+ }
+ sink = function( chunk )
+ if chunk then
+ return filecb(meta, chunk, false)
+ else
+ return filecb(meta, nil, true)
+ end
+ end
-- ... else append to .content
else
msg.content = ""
msg.content_length = 0
-- ... else append to .content
else
msg.content = ""
msg.content_length = 0
- sink = function( chunk
, err
)
+ sink = function( chunk )
if chunk then
if ( msg.content_length + #chunk ) <= HTTP_MAX_CONTENT then
msg.content = msg.content .. chunk
if chunk then
if ( msg.content_length + #chunk ) <= HTTP_MAX_CONTENT then
msg.content = msg.content .. chunk