Hi,

i have the current cvs tree of lwIP running on symbian os arm device. after, let me say, 100-200 connects via tcp socket the for-loop in tcp_fasttmr() does
not break, so the following code:

////////////////////////////////////////////////////////////////////////////////
/**
 * Is called every TCP_FAST_INTERVAL (250 ms) and sends delayed ACKs.
 */
void
tcp_fasttmr(void)
{
  struct tcp_pcb *pcb;
  char tmp[80];

  sys_arch_log("tcp_fasttmr() enter\n");

  /* send delayed ACKs */
  for(pcb = tcp_active_pcbs; pcb != NULL; pcb = pcb->next) {

        sprintf(tmp, "0: pcb=%08x, pcb->next=%08x\n", pcb, pcb->next);
        sys_arch_log(tmp);

    if (pcb->flags & TF_ACK_DELAY) {
      LWIP_DEBUGF(TCP_DEBUG, ("tcp_fasttmr: delayed ACK\n"));

          sys_arch_log("1\n");

      tcp_ack_now(pcb);

          sys_arch_log("2\n");
        
      pcb->flags &= ~(TF_ACK_DELAY | TF_ACK_NOW);
    }

    sys_arch_log("3\n");
  }

  sys_arch_log("tcp_fasttmr() leave\n");
}
////////////////////////////////////////////////////////////////////////////////

produces the log:

////////////////////////////////////////////////////////////////////////////////
tcp_fasttmr() enter

0: pcb=00404950, pcb->next=00000000

3

tcp_fasttmr() leave

tcp_fasttmr() enter

0: pcb=00404950, pcb->next=00404950

1

2

3

0: pcb=00404950, pcb->next=00404950

3

0: pcb=00404950, pcb->next=00404950

3
////////////////////////////////////////////////////////////////////////////////

and continues to run forever. as you can see, under some circumstances (which are not clear to me) "pcb->next" can become equal to "pcb". tcp_tmr() is called every TCP_TMR_INTERVAL milliseconds, as recommended. is it a bug of the stack?

bye.


_______________________________________________
lwip-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/lwip-users

Reply via email to