|
From: | Neil Turner |
Subject: | Re: [lwip-users] TCP fragmentation over PPP - fragments are lost in LwIP if data is queued for sending |
Date: | Sun, 27 Nov 2016 10:20:15 -0000 |
As far as I can tell the interface will not return ERR_WOULDBLOCK to the API in this case, it will return ERR_OK in which case the application believes the whole message has been sent when it hasn’t. As far as I can tell the application has no idea how much of the message has been sent so cannot know what it has to resend. The code below from do_writemore() in api_msg.c shows it only returns ERR_WOULDBLOCK if there is no available space in TCP if the is some space it carries on and sends what it can. I think in the ‘dontblock’ case this test should be if (len > available) return ERR_WOULDBLOCK, this would solve the problem we are seeing as the application can resend the whole message. available = tcp_sndbuf(conn->pcb.tcp); if (available < len) { /* don't try to write more than sendbuf */ len = available; if (dontblock){ if (!len) { err = ERR_WOULDBLOCK; goto err_mem; } } else { #if LWIP_TCPIP_CORE_LOCKING conn->flags |= NETCONN_FLAG_WRITE_DELAYED; #endif apiflags |= TCP_WRITE_FLAG_MORE; } } Comments? mit freundlichen Grüßen / with best regards From: lwip-users [mailto:address@hidden On Behalf Of address@hidden Neil Turner wrote:
|
[Prev in Thread] | Current Thread | [Next in Thread] |