Skip to content

Call to recv may only return partial request message #29

@ghost

Description

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?

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