Bug 29003 - Ifmodule to allow the symbol name and/or .SO name along with .C name
Summary: Ifmodule to allow the symbol name and/or .SO name along with .C name
Status: CLOSED FIXED
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: Core (show other bugs)
Version: 2.1-HEAD
Hardware: Other other
: P3 enhancement (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
URL:
Keywords: PatchAvailable
Depends on:
Blocks:
 
Reported: 2004-05-15 06:25 UTC by Edward Rudd
Modified: 2004-11-16 19:05 UTC (History)
0 users



Attachments
Patch for solutions 1 and 2 (7.25 KB, patch)
2004-05-21 03:42 UTC, Edward Rudd
Details | Diff
patch for solution number 3. (1.25 KB, patch)
2004-05-21 03:43 UTC, Edward Rudd
Details | Diff
Mixed variant (6.31 KB, patch)
2004-05-25 23:23 UTC, André Malo
Details | Diff
Updated patch switching mod_so.c to use the ap_module_symbol_t structure (9.37 KB, patch)
2004-05-27 20:22 UTC, Edward Rudd
Details | Diff
win32 patches (1.86 KB, patch)
2004-05-28 20:25 UTC, Edward Rudd
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Edward Rudd 2004-05-15 06:25:00 UTC
A nice extension to the IfModule directive would be to allow it to compare
against the symbol name (rewrite_module) or the .so name (mod_rewite.so),
instead of only relying in the .c name (mod_rewrite.c).. This will make it
easier to write a config file for modules while have the core .c named something
else (ie. sapi_apache2.c).
Comment 1 André Malo 2004-05-17 18:56:51 UTC
Agreed. This disturbes me all the time, too :-)
Comment 2 Edward Rudd 2004-05-21 03:42:45 UTC
I see several ways of solving this issue.
1) Create an Ifsymbol directive which is analogous to IfModule except it
searches mod_so's internal dynamically loaded modules (moduleinfo structs).
2) Similar to 1 and have IfModule call a function in mod_so (via an optional
function) to search mod_so's internal list of dynamically loaded modules.
3) Alter the STANDARD20_MODULE_STUFF macro to take one paramter which is the
*filename* to register.. (ie.. for sapi_apache2.c sepcify mod_php4.so instead)
This can be setup as a NAMED macro and have the standard one call the NAMED with
__FILE__ to retain backword compatability.
4) provide an function to be called by a modules register_hook function to
register alternate names and have the ap_find_linked_module search this list as
well.
Comment 3 Edward Rudd 2004-05-21 03:42:56 UTC
Created attachment 11620 [details]
Patch for solutions 1 and 2
Comment 4 Edward Rudd 2004-05-21 03:43:51 UTC
Created attachment 11621 [details]
patch for solution number 3.
Comment 5 Edward Rudd 2004-05-21 03:46:36 UTC
Set PatchAvailable

I still need to work up a patch for solution number 4.
Comment 6 André Malo 2004-05-25 23:23:56 UTC
Created attachment 11670 [details]
Mixed variant
Comment 7 André Malo 2004-05-25 23:25:31 UTC
I've attached a patch against HEAD partially based on yours which leaves it all
to <IfModule>, but also resolves the static stuff.

Opinions?
Comment 8 Edward Rudd 2004-05-27 20:22:02 UTC
Created attachment 11685 [details]
Updated patch switching mod_so.c to use the ap_module_symbol_t structure
Comment 9 Edward Rudd 2004-05-27 20:23:49 UTC
It looks good.. and solves the issues I brought up before.. my updated patch
just has mod_so use ap_module_symbol_t instead of it's privately declared
version of that structure (moduleinfo) no need to have two copies of the same
structure.

I think this solves the issue completely, I'm up for bringing it up for a vote
on dev@httpd.
Comment 10 André Malo 2004-05-27 20:43:48 UTC
+1.

(plus that the build processes for win32 and netware need to be updated).
Comment 11 Edward Rudd 2004-05-28 20:25:57 UTC
Created attachment 11690 [details]
win32 patches
Comment 12 André Malo 2004-06-04 22:42:51 UTC
Committed, since nobody cried.
The build is broken now on Netware, but I assume, it will be fixed soon.