tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ian Ward Comfort <icomf...@rescomp.stanford.edu>
Subject mod_jk 1.2.25, JkEnvVar evaluated too many times
Date Tue, 23 Oct 2007 00:52:10 GMT
(I've heard this list is a good place to discuss mod_jk code; please  
redirect me and accept my apologies if it is not.)

I think I've found a problem with mod_jk 1.2.25 and Apache 2.x,  
whereby JkEnvVar directives are effectively evaluated too many times  
when VirtualHosts are configured.

The problem is apparent on a RHEL4 server of mine running Apache  
2.2.6, with 17 name-based virtual hosts configured for *:80.  I have  
13 JkEnvVars specified, all with default values, in the main server  
configuration.  There are no JK directives within the virtual host  
containers.  By adding some additional instrumentation to the code, I  
can see that each AJP packet is constructed with ((1 + 17) * 13) =  
234 envvar attributes -- the whole set of attributes is appended 18  
times in succession.  (Often this overflows the default maximum  
packet size.)

The source of the trouble seems to be in native/apache-2.0/mod_jk.c,  
in the jk_post_config function, specifically lines 2853-2879 of the  
1.2.25 source.  This code is evaluated many times for the same sconf  
object, as each iteration through the enclosing for loop has a  
different server object, but ap_get_module_config returns the same  
jk_server_conf_t* for all of them.

I would submit a patch for this but I'm no expert in coding Apache  
modules, and I don't want to speculate about the way these  
configurations should be constructed.  If I should dig deeper and  
develop a fix, or provide more information, let me know.

Thanks,
--
Ian Ward Comfort <icomfort@rescomp.stanford.edu>
System Administrator, Student Computing, Stanford University


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message