/[lwip]/lwip/src/core/tcp_in.c
ViewVC logotype

Diff of /lwip/src/core/tcp_in.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2 by adamdunkels, Wed Oct 23 19:58:16 2002 UTC revision 1.3 by kieranm, Thu Oct 24 10:57:44 2002 UTC
# Line 641  tcp_receive(struct tcp_pcb *pcb) Line 641  tcp_receive(struct tcp_pcb *pcb)
641          } else {          } else {
642            /* Inflate the congestion window, but not if it means that            /* Inflate the congestion window, but not if it means that
643               the value overflows. */               the value overflows. */
644            if(pcb->cwnd + pcb->mss > pcb->cwnd) {            if((u16_t)(pcb->cwnd + pcb->mss) > pcb->cwnd) {
645              pcb->cwnd += pcb->mss;              pcb->cwnd += pcb->mss;
646            }            }
647                        
# Line 677  tcp_receive(struct tcp_pcb *pcb) Line 677  tcp_receive(struct tcp_pcb *pcb)
677           ssthresh). */           ssthresh). */
678        if(pcb->state >= ESTABLISHED) {        if(pcb->state >= ESTABLISHED) {
679          if(pcb->cwnd < pcb->ssthresh) {          if(pcb->cwnd < pcb->ssthresh) {
680            if(pcb->cwnd + pcb->mss > pcb->cwnd) {            if((u16_t)(pcb->cwnd + pcb->mss) > pcb->cwnd) {
681              pcb->cwnd += pcb->mss;              pcb->cwnd += pcb->mss;
682            }            }
683            DEBUGF(TCP_CWND_DEBUG, ("tcp_receive: slow start cwnd %u\n", pcb->cwnd));            DEBUGF(TCP_CWND_DEBUG, ("tcp_receive: slow start cwnd %u\n", pcb->cwnd));
684          } else {          } else {
685            if(pcb->cwnd + pcb->mss * pcb->mss / pcb->cwnd > pcb->cwnd) {            u16_t new_cwnd = (pcb->cwnd + pcb->mss * pcb->mss / pcb->cwnd);
686              pcb->cwnd += pcb->mss * pcb->mss / pcb->cwnd;            if(new_cwnd > pcb->cwnd) {
687                pcb->cwnd = new_cwnd;
688            }            }
689            DEBUGF(TCP_CWND_DEBUG, ("tcp_receive: congestion avoidance cwnd %u\n", pcb->cwnd));            DEBUGF(TCP_CWND_DEBUG, ("tcp_receive: congestion avoidance cwnd %u\n", pcb->cwnd));
690          }          }
691        }        }
692        DEBUGF(TCP_INPUT_DEBUG, ("tcp_receive: ACK for %lu, unacked->seqno %lu:%lu\n",        DEBUGF(TCP_INPUT_DEBUG, ("tcp_receive: ACK for %lu, unacked->seqno %lu:%lu\n",

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26