>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


_______________________________________________
lwip-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/lwip-users

Reply via email to