mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
Merge branch 'bugfix/tw24252_fix_nonblocking_tcp_close_issue_v3.1' into 'release/v3.1'
lwip: fix nonblocking tcp close issue (backport v3.1) See merge request idf/esp-idf!2938
This commit is contained in:
commit
2dfe58e1b3
@ -266,11 +266,11 @@ do{\
|
||||
}\
|
||||
}while(0)
|
||||
|
||||
#define LWIP_SET_CLOSE_FLAG() \
|
||||
#define LWIP_SET_CLOSE_FLAG(_flag) \
|
||||
do{\
|
||||
LWIP_SOCK_LOCK(__sock);\
|
||||
LWIP_DEBUGF(ESP_THREAD_SAFE_DEBUG, ("mark sock closing\n"));\
|
||||
__sock->state = LWIP_SOCK_CLOSING;\
|
||||
__sock->state = (_flag);\
|
||||
LWIP_SOCK_UNLOCK(__sock);\
|
||||
}while(0)
|
||||
|
||||
@ -3312,8 +3312,11 @@ int
|
||||
lwip_close_r(int s)
|
||||
{
|
||||
LWIP_API_LOCK();
|
||||
LWIP_SET_CLOSE_FLAG();
|
||||
LWIP_SET_CLOSE_FLAG(LWIP_SOCK_CLOSING);
|
||||
__ret = lwip_close(s);
|
||||
if (EWOULDBLOCK == __sock->err) {
|
||||
LWIP_SET_CLOSE_FLAG(LWIP_SOCK_OPEN);
|
||||
}
|
||||
LWIP_API_UNLOCK();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user