2023-05-11 01:40 AM
I was looking at example HTTP IAP server provided in STM32F2xx package.
\STM32Cube\Repository\STM32Cube_FW_F2_V1.9.3\Projects\STM322xG_EVAL\Applications\LwIP\LwIP_IAP\Src\httpserver.c
In http_recv, received data is extracted on every chunk of data from p->payload assuming len = p->tot_len == p->len. If I'm not wrong, p->tot_len might be more than one pbuff (i.e. more than one p->payload).
Shouldn't routine pbuf_copy_partial used instead of accessing directly to payload field?
I mean, something like:
received_bytes = pbuf_copy_partial(p, getCmdBuffer, p->tot_len, 0);
2023-07-12 06:53 AM
2023-07-12 04:46 PM
if(len)
IAP_HTTP_writedata(ptr,len);
There are several such places in that file and your fix keeps that beginner level incompetent formatting. And then on another topic you are telling this:
the rationale is keeping the code easily readable and understandable
Couldn't be more hypocritical...