lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] TCP fragmentation over PPP - fragments are lost in LwIP


From: address@hidden
Subject: Re: [lwip-users] TCP fragmentation over PPP - fragments are lost in LwIP if data is queued for sending
Date: Fri, 25 Nov 2016 20:14:45 +0100
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2

Neil Turner wrote:
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 don’t understand quite enough to know the proper fix.


"dontblock" means you have a nonblocking socket (or netconn). Of course no more byte are written, as the thread would have to block and wait for an ACK to write more.

In the end, you said all day that you sent 2*1400 bytes but you didn't. You told the stack to write 2*1400 bytes if it can without blocking...

Simon

reply via email to

[Prev in Thread] Current Thread [Next in Thread]