# HG changeset patch # User jbe # Date 1434756390 -7200 # Node ID 40a7bd08e304943e037f41dba7935b9d1d14cce0 # Parent 198b85b736fc0b9daf62c39ae3ffe9a772545bd9 Bugfix in HTTP module regarding extra yield in read_body() diff -r 198b85b736fc -r 40a7bd08e304 moonbridge_http.lua --- a/moonbridge_http.lua Sat Jun 20 01:11:30 2015 +0200 +++ b/moonbridge_http.lua Sat Jun 20 01:26:30 2015 +0200 @@ -485,6 +485,7 @@ -- the "process_body_chunk" callback function: local function read_body_bytes(remaining) while remaining > 0 do + coroutine.yield() -- do not read more than necessary local chunklen if remaining > input_chunk_size then chunklen = input_chunk_size @@ -496,7 +497,6 @@ if process_body_chunk then process_body_chunk(chunk) end - coroutine.yield() -- do not read more than necessary end end -- coroutine for request body processing: @@ -537,7 +537,6 @@ end end elseif request_body_content_length then - coroutine.yield() -- do not read on first invocation read_body_bytes(request_body_content_length) end if process_body_chunk then