0

I am trying to write a http server for the Pi Pico using LWIP. I understand that a request will arrive in some number of pbuf chains. I can read these chains and put their payload in a buffer ready to process, but how do I know when the request is complete? I know that when pbuf->len == pbuf->tot_len the chain is complete, but I do not understand how to know that I have received all the incoming chains.

I could begin processing my payload buffer to find the Content-Length http header, but I may not have received enough data to obtain the content length after the first chain.

0 Answers0