Behavior of tcp_sent-callback

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Behavior of tcp_sent-callback

I am currently porting matrixSSL 4.2.1 on a Cortex-M4 system using lwip
2.1.2, based on the callback-API.
To save RAM, I would like to use tcp_write with the option flag set to 0 (no
copy of data). To do this, I need to be informed by the lwIP-stack, if a
package has been sent out (which is not possible for what I know) or if the
peer has received it (using the tcp_sent-callback, which tells me the number
of bytes arrived).
However, the behavior of the tcp-stack on peer side depends on the browser
used. The example shows 2 different cases (using firefox).
222120 is a message containing 2 tls records, but the same message also acks
frame 222119.
222131 is just an ack for frame 222130.


The problem is, that lwIP calls the tcp_sent-callback for the second case,
but not for the first one. For the first one, only the tcp_recv-callback is
called, which does not contain an info about the ack of the previous frame.
The code in tcp_in.c, function tcp_input is a little bit complicated to
understand in fast, but I can see that this part of the code, as well as the
code around the handling for the recv_acked variable has changed a lot
between lwIP 2.0.1 and 2.1.2 (but the behavior is the same).

Is this behavior intended like that? Is it possible to change it by
configuration? Or is there any other way to get the same information from
the tcp_recv-callback?


Sent from:

lwip-users mailing list
[hidden email]