/[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.30.2.7 by likewise, Fri Nov 14 09:42:51 2003 UTC revision 1.30.2.8 by likewise, Sat Nov 15 00:41:47 2003 UTC
# Line 558  tcp_process(struct tcp_pcb *pcb) Line 558  tcp_process(struct tcp_pcb *pcb)
558        tcp_parseopt(pcb);        tcp_parseopt(pcb);
559    
560        /* Call the user specified function to call when sucessfully        /* Call the user specified function to call when sucessfully
561     connected. */         * connected. */
562        TCP_EVENT_CONNECTED(pcb, ERR_OK, err);        TCP_EVENT_CONNECTED(pcb, ERR_OK, err);
563        tcp_ack(pcb);        tcp_ack(pcb);
564      }      }
# Line 567  tcp_process(struct tcp_pcb *pcb) Line 567  tcp_process(struct tcp_pcb *pcb)
567      if (flags & TCP_ACK &&      if (flags & TCP_ACK &&
568         !(flags & TCP_RST)) {         !(flags & TCP_RST)) {
569        if (TCP_SEQ_LT(pcb->lastack, ackno) &&        if (TCP_SEQ_LT(pcb->lastack, ackno) &&
570     TCP_SEQ_LEQ(ackno, pcb->snd_nxt)) {            TCP_SEQ_LEQ(ackno, pcb->snd_nxt)) {
571          pcb->state = ESTABLISHED;          pcb->state = ESTABLISHED;
572          LWIP_DEBUGF(DEMO_DEBUG, ("TCP connection established %u -> %u.\n", inseg.tcphdr->src, inseg.tcphdr->dest));          LWIP_DEBUGF(DEMO_DEBUG, ("TCP connection established %u -> %u.\n", inseg.tcphdr->src, inseg.tcphdr->dest));
573    LWIP_ASSERT("pcb->accept != NULL", pcb->accept != NULL);  #if LWIP_CALLBACK_API
574    /* Call the accept function. */          LWIP_ASSERT("pcb->accept != NULL", pcb->accept != NULL);
575    TCP_EVENT_ACCEPT(pcb, ERR_OK, err);  #endif
576    if (err != ERR_OK) {          /* Call the accept function. */
577      /* If the accept function returns with an error, we abort          TCP_EVENT_ACCEPT(pcb, ERR_OK, err);
578         the connection. */          if (err != ERR_OK) {
579      tcp_abort(pcb);            /* If the accept function returns with an error, we abort
580      return ERR_ABRT;             * the connection. */
581    }            tcp_abort(pcb);
582    /* If there was any data contained within this ACK,            return ERR_ABRT;
583       we'd better pass it on to the application as well. */          }
584    tcp_receive(pcb);          /* If there was any data contained within this ACK,
585    pcb->cwnd = pcb->mss;           * we'd better pass it on to the application as well. */
586            tcp_receive(pcb);
587            pcb->cwnd = pcb->mss;
588        }        }
589      }      }
590      break;      break;

Legend:
Removed from v.1.30.2.7  
changed lines
  Added in v.1.30.2.8

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