moonbridge

diff moonbridge_http.lua @ 200:40a7bd08e304

Bugfix in HTTP module regarding extra yield in read_body()
author jbe
date Sat Jun 20 01:26:30 2015 +0200 (2015-06-20)
parents 198b85b736fc
children 4e72725118d0
line diff
     1.1 --- a/moonbridge_http.lua	Sat Jun 20 01:11:30 2015 +0200
     1.2 +++ b/moonbridge_http.lua	Sat Jun 20 01:26:30 2015 +0200
     1.3 @@ -485,6 +485,7 @@
     1.4        -- the "process_body_chunk" callback function:
     1.5        local function read_body_bytes(remaining)
     1.6          while remaining > 0 do
     1.7 +          coroutine.yield()  -- do not read more than necessary
     1.8            local chunklen
     1.9            if remaining > input_chunk_size then
    1.10              chunklen = input_chunk_size
    1.11 @@ -496,7 +497,6 @@
    1.12            if process_body_chunk then
    1.13              process_body_chunk(chunk)
    1.14            end
    1.15 -          coroutine.yield()  -- do not read more than necessary
    1.16          end
    1.17        end
    1.18        -- coroutine for request body processing:
    1.19 @@ -537,7 +537,6 @@
    1.20              end
    1.21            end
    1.22          elseif request_body_content_length then
    1.23 -          coroutine.yield()  -- do not read on first invocation
    1.24            read_body_bytes(request_body_content_length)
    1.25          end
    1.26          if process_body_chunk then

Impressum / About Us