mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2025-01-14 09:39:22 +00:00
Fixed bug where tearing down a connection would cause loss of memory.
This commit is contained in:
parent
be7275c238
commit
0bce6f8974
@ -255,7 +255,7 @@ netconn_delete(struct netconn *conn)
|
||||
|
||||
/* Drain the recvmbox. */
|
||||
if(conn->recvmbox != SYS_MBOX_NULL) {
|
||||
while(sys_arch_mbox_fetch(conn->recvmbox, &mem, 1) != 0) {
|
||||
while(sys_arch_mbox_fetch(conn->recvmbox, &mem, 1) != SYS_ARCH_TIMEOUT) {
|
||||
if(conn->type == NETCONN_TCP) {
|
||||
pbuf_free((struct pbuf *)mem);
|
||||
} else {
|
||||
@ -269,7 +269,7 @@ netconn_delete(struct netconn *conn)
|
||||
|
||||
/* Drain the acceptmbox. */
|
||||
if(conn->acceptmbox != SYS_MBOX_NULL) {
|
||||
while(sys_arch_mbox_fetch(conn->acceptmbox, &mem, 1) != 0) {
|
||||
while(sys_arch_mbox_fetch(conn->acceptmbox, &mem, 1) != SYS_ARCH_TIMEOUT) {
|
||||
netconn_delete((struct netconn *)mem);
|
||||
}
|
||||
|
||||
|
@ -68,6 +68,9 @@ struct sys_timeout {u8_t dummy;};
|
||||
|
||||
#include "arch/sys_arch.h"
|
||||
|
||||
/** Return code for timeouts from sys_arch_mbox_fetch and sys_arch_sem_wait */
|
||||
#define SYS_ARCH_TIMEOUT 0xffffffff
|
||||
|
||||
typedef void (* sys_timeout_handler)(void *arg);
|
||||
|
||||
struct sys_timeout {
|
||||
|
Loading…
Reference in New Issue
Block a user