Sorry, but I have trouble logging in
https://savannah.nongnu.org/bugs/?func=additem&group=lwip
Here is more info to the problem I mentioned before:
Debug output:
In app level, I print out every received character (<cr> is 0xD in ASCII)
In api_msg.c, recv_tcp(void *arg, struct tcp_pcb *pcb, struct pbuf *p,
err_t err),
add
print_dbg("+ ");
right before
API_EVENT(conn, NETCONN_EVT_RCVPLUS, len);
So that each time lwIP capture a packet, it prints out a "+ "
In sockets.c, lwip_recvfrom(int s, void *mem, int len, unsigned int flags,
struct sockaddr *from, socklen_t *fromlen)
Add the following after the if (((flags & MSG_DONTWAIT) block of the function
print_dbg("\ni am here");
print_dbg_hex(sock->rcvevent);
So the non-blocking call to lwip_recvfrom won't have any debug output.
Add the following to the exit-point of the function
print_dbg("\ndone with lwip_recvfrom");
print_dbg_hex(sock->rcvevent);
So that we can track the change of event flags
Capture:
http://www.dataq.com/chen/extra_recvevent.cap
When my program is run, the following debug output is captured:
3+
i am here00000001 done with lwip_recvfrom
00000000
FD<cr> 3+
i am here00000001 done with lwip_recvfrom
00000000
MC<cr> 3+
i am here00000001 done with lwip_recvfrom
00000000
XZ<cr> 3+ 3+
i am here00000002 done with lwip_recvfrom
00000001
FB<cr>
i am here00000001 done with lwip_recvfrom
00000000
VR<cr> 3+
i am here00000001 done with lwip_recvfrom
00000000
RM<cr> 3+ 3+
i am here00000002 done with lwip_recvfrom
00000001
BR
i am here00000001 done with lwip_recvfrom
00000000
00107<cr>
3+ 3+ 3+ 3+ 3+ 3+ 3+ 3+ 3+ 3+ 3+ 3+ 3+ 3+ 3+ 3+ 3+ 3+ 3+
3+ 3+ 3+ 3+
i am here00000017 done with lwip_recvfrom
00000016
BR
BR
00107<cr>
i am here00000015 done with lwip_recvfrom 00000014
IL00001
i am here00000014 done with lwip_recvfrom 00000013
,16416
i am here00000013 done with lwip_recvfrom 00000012
<cr>
i am here00000012 done with lwip_recvfrom 00000011
CL00001
i am here00000011 3+ 3+ done with lwip_recvfrom 00000012
,00000
i am here00000012 done with lwip_recvfrom 00000011
<cr>TG00000,00000,00000,00000<cr>TG00000,00000,00000,00000<cr>FB<cr>TH15000<cr>F
L<cr>SG00001<cr>ES<cr>
packetsize=000007D0
i am here00000011
What I observed:
In the begining, each packet raised one rcvevent, and lwip_recvfrom picks
up the packet and subtract rcvevent.
From the capture file, packets #27--48 are from PC, and matches the 3+
after 00107<cr> in the debug output
lwip_recvfrom continue to pick up one packet at a time, and subtract event
count by one until after the line "i am here00000012 done with
lwip_recvfrom 00000011"
At this point, lwip_recvfrom picks up *ALL* the remaining packets and sends
them back to the main, but it failed to bring sock->rcvevent back to zero
As the result, the next call to lwip_recvfrom will see a non-zero
sock->rcvevent but no data to pick up!
lwIP totally lost sync at this point.
Thanks for your time!
>>>>>>>>>>>>>>
Follow the links on the lwIP project page. Should bring you out here:
https://savannah.nongnu.org/bugs/?func=additem&group=lwip
_______________________________________________
lwip-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/lwip-users