Hi,

I have just started to use http client application in lwIP 2.1.2. I use raw
API with #define NO_SYS 1.

I could successfully download 350 KB test file by calling the following
function:

httpc_get_file(&server_addr, portnum, pst->url, conn_settings_try,
HttpClientGetFileReceive, NULL, NULL);   

The callback function looks like this:

err_t HttpClientGetFileReceive(void *arg, struct tcp_pcb* tpcb, struct pbuf
*p, err_t err) {
    if (p != NULL) {
        packet_cnt++;
        dprintf("packet_cnt: %u\n", packet_cnt);
        tcp_recved(tpcb, p->tot_len);                      
        pbuf_free(p);
    } else {
       dprintf("This is the end of the conversation\n");
    }
    return ERR_OK;
}

The dprintf function print debug messages on the serial port. I got the
counter values from 0 till 240. This fits to the number of the packets
observed in WireShark. However I haven't got the "This is the end of the
conversation" message. 

How my application can notice if the tcp conversation with the http server
has been finished?

Thank you for any idea in advance:
Simon Kószó




--
Sent from: http://lwip.100.n7.nabble.com/lwip-users-f3.html

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

Reply via email to