luci.http.protocol: Allow posts to contain more than a single chunk 258/head
authorKarl Palsson <karlp@remake.is>
Fri, 21 Nov 2014 18:18:51 +0000 (18:18 +0000)
committerKarl Palsson <karlp@remake.is>
Fri, 21 Nov 2014 18:18:51 +0000 (18:18 +0000)
The ltn12.pump.step() loop in parse_message_body was incorrectly testing
for EOF, and returning after the first chunk, even if further chunks
were available.  The loop in parse_message_header made the correct
check, and test code making raw ajax json posts now succeeds for posts
>= 2048 bytes.

Signed-off-by: Karl Palsson <karlp@remake.is>
modules/base/luasrc/http/protocol.lua

index 0d41550b23709029935b6aec1a2136febec0d587..6431b04031ed6917b86b4ec19a37dbfa124a1f64 100644 (file)
@@ -658,7 +658,7 @@ function parse_message_body( src, msg, filecb )
 
                        if not ok and err then
                                return nil, err
-                       elseif not err then
+                       elseif not ok then -- eof
                                return true
                        end
                end