mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-10-03 21:32:08 +00:00
altcp: fix altcp_tcp_close for LISTEN pcb
See bug #55219 Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
This commit is contained in:
parent
84228d4f4b
commit
064d816ea1
@ -162,21 +162,25 @@ static void
|
|||||||
altcp_tcp_remove_callbacks(struct tcp_pcb *tpcb)
|
altcp_tcp_remove_callbacks(struct tcp_pcb *tpcb)
|
||||||
{
|
{
|
||||||
tcp_arg(tpcb, NULL);
|
tcp_arg(tpcb, NULL);
|
||||||
|
if (tpcb->state != LISTEN) {
|
||||||
tcp_recv(tpcb, NULL);
|
tcp_recv(tpcb, NULL);
|
||||||
tcp_sent(tpcb, NULL);
|
tcp_sent(tpcb, NULL);
|
||||||
tcp_err(tpcb, NULL);
|
tcp_err(tpcb, NULL);
|
||||||
tcp_poll(tpcb, NULL, tpcb->pollinterval);
|
tcp_poll(tpcb, NULL, tpcb->pollinterval);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
altcp_tcp_setup_callbacks(struct altcp_pcb *conn, struct tcp_pcb *tpcb)
|
altcp_tcp_setup_callbacks(struct altcp_pcb *conn, struct tcp_pcb *tpcb)
|
||||||
{
|
{
|
||||||
tcp_arg(tpcb, conn);
|
tcp_arg(tpcb, conn);
|
||||||
|
/* this might be called for LISTN when close fails... */
|
||||||
|
if (tpcb->state != LISTEN) {
|
||||||
tcp_recv(tpcb, altcp_tcp_recv);
|
tcp_recv(tpcb, altcp_tcp_recv);
|
||||||
tcp_sent(tpcb, altcp_tcp_sent);
|
tcp_sent(tpcb, altcp_tcp_sent);
|
||||||
tcp_err(tpcb, altcp_tcp_err);
|
tcp_err(tpcb, altcp_tcp_err);
|
||||||
/* tcp_poll is set when interval is set by application */
|
/* tcp_poll is set when interval is set by application */
|
||||||
/* listen is set totally different :-) */
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
Loading…
Reference in New Issue
Block a user