Return-Path: Delivered-To: apmail-httpd-dev-archive@www.apache.org Received: (qmail 70665 invoked from network); 12 Apr 2011 17:51:31 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 12 Apr 2011 17:51:31 -0000 Received: (qmail 81998 invoked by uid 500); 12 Apr 2011 17:51:31 -0000 Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 81937 invoked by uid 500); 12 Apr 2011 17:51:31 -0000 Mailing-List: contact dev-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list dev@httpd.apache.org Received: (qmail 81929 invoked by uid 99); 12 Apr 2011 17:51:31 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 Apr 2011 17:51:31 +0000 X-ASF-Spam-Status: No, hits=0.0 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of torsten.foertsch@gmx.net designates 213.165.64.23 as permitted sender) Received: from [213.165.64.23] (HELO mailout-de.gmx.net) (213.165.64.23) by apache.org (qpsmtpd/0.29) with SMTP; Tue, 12 Apr 2011 17:51:25 +0000 Received: (qmail invoked by alias); 12 Apr 2011 17:51:02 -0000 Received: from p4FD6C3DC.dip.t-dialin.net (EHLO opi.home) [79.214.195.220] by mail.gmx.net (mp023) with SMTP; 12 Apr 2011 19:51:02 +0200 X-Authenticated: #1700068 X-Provags-ID: V01U2FsdGVkX1/NllU+HRnNNiUmvRLyvXGAsU3AyvRHVCALJ7+tol 7n42PpVp5x6A2F From: Torsten =?iso-8859-1?q?F=F6rtsch?= To: dev@httpd.apache.org Subject: Re: ap_read_config in 2.3.11 Date: Tue, 12 Apr 2011 19:50:55 +0200 User-Agent: KMail/1.13.5 (Linux/2.6.34.7-0.7-desktop; KDE/4.4.4; x86_64; ; ) References: <201104112045.55493.torsten.foertsch@gmx.net> <201104112114.53451.sf@sfritsch.de> In-Reply-To: <201104112114.53451.sf@sfritsch.de> MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_AEJpNa0HApMlsrG" Message-Id: <201104121950.56201.torsten.foertsch@gmx.net> X-Y-GMX-Trusted: 0 --Boundary-00=_AEJpNa0HApMlsrG Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable On Monday, April 11, 2011 21:14:53 Stefan Fritsch wrote: > I guess the optimization could be done later, after the config has=20 > been parsed completely. That would waste some memory in pconf but=20 > still preserve the optimization during request processing, which is=20 > more important. The enclosed patch moves the conf_vector_length adjustment to when=20 ap_process_config_tree() has done its work. I think that is enough for=20 mod_perl. On Tuesday, April 12, 2011 18:24:28 William A. Rowe Jr. wrote: > Suggestion - an EXEC_ON_READ 'DynamicModulesMax' directive, which would > let us conf_vector_length =3D total_modules + dyn_modules_max; after the > read_config, and finally lock down conf_vector_length =3D total_modules; > at the end of post_config. WDYT? But yes, moving the adjustment to postconfig will solve the problem more=20 generally. I'll see if I can conceive a patch. Torsten F=F6rtsch =2D-=20 Need professional modperl support? Hire me! (http://foertsch.name) Like fantasy? http://kabatinte.net --Boundary-00=_AEJpNa0HApMlsrG Content-Type: text/x-patch; charset="UTF-8"; name="conf_vector_length.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="conf_vector_length.diff" Index: server/config.c =================================================================== --- server/config.c (revision 1091323) +++ server/config.c (working copy) @@ -1953,6 +1953,12 @@ return NULL; } +static apr_status_t reset_conf_vector_length(void *dummy) +{ + conf_vector_length = max_modules; + return APR_SUCCESS; +} + AP_DECLARE(int) ap_process_config_tree(server_rec *s, ap_directive_t *conftree, apr_pool_t *p, @@ -1981,6 +1987,20 @@ return HTTP_INTERNAL_SERVER_ERROR; } + /* + * We have loaded the dynamic modules. From now on we know exactly how + * long the config vectors need to be. + * + * You may be tempted to move the next 3 lines to ap_read_config() + * just after ap_process_resource_config() to save a few bytes in pconf + * since at that point all the LoadModule directives have been processed. + * Don't do that because it breaks stuff like mod_perl that offer a + * way to register modules as part of their configuration. + */ + conf_vector_length = total_modules; + apr_pool_cleanup_register(p, NULL, reset_conf_vector_length, + apr_pool_cleanup_null); + return OK; } @@ -2255,12 +2275,6 @@ } -static apr_status_t reset_conf_vector_length(void *dummy) -{ - conf_vector_length = max_modules; - return APR_SUCCESS; -} - AP_DECLARE(server_rec*) ap_read_config(process_rec *process, apr_pool_t *ptemp, const char *filename, ap_directive_t **conftree) @@ -2309,14 +2323,6 @@ return NULL; } - /* - * We have loaded the dynamic modules. From now on we know exactly how - * long the config vectors need to be. - */ - conf_vector_length = total_modules; - apr_pool_cleanup_register(p, NULL, reset_conf_vector_length, - apr_pool_cleanup_null); - error = process_command_config(s, ap_server_post_read_config, conftree, p, ptemp); --Boundary-00=_AEJpNa0HApMlsrG--