mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-10-01 12:24:22 +00:00
tcp_slowtmr(): change the scope of 'pcb2' to reflect its block-only usage.
This commit is contained in:
parent
e52730d1fb
commit
f418782c2c
@ -738,7 +738,7 @@ tcp_connect(struct tcp_pcb *pcb, ip_addr_t *ipaddr, u16_t port,
|
|||||||
void
|
void
|
||||||
tcp_slowtmr(void)
|
tcp_slowtmr(void)
|
||||||
{
|
{
|
||||||
struct tcp_pcb *pcb, *pcb2, *prev;
|
struct tcp_pcb *pcb, *prev;
|
||||||
u16_t eff_wnd;
|
u16_t eff_wnd;
|
||||||
u8_t pcb_remove; /* flag if a PCB should be removed */
|
u8_t pcb_remove; /* flag if a PCB should be removed */
|
||||||
u8_t pcb_reset; /* flag if a RST should be sent when removing */
|
u8_t pcb_reset; /* flag if a RST should be sent when removing */
|
||||||
@ -894,6 +894,7 @@ tcp_slowtmr(void)
|
|||||||
|
|
||||||
/* If the PCB should be removed, do it. */
|
/* If the PCB should be removed, do it. */
|
||||||
if (pcb_remove) {
|
if (pcb_remove) {
|
||||||
|
struct tcp_pcb *pcb2;
|
||||||
tcp_pcb_purge(pcb);
|
tcp_pcb_purge(pcb);
|
||||||
/* Remove PCB from tcp_active_pcbs list. */
|
/* Remove PCB from tcp_active_pcbs list. */
|
||||||
if (prev != NULL) {
|
if (prev != NULL) {
|
||||||
@ -911,9 +912,9 @@ tcp_slowtmr(void)
|
|||||||
pcb->local_port, pcb->remote_port);
|
pcb->local_port, pcb->remote_port);
|
||||||
}
|
}
|
||||||
|
|
||||||
pcb2 = pcb->next;
|
pcb2 = pcb;
|
||||||
memp_free(MEMP_TCP_PCB, pcb);
|
pcb = pcb->next;
|
||||||
pcb = pcb2;
|
memp_free(MEMP_TCP_PCB, pcb2);
|
||||||
} else {
|
} else {
|
||||||
/* get the 'next' element now and work with 'prev' below (in case of abort) */
|
/* get the 'next' element now and work with 'prev' below (in case of abort) */
|
||||||
prev = pcb;
|
prev = pcb;
|
||||||
@ -935,7 +936,7 @@ tcp_slowtmr(void)
|
|||||||
|
|
||||||
|
|
||||||
/* Steps through all of the TIME-WAIT PCBs. */
|
/* Steps through all of the TIME-WAIT PCBs. */
|
||||||
prev = NULL;
|
prev = NULL;
|
||||||
pcb = tcp_tw_pcbs;
|
pcb = tcp_tw_pcbs;
|
||||||
while (pcb != NULL) {
|
while (pcb != NULL) {
|
||||||
LWIP_ASSERT("tcp_slowtmr: TIME-WAIT pcb->state == TIME-WAIT", pcb->state == TIME_WAIT);
|
LWIP_ASSERT("tcp_slowtmr: TIME-WAIT pcb->state == TIME-WAIT", pcb->state == TIME_WAIT);
|
||||||
@ -950,6 +951,7 @@ tcp_slowtmr(void)
|
|||||||
|
|
||||||
/* If the PCB should be removed, do it. */
|
/* If the PCB should be removed, do it. */
|
||||||
if (pcb_remove) {
|
if (pcb_remove) {
|
||||||
|
struct tcp_pcb *pcb2;
|
||||||
tcp_pcb_purge(pcb);
|
tcp_pcb_purge(pcb);
|
||||||
/* Remove PCB from tcp_tw_pcbs list. */
|
/* Remove PCB from tcp_tw_pcbs list. */
|
||||||
if (prev != NULL) {
|
if (prev != NULL) {
|
||||||
@ -960,9 +962,9 @@ tcp_slowtmr(void)
|
|||||||
LWIP_ASSERT("tcp_slowtmr: first pcb == tcp_tw_pcbs", tcp_tw_pcbs == pcb);
|
LWIP_ASSERT("tcp_slowtmr: first pcb == tcp_tw_pcbs", tcp_tw_pcbs == pcb);
|
||||||
tcp_tw_pcbs = pcb->next;
|
tcp_tw_pcbs = pcb->next;
|
||||||
}
|
}
|
||||||
pcb2 = pcb->next;
|
pcb2 = pcb;
|
||||||
memp_free(MEMP_TCP_PCB, pcb);
|
pcb = pcb->next;
|
||||||
pcb = pcb2;
|
memp_free(MEMP_TCP_PCB, pcb2);
|
||||||
} else {
|
} else {
|
||||||
prev = pcb;
|
prev = pcb;
|
||||||
pcb = pcb->next;
|
pcb = pcb->next;
|
||||||
@ -997,7 +999,7 @@ tcp_fasttmr(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* send delayed ACKs */
|
/* send delayed ACKs */
|
||||||
if (pcb && (pcb->flags & TF_ACK_DELAY)) {
|
if (pcb && (pcb->flags & TF_ACK_DELAY)) {
|
||||||
LWIP_DEBUGF(TCP_DEBUG, ("tcp_fasttmr: delayed ACK\n"));
|
LWIP_DEBUGF(TCP_DEBUG, ("tcp_fasttmr: delayed ACK\n"));
|
||||||
tcp_ack_now(pcb);
|
tcp_ack_now(pcb);
|
||||||
|
Loading…
Reference in New Issue
Block a user