> That's because the http server in contrib only implements HTTP 1.0

I am not using the stock contrib code, and my header has HTTP 1.1
The server code I am using is structured similar to what I see
 from Luminary Micro and also the BYU code.
All basically about the same.

> I still don't get it: why do you see a double close?

Basically it was due to this len=1 issue.  I tried to use the "len" value".
I got rid of the double close.  I just don't understand what good "len" is,
 if it is not actual data bytes sent.  Why send the parameter out at all?

> Having set these to null, http_sent() with arg==NULL should also not
> appear.   Could it be that
> you changed close_conn() to not reset these callbacks??

Well here's what comes out.  close_conn is called,
then 2 more http_sent() calls come out both with arg=NULL

CON>close_conn: pcb=0x40006468 hs=0x40004E64 ToSendCnt=2437
CON>http_sent: pcb=0x40006468 hs=0x00000000 len=2437
CON>http_sent: pcb=0x40006468 hs=0x00000000 len=1

Here's the code:

void close_conn(struct tcp_pcb *pcb, struct http_state *hs) {
   err_t err;
 if(hs) DEBUG_PRINT("close_conn: pcb=0x%08X hs=0x%08X ToSendCnt=%d\n", pcb,
hs, hs->SendCnt);
  else DEBUG_PRINT("close_conn: pcb=0x%08X hs=0x%08X\n ", pcb, hs);
   tcp_arg(pcb, NULL);
   tcp_sent(pcb, NULL);
   tcp_recv(pcb, NULL);
   if(hs) mem_free(hs);
   err = tcp_close(pcb);
   if(err != ERR_OK)
  printf("Error %s closing pcb=0x%08X\n", lwip_strerr(err), pcb);
}


I'm just trying to understand the behavior so I can tell if this is fully
working or not.

Chris.



_______________________________________________
lwip-users mailing list
lwip-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/lwip-users

Reply via email to