feat(lwip): Add option to receive rest data although TCP aborts

This commit is contained in:
Dong Heng
2020-06-03 18:53:48 +08:00
parent 77552dda7f
commit eb0ec09e6a
3 changed files with 18 additions and 0 deletions

View File

@ -26,6 +26,12 @@ config LWIP_GLOBAL_DATA_LINK_IRAM
help
Link LWIP global data(.bss .data COMMON) from DRAM to IRAM.
config ESP_LWIP_RECV_REST_DATA
bool "Receive rest data although TCP aborts"
default n
help
Receive rest data although TCP aborts.
config TCPIP_RECVMBOX_SIZE
int "TCPIP task receive mail box size"
default 32

View File

@ -500,6 +500,9 @@ netconn_recv_data(struct netconn *conn, void **new_buf)
#endif /* LWIP_TCP */
LWIP_ERROR("netconn_recv: invalid recvmbox", sys_mbox_valid(&conn->recvmbox), return ERR_CONN;);
#if ESP_LWIP_RECV_REST_DATA
if (!sys_mbox_valid(&conn->recvmbox)) {
#endif
if (ERR_IS_FATAL(conn->last_err)) {
/* don't recv on fatal errors: this might block the application task
waiting on recvmbox forever! */
@ -507,6 +510,9 @@ netconn_recv_data(struct netconn *conn, void **new_buf)
before the fatal error occurred - is that a problem? */
return conn->last_err;
}
#if ESP_LWIP_RECV_REST_DATA
}
#endif
#if LWIP_TCP
#if (LWIP_UDP || LWIP_RAW)
if (NETCONNTYPE_GROUP(conn->type) == NETCONN_TCP)

View File

@ -82,6 +82,12 @@
#define ESP_NONBLOCK 0
#endif
#ifdef CONFIG_ESP_LWIP_RECV_REST_DATA
#define ESP_LWIP_RECV_REST_DATA 1
#else
#define ESP_LWIP_RECV_REST_DATA 0
#endif
//#define SOCKETS_TCP_TRACE
#define TCP_HIGH_SPEED_RETRANSMISSION CONFIG_TCP_HIGH_SPEED_RETRANSMISSION