[Top][All Lists]

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

Re: [lwip-users] HTTP Auth, LWIP connection management and FIN packets

From: Gustavo Pinho Oliveira
Subject: Re: [lwip-users] HTTP Auth, LWIP connection management and FIN packets
Date: Wed, 2 Mar 2016 18:48:44 +0000

I only close the connection after the tcp_recved and pbuf_free yes.
However tcp_recved leaves the tcp_pcb->rcv_wnd with one byte short of the original window.
I'm using a 2920 byte window but after frame 4 I'm left with 2919 bytes. (That's why the call to tcp_close() sends a RST instead of a FIN)

I'm only using lwip from main as per your instructions.

On 2 March 2016 at 14:38, Sergio R. Caprile <address@hidden> wrote:
1) No I'm not. I've had to completely rewrite the HTTP parser, it wasn't
fully needed because it didn't have to parse headers from the client and
so it was a simple implementation that parsed over and over the same
unless everything came on the same pbuf.
I'm suggesting because I've been there. It is your choice however. You
are free to do whatever you want.

3) In tcp_recv() callback, you only call tcp_close() when you get an
indication of a connection close:
err_t myrecv(void *arg, struct tcp_pcb* pcb, struct pbuf *p, err_t err)
        if ((p == NULL) || (err != ERR_OK)){
Otherwise, if you decide to close on reception, you should get data first:
        tcp_recved(pcb, p->tot_len);
Do you ?

If you are on the client side, receiving, you mentioned you called lwIP
from within interrupts and main context. You must not do that.

lwip-users mailing list

reply via email to

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