httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From (David Robinson)
Subject Re: abstracting out the proxy handlers
Date Tue, 27 Feb 1996 17:55:00 GMT
>        In order to implement an https proxy while making the evil
>folks at ITAR happy, I abstracting out the http_handler http_canon,
>ftp_handler, ftp_canon functions in mod_proxy.c, using a structure
>like the following:
>typedef struct proxy_handler_struct {
>  char *protocol;
>  int (*handler_func)();
>  int (*canon_func)();
>} proxy_handler_rec;
>static proxy_handler_rec proxy_handler_funcs[] = {
>  { "http", http_canon, http_handler },
>  { "ftp", ftp_canon, ftp_handler },
>  { "https", https_canon, https_handler },
>  { NULL }
>        https_* functions would be linked in seperately. Before I work
>on this too much, it would be nice to know if people think this is
>completely stupid, so I don't waste my time. What do folks think?
>        (I'm also adding in some stuff to allow for proxy chains,
>which might not belong in core apache, but I need it for my
>application. I'll make sure I seperate out the patches.)

Well, I tried to make it as easy as possible for you...
The reason that they (the different protocols) are all in the same file
is because they all access the caching routines. The ultimate plan, which is
waiting on a 'tee-piece' in buff.c is to have
mod_cache.c   - does caching of _any_ request,
mod_proxy_ftp.c, mod_proxy_http.c etc handles these protocols.
mod_proxy.c does the generic proxy functions

so no extra information needs to be passed around.
mod_proxy.c would set the mime type to invoke the correct protocol-specific 

If there is any shared code, for URL canonicalisation say, then it could go
in a new file (url.c).


View raw message