mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-12-25 18:14:53 +00:00
fixed bug #52403: netconn: FIN may be sent instead of RST when TCP netconn is closed with pending data in recv_mbox
This commit is contained in:
parent
bd2e820829
commit
245a6835f3
@ -806,9 +806,6 @@ static void
|
|||||||
netconn_drain(struct netconn *conn)
|
netconn_drain(struct netconn *conn)
|
||||||
{
|
{
|
||||||
void *mem;
|
void *mem;
|
||||||
#if LWIP_TCP
|
|
||||||
struct pbuf *p;
|
|
||||||
#endif /* LWIP_TCP */
|
|
||||||
|
|
||||||
/* This runs in tcpip_thread, so we don't need to lock against rx packets */
|
/* This runs in tcpip_thread, so we don't need to lock against rx packets */
|
||||||
|
|
||||||
@ -819,12 +816,7 @@ netconn_drain(struct netconn *conn)
|
|||||||
if (NETCONNTYPE_GROUP(conn->type) == NETCONN_TCP) {
|
if (NETCONNTYPE_GROUP(conn->type) == NETCONN_TCP) {
|
||||||
err_t err;
|
err_t err;
|
||||||
if (!lwip_netconn_is_err_msg(mem, &err)) {
|
if (!lwip_netconn_is_err_msg(mem, &err)) {
|
||||||
p = (struct pbuf *)mem;
|
pbuf_free((struct pbuf *)mem);
|
||||||
/* pcb might be set to NULL already by err_tcp() */
|
|
||||||
if (conn->pcb.tcp != NULL) {
|
|
||||||
tcp_recved(conn->pcb.tcp, p->tot_len);
|
|
||||||
}
|
|
||||||
pbuf_free(p);
|
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
#endif /* LWIP_TCP */
|
#endif /* LWIP_TCP */
|
||||||
|
Loading…
Reference in New Issue
Block a user