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

Call to recv may only return partial request message #29

Open
ghost opened this issue Sep 19, 2022 · 0 comments
Open

Call to recv may only return partial request message #29

ghost opened this issue Sep 19, 2022 · 0 comments

Comments

@ghost
Copy link

ghost commented Sep 19, 2022

I'm observing in my use case that the initial call to 'recv' in function 'do_respond' in httpd.c in some cases does not return all bytes of the incoming message. This is usual behavior for sockets and a loop is usually applied to continue receiving until all data has arrived.

The ensuing code apparently assumes that a full request is received in the single call to 'recv'.

If this is not the case - as happens in my use case - the solution will somehow involve looking at the 'Content-Length' of the request receive data continuously until all data has arrived.

I'm raising this issue to get feedback if there is something I have completely misunderstood? I'm worried that I have misunderstood something basic, since this must be an issue that 'everyone' will encounter if the PICO server is used beyond small examples.

If it is indeed an issue, then there is an option here to get the solution I'll be making back into the repo if this is valuable in general?

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

0 participants