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

tux as HTTP-parser

Hi Ingo,

I am working on admission control for web servers and have used khttpd
for parsing the HTTP header
to receive URLs and cookies on which I base the admission control
decision. But I ran into
preformance problems so I decided to try tux.

My aim is to use the HTTP parsing provided by tux, direct all accepted
requests to Apache
and reset the non-accepted requests.

For this I have made the following (kind of awkward) changes to
tux2-full-2.4.9-L1 :

from parse_http_message I return when the message is completely parsed,
just before
  * From this point on the request is for the main TUX engine:

after returning to parse_request I call my admission control procedure.
Accepted requests are redirected to user-space by just going to
goto redirect_error making sure the error is not 3.
For the non-accepted I set error to 3 and cachemiss to 0 which
then in zap_request goes to
if (!cachemiss && (req->error == 3)) {
  flush_request(req, 0);

In order to make tux sent the RST to the peer I call
tcp_send_active_reset (which I have export so it is found in the symbol
before the clear_keepalive.

I wonder if you think that this is OK, or if there is a conecptually
better way of
doing this?

Thanks a lot,

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