[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-devel] [bug #49684] lwip_netconn_do_writemore(): non-blocking ERR_
From: |
Joel Cunningham |
Subject: |
[lwip-devel] [bug #49684] lwip_netconn_do_writemore(): non-blocking ERR_MEM treated as failure |
Date: |
Wed, 23 Nov 2016 16:10:07 +0000 (UTC) |
User-agent: |
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:50.0) Gecko/20100101 Firefox/50.0 |
URL:
<http://savannah.nongnu.org/bugs/?49684>
Summary: lwip_netconn_do_writemore(): non-blocking ERR_MEM
treated as failure
Project: lwIP - A Lightweight TCP/IP stack
Submitted by: jcunningham
Submitted on: Wed 23 Nov 2016 04:10:00 PM GMT
Category: sockets/netconn
Severity: 3 - Normal
Item Group: Faulty Behaviour
Status: None
Privacy: Public
Assigned to: jcunningham
Open/Closed: Open
Discussion Lock: Any
Planned Release: None
lwIP version: git head
_______________________________________________________
Details:
The current logic in lwip_do_writemore() treats ERR_MEM for non-blocking
sockets as an error that should be propagated to the application. When
ERR_MEM comes out of the sockets layer, it turns into ENOMEM which most
applications treat as fatal and close the socket rather than waiting in select
for the socket to be writable again
We can instead treat the ERR_MEM case the same as ERR_WOULDBLOCK: mark the
socket as non-writeable, and then writable upon resources opening up. The
later two steps are already done in lwip_netconn_do_writemore() and
sent_tcp/poll_tcp. The only piece left is to return ERR_WOULDBLOCK in this
case.
Further, this approach is very similar to how ERR_MEM is handled for blocking
sockets except that the application thread stays blocked until
sent_tcp/poll_tcp indicates resources are available.
Attached is a patch that fixes returning ERR_WOULDBLOCK
_______________________________________________________
File Attachments:
-------------------------------------------------------
Date: Wed 23 Nov 2016 04:10:00 PM GMT Name:
0001-api_msg-treat-non-blocking-ERR_MEM-as-ERR_WOULDBLOCK.patch Size: 2kB
By: jcunningham
<http://savannah.nongnu.org/bugs/download.php?file_id=39057>
_______________________________________________________
Reply to this item at:
<http://savannah.nongnu.org/bugs/?49684>
_______________________________________________
Message sent via/by Savannah
http://savannah.nongnu.org/
- [lwip-devel] [bug #49684] lwip_netconn_do_writemore(): non-blocking ERR_MEM treated as failure,
Joel Cunningham <=