mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-07-04 20:08:57 +00:00
Fixed bug #29617 (sometime cause stall on delete listening connection)
This commit is contained in:
parent
49e8e28cf6
commit
51061fb61e
|
@ -182,6 +182,10 @@ HISTORY
|
||||||
|
|
||||||
++ Bugfixes:
|
++ Bugfixes:
|
||||||
|
|
||||||
|
2010-04-21: Simon Goldschmidt
|
||||||
|
* api_msg.c: Fixed bug #29617 (sometime cause stall on delete listening
|
||||||
|
connection)
|
||||||
|
|
||||||
2010-03-28: Luca Ceresoli
|
2010-03-28: Luca Ceresoli
|
||||||
* ip_addr.c/.h: patch #7143: Add a few missing const qualifiers
|
* ip_addr.c/.h: patch #7143: Add a few missing const qualifiers
|
||||||
|
|
||||||
|
|
|
@ -694,12 +694,19 @@ netconn_drain(struct netconn *conn)
|
||||||
#if LWIP_TCP
|
#if LWIP_TCP
|
||||||
if (sys_mbox_valid(&conn->acceptmbox)) {
|
if (sys_mbox_valid(&conn->acceptmbox)) {
|
||||||
while (sys_mbox_tryfetch(&conn->acceptmbox, &mem) != SYS_MBOX_EMPTY) {
|
while (sys_mbox_tryfetch(&conn->acceptmbox, &mem) != SYS_MBOX_EMPTY) {
|
||||||
|
struct netconn *newconn = (struct netconn *)mem;
|
||||||
/* Only tcp pcbs have an acceptmbox, so no need to check conn->type */
|
/* Only tcp pcbs have an acceptmbox, so no need to check conn->type */
|
||||||
/* pcb might be set to NULL already by err_tcp() */
|
/* pcb might be set to NULL already by err_tcp() */
|
||||||
if (conn->pcb.tcp != NULL) {
|
if (conn->pcb.tcp != NULL) {
|
||||||
tcp_accepted(conn->pcb.tcp);
|
tcp_accepted(conn->pcb.tcp);
|
||||||
}
|
}
|
||||||
netconn_delete((struct netconn *)mem);
|
/* drain recvmbox */
|
||||||
|
netconn_drain(newconn);
|
||||||
|
if (newconn->pcb.tcp != NULL) {
|
||||||
|
tcp_abort(newconn->pcb.tcp);
|
||||||
|
newconn->pcb.tcp = NULL;
|
||||||
|
}
|
||||||
|
netconn_free(newconn);
|
||||||
}
|
}
|
||||||
sys_mbox_free(&conn->acceptmbox);
|
sys_mbox_free(&conn->acceptmbox);
|
||||||
sys_mbox_set_invalid(&conn->acceptmbox);
|
sys_mbox_set_invalid(&conn->acceptmbox);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user