mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-10 20:54:24 +00:00
lwip: optimize TCP close
Optimize TCP close: 1. Not remove TCP pcb when IP address is changed since the lwip netconn still need the pcb 2. If the TCP connection is in TCP_FIN_WAIT_1 for too long time, remove it
This commit is contained in:
@@ -152,6 +152,7 @@ tcp_send_fin(struct tcp_pcb *pcb)
|
||||
return ERR_OK;
|
||||
}
|
||||
}
|
||||
|
||||
/* no data, no length, flags, copy=1, no optdata */
|
||||
return tcp_enqueue_flags(pcb, TCP_FIN);
|
||||
}
|
||||
@@ -1067,7 +1068,7 @@ tcp_output(struct tcp_pcb *pcb)
|
||||
seg->oversize_left = 0;
|
||||
#endif /* TCP_OVERSIZE_DBGCHECK */
|
||||
err = tcp_output_segment(seg, pcb);
|
||||
if (err != ERR_OK) {
|
||||
if ((err != ERR_OK) && (err != ERR_RTE)) {
|
||||
/* segment could not be sent, for whatever reason */
|
||||
pcb->flags |= TF_NAGLEMEMERR;
|
||||
return err;
|
||||
|
Reference in New Issue
Block a user