Skip to content

Issue with get_next_chunk() function in get_body_chars() #219

@obulesu458

Description

@obulesu458

Sometines,the get_next_chunk() function and the get_body_chars() function in lua-http stream does not return full body of the request.
Currently, when I make a request with a content length of 1.1MB, the get_next_chunk() function only returns 1MB of data. This results in an incomplete body being processed. Due to this in "get_body_chars(n, timeout)", a condition is met where the block size( n ) exceeds the available body size, causing an infinite loop. No error is thrown in this case, and the timeout does not work.
below is the Lua pseudo code how did I use :

`
function (http_stream)

    return coroutine :

            for chunk in http_stream:get_body_chars():

                    get chunk

                    yield chunk

            end

end

`

but it works as expected and gives all chunks of data when I do the same outside the coroutine. Any reason?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions