Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
obulesu458 opened this issue Jan 27, 2024 · 0 comments
Open

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

obulesu458 opened this issue Jan 27, 2024 · 0 comments

Comments

@obulesu458
Copy link

obulesu458 commented Jan 27, 2024

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant