mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-01 03:34:32 +02:00
Merge branch 'bugfix/tw24252_fix_nonblocking_tcp_close_issue_v3.0' into 'release/v3.0'
lwip: fix nonblocking tcp close issue (backport v3.0) See merge request idf/esp-idf!2943
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user