264 |
cpcb != NULL; cpcb = cpcb->next) { |
cpcb != NULL; cpcb = cpcb->next) { |
265 |
if (cpcb->local_port == port) { |
if (cpcb->local_port == port) { |
266 |
if (ip_addr_isany(&(cpcb->local_ip)) || |
if (ip_addr_isany(&(cpcb->local_ip)) || |
267 |
ip_addr_isany(ipaddr) || |
ip_addr_isany(ipaddr) || |
268 |
ip_addr_cmp(&(cpcb->local_ip), ipaddr)) { |
ip_addr_cmp(&(cpcb->local_ip), ipaddr)) { |
269 |
return ERR_USE; |
return ERR_USE; |
270 |
} |
} |
271 |
} |
} |
272 |
} |
} |
497 |
DEBUGF(TCP_RTO_DEBUG, ("tcp_slowtmr: rtime %u pcb->rto %u\n", |
DEBUGF(TCP_RTO_DEBUG, ("tcp_slowtmr: rtime %u pcb->rto %u\n", |
498 |
pcb->rtime, pcb->rto)); |
pcb->rtime, pcb->rto)); |
499 |
|
|
500 |
/* Double retransmission time-out unless we are trying to |
/* Double retransmission time-out unless we are trying to |
501 |
connect to somebody (i.e., we are in SYN_SENT). */ |
* connect to somebody (i.e., we are in SYN_SENT). */ |
502 |
if (pcb->state != SYN_SENT) { |
if (pcb->state != SYN_SENT) { |
503 |
pcb->rto = ((pcb->sa >> 3) + pcb->sv) << tcp_backoff[pcb->nrtx]; |
pcb->rto = ((pcb->sa >> 3) + pcb->sv) << tcp_backoff[pcb->nrtx]; |
504 |
} |
} |
505 |
|
tcp_rexmit(pcb); |
|
tcp_rexmit(pcb); |
|
|
|
|
506 |
/* Reduce congestion window and ssthresh. */ |
/* Reduce congestion window and ssthresh. */ |
507 |
eff_wnd = LWIP_MIN(pcb->cwnd, pcb->snd_wnd); |
eff_wnd = LWIP_MIN(pcb->cwnd, pcb->snd_wnd); |
508 |
pcb->ssthresh = eff_wnd >> 1; |
pcb->ssthresh = eff_wnd >> 1; |
517 |
/* Check if this PCB has stayed too long in FIN-WAIT-2 */ |
/* Check if this PCB has stayed too long in FIN-WAIT-2 */ |
518 |
if (pcb->state == FIN_WAIT_2) { |
if (pcb->state == FIN_WAIT_2) { |
519 |
if ((u32_t)(tcp_ticks - pcb->tmr) > |
if ((u32_t)(tcp_ticks - pcb->tmr) > |
520 |
TCP_FIN_WAIT_TIMEOUT / TCP_SLOW_INTERVAL) { |
TCP_FIN_WAIT_TIMEOUT / TCP_SLOW_INTERVAL) { |
521 |
++pcb_remove; |
++pcb_remove; |
522 |
DEBUGF(TCP_DEBUG, ("tcp_slowtmr: removing pcb stuck in FIN-WAIT-2\n")); |
DEBUGF(TCP_DEBUG, ("tcp_slowtmr: removing pcb stuck in FIN-WAIT-2\n")); |
523 |
} |
} |