err_t
http_recv(void *arg, struct tcp_pcb *pcb, struct pbuf *p, err_t err)
{
int i;
struct http_state *hs;
T_CHAR *pc_rq;
hs = reinterpret_cast<http_state*>(arg);
hs->file = hs->mem;
if(err == ERR_OK && p != NULL)
{
/* Inform TCP that we have taken the data. */
tcp_recved(pcb, p->tot_len);
/* Send the data to the http-Server. */
hs->left =
reinterpret_cast<http_state*>(arg)->myServer->HandleRequest(static_cast<T_CHAR*>(p->payload),p->len,hs->file,BUFFER_SIZE);
...
###############################################################################################################################
In this function I get the pbuf p, with the p->len e.g. 600, but the
real length of the data is 1400, whereby the data after the first 600
bytes is the part of the file to upload.
The upload-file I can see in the p->payload+600 following.
Heike
Kieran Mansley schrieb:
On Thu, 2007-03-08 at 15:33 +0100, Heike Lepke wrote:
Hi Kieran,
I have set tcp_recv(pcb, http_recv);
and in the http_recv(void *arg, struct tcp_pcb *pcb, struct pbuf *p,
err_t err)
-function I call tcp_recved(pcb, p->tot_len); to the passed tcp_pcb *pcb
OK.
I see that for the packet which is mixed with the http-upload request
and the data the p->len is set just to the length of the http-upload
request in tcp_input(struct pbuf *p, struct netif *inp), the real
data-len is ignored. But it seems that the data is inside the received
p-payload, after the p->len. If an another data packets comes I don't
get it. Do I have the chance to call an another tcp-function to get the
missing data-packets?
I'm afraid I don't understand what the problem is you're describing
here. Can you illustrate with the code you think is at fault?
Kieran
_______________________________________________
lwip-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/lwip-users
_______________________________________________
lwip-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/lwip-users