saruman at northernhacking.org
Sat Mar 27 16:26:42 EST 2004
I don't have time to read this all for now, but does it take into account
that libhttpd has one connection structure in the httpd structure and that
is it. Everywhere, it works off of that httpd struct. It needs a bit more
work then that. ALL the socket operations must be put in the select(),
all the reads and all the writes...
On Sat, Mar 27, 2004 at 12:20:52PM -0500, Tony Bussieres wrote:
> Subject: Re: [Wifidog] Status
> From: Tony Bussieres <tonyicemanz at yahoo.ca>
> To: The WiFi Guard Dog project <Wifidog at isf.waglo.com>
> X-Mailer: Ximian Evolution 1.4.5
> Date: Sat, 27 Mar 2004 12:20:52 -0500
> I think it's a good idea to take the socket manipulation out of the
> libhttpd. But we can do it modifiing just a line or two of code.
> We have already access to the server socket by doing :
> And with the client socket with
> My idea was to put a static int socket_states[FDMAX]
> and define states such as : SOCKET_UNUSED, SOCKET_SERVER, SOCKET_CLIENT,
> and two states for the connection to the central server :
> SOCKET_AUTH_CONNECTING, SOCKET_AUTH_CONNECTED
> the index in the array represents the socket itself for exemple
> socket_states[webserver->serverSock] will return SOCKET_SERVER.
> when we are done with a socket we close it and toggle it to
> in our main_loop we can do a select on all the socket that are not in
> UNUSED state.
> for example if we have a read event on our server socket, that's because
> someone is trying to connect to our gateway. it that moment we can call
> the libhttpd function httpdGetConnection(...).There is a select in tha
> function, but we don't care because it won't block.
> Then we switch the client socket options to O_NONBLOCK. and continue
> our job with httpdReadRequest(...)
> The only thing that we have to be aware is that we might have to
> modify the read/write operations in the libhttpd to support non blocking
> sockets. I didn't look in the libhttp code either, we might have work on
> that too.
> The non-blocking "connect()" is a tricky one too (when our gateway will
> connect to the central server), but I found an example in Unix Network
> Programming (Stevens), it will be helpful.
> I will try to free myself some time to work on that this week
> On Fri, 2004-03-26 at 23:30, Alexandre Carmel-Veilleux wrote:
> > hello,
> > It seems that currently Wifidog is sort of taking a backseat.
> > If what I posted about the asynch version of libhttpd is well received
> > here, I might as well go ahead and do it this week. At least to make
> > a proof of concept select-based web server.
> > Opinions anyone?
> > Cheers,
> > Alex
> > ______________________________________________________________________
> > _______________________________________________
> > Wifidog mailing list
> > Wifidog at isf.waglo.com
> > http://isf.waglo.com/mailman/listinfo/wifidog_isf.waglo.com
> May Linux be with you!
> Wifidog mailing list
> Wifidog at isf.waglo.com
-------------- next part --------------
Wifidog mailing list
Wifidog at isf.waglo.com
More information about the Wifidog