On Tuesday 20 July 2010, Ruediger Pluem wrote: > On 07/19/2010 12:06 PM, [email protected] wrote: > > Author: sf > > Date: Mon Jul 19 10:06:15 2010 > > New Revision: 965408 > > > > URL: http://svn.apache.org/viewvc?rev=965408&view=rev > > Log: > > Add ap_find_module_short_name() to quickly get the module short > > name (i.e. symbol name with trailing "_module" removed) from the > > module_index. To be used for logging. > > > > Modified: > > httpd/httpd/trunk/include/ap_mmn.h > > httpd/httpd/trunk/include/http_config.h > > httpd/httpd/trunk/modules/core/mod_so.c > > httpd/httpd/trunk/server/config.c > > > > Modified: httpd/httpd/trunk/server/config.c > > URL: > > http://svn.apache.org/viewvc/httpd/httpd/trunk/server/config.c?r > > ev=965408&r1=965407&r2=965408&view=diff > > ================================================================ > > ============== --- httpd/httpd/trunk/server/config.c (original) > > +++ httpd/httpd/trunk/server/config.c Mon Jul 19 10:06:15 2010 > > > > @@ -549,8 +555,30 @@ AP_DECLARE(const char *) ap_add_module(m > > > > "reached. Please increase " > > "DYNAMIC_MODULE_LIMIT and > > recompile.", m->name); > > > > } > > > > + > > + } > > + else if (!sym_name) { > > + while (sym->modp != NULL) { > > + if (sym->modp == m) { > > + sym_name = sym->name; > > + break; > > + } > > + sym++; > > + } > > > > } > > > > + if (sym_name) { > > + int len = strlen(sym_name); > > + int slen = strlen("_module"); > > + if (len > slen && !strcmp(sym_name + len - slen, > > "_module")) { + len -= slen; > > + } > > + > > + ap_module_short_names[m->module_index] = > > strdup(sym_name); > > Why not using pools here instead of malloc / free?
Because it didn't work. But looking at the code again, I believe this is due to ap_setup_prelinked_modules calling ap_add_module with the wrong pool. ap_setup_prelinked_modules is called only once and should therefore use process->pool instead of process->pconf. Do you agree?
