lwip-users
[Top][All Lists]
Advanced

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

RE: [lwip-users] http_sent cb shows 1 byte trailer [RAW]


From: Ben Hastings
Subject: RE: [lwip-users] http_sent cb shows 1 byte trailer [RAW]
Date: Mon, 10 Aug 2009 13:24:00 -0400

> I have not seen a single http_rcve() with pbuf=NULL yet.

We see it whenever a connection is closed, and use it to free the
tcp_arg:

static err_t http_recv_callback(void *arg, struct tcp_pcb *pcb, struct
pbuf *p, err_t err) {
  struct web_t *webdata = arg;
  if (err == ERR_OK) {
    if (p == NULL) {
      if (pcb->state == CLOSE_WAIT) {
        tcp_close(pcb); //received FIN, need to send FIN
      }
      tcp_arg(pcb, NULL);
      mem_free(webdata);
    } else { //p != NULL
      //actual http server code...

Ben




reply via email to

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