Hi,
I am working with Marco Jacobs on this issue.
I have added some debug code to tcp_output() so I can see the state of the
unsentq each time it is called, and also switched on some of the tcp debug
traces, this is what I see when the two 1400 messages are sent,
tcp_write(pcb=0021731c, data=002106a2, len=1400, apiflags=1) <- the first
1400 bytes coming from the API layer
tcp_write: queueing 6511:7535 <- 1024 byte segment queued
tcp_write: queueing 7535:7911 <- 376 byte segment queued
tcp_output: unsentq Seg:0 Len:1024 <- here we see the segments on the
queue at the start of tcp_ouput()
tcp_output: unsentq Seg:1 Len:376
tcp_output_segment: 6511:7535 <- send the first 1024 byte segment
tcp_write(pcb=0021731c, data=002106a2, len=648, apiflags=3) <- next 648
bytes only this much will fit until ACK for first 1024 arrives so API layer
must wait
tcp_output: unsentq Seg:0 Len:1024 <- now there is 1024 on unsent q
and TCP buffers are full. (the 648 bytes has been added to the 376 already
queued)
tcp_output_segment: 7535:8559 <- second 1024 byte segment sent so
nothing on the unsentq
tcp_output: nothing to send (00000000)
tcp_output: nothing to send (00000000)
but nothing else arrives from the API layer!!!
Looking at api_msg.c line 1254 it check TCP and only sends as much data as
will fit in TCP (648 bytes in the case above). However after this check at
line 1291 it then does,
if ((conn->write_offset == conn->current_msg->msg.w.len) || dontblock)
{
/* return sent length */
conn->current_msg->msg.w.len = conn->write_offset;
/* everything was written *
write_finished = 1;
conn->write_offset = 0;
}
Since dontblock is true in our case it sets write_finished = 1 which
changes the connection state back to NETCONN_NONE so poll_tcp() will never
send the remaining bytes into TCP
I think this is the problem, but I dont
understand quite enough to know the proper fix.
Any more ideas?
Thanks,
Neil
mit freundlichen Grüßen / with best regards
Neil Turner
Funk-Electronic Piciorgros GmbH
Claudiastr. 5 * 51149 Köln-Porz
Tel.: +49 2203 911 77-0
Fax: +49 2203 913 006
<http://www.piciorgros.com/> http://www.piciorgros.com
Erfüllungsort: Köln * HRB: 30112 * USt-IdNr. DE 812 452 161 *
Geschäftsführer: Dipl.Ing. Petra Piciorgros und Dipl.Ing. Michael D.
Piciorgros
_______________________________________________
lwip-users mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/lwip-users