httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "William A. Rowe, Jr." <wr...@covalent.net>
Subject Re: ap_cgi_var_lookup()
Date Mon, 12 Nov 2001 06:41:03 GMT
++1 on concept - this has irked me for some time now.  mod_isapi, mod_includes
and a ton of other modules query a given variable, not the entire list... so
this idea makes much good sense :)  Didn't have the brainpower/bandwidth to 
absorb the actual patch this weekend, but I'm looking forward to checking it
out this week!


Bill

----- Original Message ----- 
From: "Doug MacEachern" <dougm@covalent.net>
To: <dev@httpd.apache.org>
Sent: Saturday, November 10, 2001 7:21 PM
Subject: ap_cgi_var_lookup()


> i would like to avoid calling ap_add_{common,cgi}_vars() in mod_perl and
> just tie Perl's %ENV to a lookup function.  i cooked up some generated
> code based logic in Perl's ExtUtils::Constant module.  the generated code
> will probably explain itself better than i can, but here is a comment from
> the gen_vars.pl script:
> 
> #the jist of this generated code is that we:
> #do not want to build a hash table of 30-something entries
> #do not want to do 30-something strcmps
> 
> #so what we do is this:
> #call strlen() only once
> #switch on length, then switch on optimal offset (name[offset])
> #and memcmp (as few times as possible) with given length
> #see comment in best_index() for detail
> 
> i put a proof-of-concept here:
> http://httpd.apache.org/~dougm/mod_cgi_vars.tar.gz
> 
> reason i'm posting here is because the code could be used in
> ssl_var_lookup() and the code generator could be extended to
> deal with ssl-specific variables.  ssl_var_lookup() is currently a big
> hairball of strcmps.  and the "30-something" in the comment above, is
> quite a bit more than that for ssl_var_lookup().
> 
> 
> 
> 


Mime
View raw message