This commit is contained in:
Justin M. Keyes
2026-04-29 17:37:47 -04:00
committed by GitHub
parent 040bdf0bc5
commit 1e06e95662
19 changed files with 257 additions and 100 deletions

View File

@@ -191,7 +191,7 @@ local default_dispatchers = {
}
--- @async
local function parse_content_length()
local function message_decoder()
local strbuf = strbuffer.new()
while true do
local header_len ---@type integer?
@@ -226,7 +226,7 @@ end
function M.create_read_loop(handle_body, on_exit, on_error)
on_exit = on_exit or function() end
on_error = on_error or function() end
local co = coroutine.create(parse_content_length)
local co = coroutine.create(message_decoder)
coroutine.resume(co)
return function(err, chunk)
if err then