[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-devel] [bug #51687] tcp_close(): is it OK to return ERR_MEM if TF_
From: |
Simon Goldschmidt |
Subject: |
[lwip-devel] [bug #51687] tcp_close(): is it OK to return ERR_MEM if TF_CLOSEPEND is set? |
Date: |
Fri, 25 Aug 2017 16:51:03 -0400 (EDT) |
User-agent: |
Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.101 Safari/537.36 |
Follow-up Comment #1, bug #51687 (project lwip):
> is it OK to return ERR_MEM if TF_CLOSEPEND is set?
Actually, it's not. Up to and including 2.0.1, tcp_close() returning != ERR_OK
means the pcb is *not* gone. Applications like the httpd retry closing in
their 'poll' function and are not prepared for the pcb to vanish by tcp_tmr()
closing it.
This is a change I have introduced after 2.0.1, so it's OK to change it
again.
We can either make tcp_close() return ERR_OK in this case (should be OK since
the pcb is not freed anyway from tcp_close(), normally) or let the user app
call another function to achieve dalayed closing.
Something like:
if(tcp_close(pcb) != ERR_OK) {
tcp_close_delayed(pcb);
}
or
tcp_close_force(pcb);
_______________________________________________________
Reply to this item at:
<http://savannah.nongnu.org/bugs/?51687>
_______________________________________________
Message sent via/by Savannah
http://savannah.nongnu.org/