lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-users] RE:Problems Getting Adams Http server sample running


From: xcb
Subject: [lwip-users] RE:Problems Getting Adams Http server sample running
Date: Wed, 8 Sep 2004 09:17:36 +0800

lwip-users:
In tcp_in.c:
                  if (pcb->acked > 0) {
    TCP_EVENT_SENT(pcb, pcb->acked, err);
  }

  if (recv_data != NULL) {
    /* Notify application that data has been received. */
    TCP_EVENT_RECV(pcb, recv_data, ERR_OK, err);
  }

  /* If a FIN segment was received, we call the callback
     function with a NULL buffer to indicate EOF. */
  if (recv_flags & TF_GOT_FIN) {
    TCP_EVENT_RECV(pcb, NULL, ERR_OK, err);
  }

when the tcp connect will close, pcb->acked > 0 so excute TCP_EVENT_SENT(pcb, 
pcb->acked, err); it call 

http_sent(void *arg, struct tcp_pcb *pcb, u16_t len)
{
  struct http_state *hs;

  hs = arg;

  if(hs->left > 0) {    
    send_data(pcb, hs);
  } else {
    close_conn(pcb, hs);  //enter this 
  }

  return ERR_OK;
}

close_conn(struct tcp_pcb *pcb, struct http_state *hs)
{
  tcp_arg(pcb, NULL);
  tcp_sent(pcb, NULL);
  tcp_recv(pcb, NULL);
  mem_free(hs);
  tcp_close(pcb);
}
but now hs->left==0 so execute close_conn(pcb, hs); it uninstall recv callback 
function,and later  TCP_EVENT_RECV(pcb, NULL, ERR_OK, err) assert because of 
p==NULL. i dont know what problem cause this ,and i just remove LWIP_ASSERT("p 
!= NULL", p != NULL) code in pbuf.c,that http code go ok.i hope someone can 
find the problem.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]