projects
/
project
/
luci.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
4f630d6
)
* luci/libs: fix eof handling for urldecode_message_body() in protocol.lua
author
Jo-Philipp Wich
<jow@openwrt.org>
Mon, 23 Jun 2008 19:16:00 +0000
(19:16 +0000)
committer
Jo-Philipp Wich
<jow@openwrt.org>
Mon, 23 Jun 2008 19:16:00 +0000
(19:16 +0000)
libs/http/luasrc/http/protocol.lua
patch
|
blob
|
history
diff --git
a/libs/http/luasrc/http/protocol.lua
b/libs/http/luasrc/http/protocol.lua
index
94a7a82
..
318169e
100644
(file)
--- a/
libs/http/luasrc/http/protocol.lua
+++ b/
libs/http/luasrc/http/protocol.lua
@@
-500,8
+500,7
@@
process_states['urldecode-value'] = function( msg, chunk, filecb )
-- We're somewhere within a data section and our buffer is full
if #buffer > #chunk then
-- Flush buffered data
-- We're somewhere within a data section and our buffer is full
if #buffer > #chunk then
-- Flush buffered data
- -- Send EOF if chunk is empty
- msg._urldeccallback( buffer:sub( 1, #buffer - #chunk ), ( #chunk == 0 ) )
+ msg._urldeccallback( buffer:sub( 1, #buffer - #chunk ), false )
-- Store new data
msg._urldeclength = msg._urldeclength + #buffer - #chunk
-- Store new data
msg._urldeclength = msg._urldeclength + #buffer - #chunk
@@
-516,7
+515,9
@@
process_states['urldecode-value'] = function( msg, chunk, filecb )
return true
end
else
return true
end
else
- return nil, "Unexpected EOF"
+ -- Send EOF
+ msg._urldeccallback( "", true )
+ return false
end
end
end
end
@@
-729,7
+730,7
@@
function parse_message_body( source, msg, filecb )
-- Unhandled encoding
-- Unhandled encoding
- -- If a file callback is given then feed it
line by line
, else
+ -- If a file callback is given then feed it
chunk by chunk
, else
-- store whole buffer in message.content
else
-- store whole buffer in message.content
else
@@
-799,4
+800,4
@@
statusmsg = {
[404] = "Not Found",
[500] = "Internal Server Error",
[503] = "Server Unavailable",
[404] = "Not Found",
[500] = "Internal Server Error",
[503] = "Server Unavailable",
-}
\ No newline at end of file
+}