mirror of
https://github.com/espressif/ESP8266_RTOS_SDK.git
synced 2025-06-28 04:42:11 +08:00
feat(lwip): Disable LWIP raw function "shutdown"
Make it be same as esp-idf.
This commit is contained in:
@ -16,6 +16,8 @@
|
|||||||
|
|
||||||
#ifdef SOCKETS_MT
|
#ifdef SOCKETS_MT
|
||||||
|
|
||||||
|
#define SOCKETS_MT_DISABLE_SHUTDOWN
|
||||||
|
|
||||||
#include "lwip/priv/api_msg.h"
|
#include "lwip/priv/api_msg.h"
|
||||||
|
|
||||||
/* disable all LWIP socket API when compiling LWIP raw socket */
|
/* disable all LWIP socket API when compiling LWIP raw socket */
|
||||||
@ -953,6 +955,12 @@ int lwip_fcntl(int s, int cmd, int val)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef SOCKETS_MT_DISABLE_SHUTDOWN
|
||||||
|
int lwip_shutdown(int s, int how)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#else
|
||||||
int lwip_shutdown(int s, int how)
|
int lwip_shutdown(int s, int how)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
@ -967,6 +975,8 @@ int lwip_shutdown(int s, int how)
|
|||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
int lwip_close(int s)
|
int lwip_close(int s)
|
||||||
{
|
{
|
||||||
@ -975,7 +985,11 @@ int lwip_close(int s)
|
|||||||
SYS_ARCH_DECL_PROTECT(lev);
|
SYS_ARCH_DECL_PROTECT(lev);
|
||||||
sys_mutex_t lock_tmp[SOCK_MT_LOCK_MAX];
|
sys_mutex_t lock_tmp[SOCK_MT_LOCK_MAX];
|
||||||
|
|
||||||
|
#ifdef SOCKETS_MT_DISABLE_SHUTDOWN
|
||||||
|
lwip_sync_mt(s, SHUT_RDWR);
|
||||||
|
#else
|
||||||
lwip_shutdown(s, SHUT_RDWR);
|
lwip_shutdown(s, SHUT_RDWR);
|
||||||
|
#endif
|
||||||
|
|
||||||
LWIP_ENTER_MT(s, SOCK_MT_CLOSE, 0);
|
LWIP_ENTER_MT(s, SOCK_MT_CLOSE, 0);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user