diff options
author | Steven Barth <steven@midlink.org> | 2008-08-22 20:33:48 +0000 |
---|---|---|
committer | Steven Barth <steven@midlink.org> | 2008-08-22 20:33:48 +0000 |
commit | 830ca24abba0ec45618c0121306461fc50c2b7bd (patch) | |
tree | 1f1cb87aeaa5b103b219bab3eb1641e809ada43e /libs/http/luasrc | |
parent | 03c0b0ad120c83f80d94e1e4233a6b4bd6eaf3e9 (diff) |
libs/http: Fixed default sink for unknown data
Diffstat (limited to 'libs/http/luasrc')
-rw-r--r-- | libs/http/luasrc/http/protocol.lua | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/libs/http/luasrc/http/protocol.lua b/libs/http/luasrc/http/protocol.lua index 6e2ae29e3..c80380e97 100644 --- a/libs/http/luasrc/http/protocol.lua +++ b/libs/http/luasrc/http/protocol.lua @@ -638,16 +638,17 @@ function parse_message_body( src, msg, filecb ) msg.content = "" msg.content_length = 0 - sink = function( chunk ) - if ( msg.content_length + #chunk ) <= HTTP_MAX_CONTENT then - - msg.content = msg.content .. chunk - msg.content_length = msg.content_length + #chunk - - return true - else - return nil, "POST data exceeds maximum allowed length" + sink = function( chunk, err ) + if chunk then + if ( msg.content_length + #chunk ) <= HTTP_MAX_CONTENT then + msg.content = msg.content .. chunk + msg.content_length = msg.content_length + #chunk + return true + else + return nil, "POST data exceeds maximum allowed length" + end end + return true end end |