[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [lwip-users] disconnect - connect delay
From: |
Bill Auerbach |
Subject: |
RE: [lwip-users] disconnect - connect delay |
Date: |
Fri, 1 Apr 2011 16:48:39 -0400 |
>Did you use it in HTTP server code? When I abort the multiple
>connection in the accept callback the web browser don't load all the
>webside elements. If browser get RST flag in TCP packet it doesn't try
>to download the element again. In firebug it is shown as Abort state
>instead of "200 OK".
>
>As you can see aborting connection can't be use in HTTP protocol. Or
>maybe I'm doing something wrong.
It will work if you refuse multiple connections from *different* IP
addresses. In the accept handler if the ip address is the same as the first
accepted connection, allow it, otherwise refuse it. I believe this is what
you really want to do - refuse connections from different IP addresses, yes?
Below acceptedPcb is the first pcb accepted and is set to NULL when the last
connection closes.
static struct pcb *acceptedPcb;
static err_t accept(void *arg, struct tcp_pcb *pcb, err_t err)
{
if(acceptedPcb != NULL && acceptedPcb->remote_ip.addr !=
pcb->remote_ip.addr)
{
tcp_close( pcb );
return ERR_OK;
}
.
.
.
.
}
Bill
- Re: [lwip-users] disconnect - connect delay, (continued)
- Re: [lwip-users] disconnect - connect delay, brak brak2, 2011/04/01
- Re: [lwip-users] disconnect - connect delay, Kieran Mansley, 2011/04/01
- Re: [lwip-users] disconnect - connect delay, brak brak2, 2011/04/01
- Re: [lwip-users] disconnect - connect delay, Kieran Mansley, 2011/04/01
- Re: [lwip-users] disconnect - connect delay, brak brak2, 2011/04/04
- Re: [lwip-users] disconnect - connect delay, brak brak2, 2011/04/04
- Re: [lwip-users] disconnect - connect delay, Simon Goldschmidt, 2011/04/04
- Re: [lwip-users] disconnect - connect delay, brak brak2, 2011/04/04
RE: [lwip-users] disconnect - connect delay, Bill Auerbach, 2011/04/01