[Remove entries to the current 2.0 section below, when backported]
+ *) <IfModule> now recognizes the module identifier in addition to the
+ file name. PR 29003. [Edward Rudd <eddie omegaware.com>, André Malo]
+
*) mod_ssl: Add "SSLUserName" directive to set r->user based on a
chosen SSL environment variable. PR 20957.
[Martin v. Loewis <martin v.loewis.de>]
print ""
print "#include \"ap_config.h\""
print "#include \"httpd.h\""
+ print "#define CORE_PRIVATE"
print "#include \"http_config.h\""
print ""
for (i = 0; i < pn; ++i) {
print "};"
print ""
print "/*"
+ print " * We need the symbols as strings for <IfModule> containers"
+ print " */"
+ print ""
+ print "ap_module_symbol_t ap_prelinked_module_symbols[] = {"
+ for (i = 0; i < n; ++i) {
+ printf (" {\"%s_module\", &%s_module},\n", modules[i], modules[i])
+ }
+ print " {NULL, NULL}"
+ print "};"
+ print ""
+ print "/*"
print " * Modules which initially form the"
print " * list of available modules on startup,"
print " * i.e. these are the modules which are"
APR_ADDTO(INCLUDES, [-I\$(top_builddir)/include])
fi
-APR_ADDTO(INCLUDES, [-I\$(top_srcdir)/os/\$(OS_DIR) -I\$(top_srcdir)/server/mpm/\$(MPM_SUBDIR_NAME) -I\$(top_srcdir)/modules/http -I\$(top_srcdir)/modules/filters -I\$(top_srcdir)/modules/proxy -I\$(top_srcdir)/include -I\$(top_srcdir)/modules/generators])
+APR_ADDTO(INCLUDES, [-I\$(top_srcdir)/os/\$(OS_DIR) -I\$(top_srcdir)/server/mpm/\$(MPM_SUBDIR_NAME) -I\$(top_srcdir)/modules/http -I\$(top_srcdir)/modules/filters -I\$(top_srcdir)/modules/proxy -I\$(top_srcdir)/include -I\$(top_srcdir)/modules/generators -I\$(top_srcdir)/modules/mappers])
echo $ac_n "${nl}Applying OS-specific hints for httpd ...${nl}"
* 20040425 (2.1.0-dev) removed ap_add_named_module API
* changed ap_add_module, ap_add_loaded_module,
* ap_setup_prelinked_modules, ap_process_resource_config
+ * 20040425.1 (2.1.0-dev) Added ap_module_symbol_t and ap_prelinked_module_symbols
*/
#define MODULE_MAGIC_COOKIE 0x41503230UL /* "AP20" */
#ifndef MODULE_MAGIC_NUMBER_MAJOR
#define MODULE_MAGIC_NUMBER_MAJOR 20040425
#endif
-#define MODULE_MAGIC_NUMBER_MINOR 0 /* 0...n */
+#define MODULE_MAGIC_NUMBER_MINOR 1 /* 0...n */
/**
* Determine if the server's current MODULE_MAGIC_NUMBER is at least a
#ifdef CORE_PRIVATE
+/**
+ * This structure is used to assign symbol names to module pointers
+ */
+typedef struct {
+ const char *name;
+ module *modp;
+} ap_module_symbol_t;
+
/**
* The topmost module in the list
* @defvar module *ap_top_module
* @defvar module *ap_prelinked_modules[]
*/
AP_DECLARE_DATA extern module *ap_prelinked_modules[];
+/**
+ * Array of all statically linked modulenames (symbols)
+ * @defvar ap_module_symbol_t ap_prelinked_modulenames[]
+ */
+AP_DECLARE_DATA extern ap_module_symbol_t ap_prelinked_module_symbols[];
/**
* Array of all preloaded modules
* @defvar module *ap_preloaded_modules[]
# End Source File
# Begin Source File
+SOURCE=.\modules\mappers\mod_so.h
+
+!IF "$(CFG)" == "libhttpd - Win32 Release"
+
+# PROP Ignore_Default_Tool 1
+# Begin Custom Build - Creating include/mod_so.h
+InputPath=.\modules\mappers\mod_so.h
+
+".\include\mod_so.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ type .\modules\mappers\mod_so.h > .\include\mod_so.h
+
+# End Custom Build
+
+!ELSEIF "$(CFG)" == "libhttpd - Win32 Debug"
+
+# PROP Ignore_Default_Tool 1
+# Begin Custom Build - Creating include/mod_so.h
+InputPath=.\modules\mappers\mod_so.h
+
+".\include\mod_so.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+ type .\modules\mappers\mod_so.h > .\include\mod_so.h
+
+# End Custom Build
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
SOURCE=.\modules\filters\mod_include.h
!IF "$(CFG)" == "libhttpd - Win32 Release"
#include "http_log.h"
#include "ap_config.h"
+#include "mod_so.h"
+
module AP_MODULE_DECLARE_DATA so_module;
* loaded modules and the corresponding module name.
*/
-typedef struct moduleinfo {
- const char *name;
- module *modp;
-} moduleinfo;
-
typedef struct so_server_conf {
apr_array_header_t *loaded_modules;
} so_server_conf;
soc = (so_server_conf *)apr_pcalloc(p, sizeof(so_server_conf));
soc->loaded_modules = apr_array_make(p, DYNAMIC_MODULE_LIMIT,
- sizeof(moduleinfo));
+ sizeof(ap_module_symbol_t));
return (void *)soc;
}
static apr_status_t unload_module(void *data)
{
- moduleinfo *modi = (moduleinfo*)data;
+ ap_module_symbol_t *modi = (ap_module_symbol_t*)data;
/* only unload if module information is still existing */
if (modi->modp == NULL)
module *modp;
const char *szModuleFile = ap_server_root_relative(cmd->pool, filename);
so_server_conf *sconf;
- moduleinfo *modi;
- moduleinfo *modie;
+ ap_module_symbol_t *modi;
+ ap_module_symbol_t *modie;
int i;
const char *error;
*/
sconf = (so_server_conf *)ap_get_module_config(cmd->server->module_config,
&so_module);
- modie = (moduleinfo *)sconf->loaded_modules->elts;
+ modie = (ap_module_symbol_t *)sconf->loaded_modules->elts;
for (i = 0; i < sconf->loaded_modules->nelts; i++) {
modi = &modie[i];
if (modi->name != NULL && strcmp(modi->name, modname) == 0) {
return NULL;
}
+static module *ap_find_loaded_module_symbol(server_rec *s, const char *modname)
+{
+ so_server_conf *sconf;
+ ap_module_symbol_t *modi;
+ ap_module_symbol_t *modie;
+ int i;
+
+ sconf = (so_server_conf *)ap_get_module_config(s->module_config,
+ &so_module);
+ modie = (ap_module_symbol_t *)sconf->loaded_modules->elts;
+
+ for (i = 0; i < sconf->loaded_modules->nelts; i++) {
+ modi = &modie[i];
+ if (modi->name != NULL && strcmp(modi->name, modname) == 0) {
+ return modi->modp;
+ }
+ }
+ return NULL;
+}
+
#else /* not NO_DLOPEN */
static const char *load_file(cmd_parms *cmd, void *dummy, const char *filename)
#endif /* NO_DLOPEN */
+static void register_hooks(apr_pool_t *p)
+{
+#ifndef NO_DLOPEN
+ APR_REGISTER_OPTIONAL_FN(ap_find_loaded_module_symbol);
+#endif
+}
+
static const command_rec so_cmds[] = {
AP_INIT_TAKE2("LoadModule", load_module, NULL, RSRC_CONF | EXEC_ON_READ,
"a module name and the name of a shared object file to load it from"),
so_sconf_create, /* server config */
NULL, /* merge server config */
so_cmds, /* command apr_table_t */
- NULL /* register hooks */
+ register_hooks /* register hooks */
};
--- /dev/null
+/* Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef MOD_SO_H
+#define MOD_SO_H 1
+
+#include "apr_optional.h"
+#include "httpd.h"
+
+/* optional function declaration */
+APR_DECLARE_OPTIONAL_FN(module *, ap_find_loaded_module_symbol,
+ (server_rec *s, const char *modname));
+
+#endif /* MOD_SO_H */
+
NULL
};
+ap_module_symbol_t ap_prelinked_module_symbols[] = {
+ {"core_module", &core_module},
+ {"mpm_netware_module", &mpm_netware_module},
+ {"http_module", &http_module},
+ {"so_module", &so_module},
+ {"mime_module", &mime_module},
+ {"authz_host_module", &authz_host_module},
+ {"negotiation_module", &negotiation_module},
+ {"include_module", &include_module},
+ {"autoindex_module", &autoindex_module},
+ {"dir_module", &dir_module},
+ {"cgi_module", &cgi_module},
+ {"userdir_module", &userdir_module},
+ {"alias_module", &alias_module},
+ {"env_module", &env_module},
+ {"log_config_module", &log_config_module},
+ {"asis_module", &asis_module},
+ {"imap_module", &imap_module},
+ {"actions_module", &actions_module},
+ {"setenvif_module", &setenvif_module},
+ {"nwssl_module", &nwssl_module},
+ {"netware_module", &netware_module},
+ {NULL, NULL}
+};
+
module *ap_preloaded_modules[] = {
&core_module,
&mpm_netware_module,
NULL
};
+ap_module_symbol_t ap_prelinked_module_symbols[] = {
+ {"core_module", &core_module},
+ {"win32_module", &win32_module},
+ {"mpm_winnt_module", &mpm_winnt_module},
+ {"http_module", &http_module},
+ {"so_module", &so_module},
+ {NULL, NULL}
+};
+
AP_DECLARE_DATA module *ap_preloaded_modules[] = {
&core_module,
&win32_module,
#include "mod_proxy.h"
#include "ap_listen.h"
+#include "mod_so.h" /* for ap_find_loaded_module_symbol */
+
/* LimitRequestBody handling */
#define AP_LIMIT_REQ_BODY_UNSET ((apr_off_t) -1)
#define AP_DEFAULT_LIMIT_REQ_BODY ((apr_off_t) 0)
found = ap_find_linked_module(arg);
+ /* search prelinked stuff */
+ if (!found) {
+ ap_module_symbol_t *current = ap_prelinked_module_symbols;
+
+ for (; current->name; ++current) {
+ if (!strcmp(current->name, arg)) {
+ found = current->modp;
+ break;
+ }
+ }
+ }
+
+ /* search dynamic stuff */
+ if (!found) {
+ APR_OPTIONAL_FN_TYPE(ap_find_loaded_module_symbol) *check_symbol =
+ APR_RETRIEVE_OPTIONAL_FN(ap_find_loaded_module_symbol);
+
+ if (check_symbol) {
+ found = check_symbol(cmd->server, arg);
+ }
+ }
+
if ((!not && found) || (not && !found)) {
ap_directive_t *parent = NULL;
ap_directive_t *current = NULL;