httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n.@apache.org
Subject cvs commit: httpd-2.0/server core.c
Date Fri, 04 Jun 2004 22:40:47 GMT
nd          2004/06/04 15:40:47

  Modified:    .        CHANGES configure.in libhttpd.dsp
               build    build-modules-c.awk
               include  ap_mmn.h http_config.h
               modules/mappers mod_so.c
               os/netware modules.c
               os/win32 modules.c
               server   core.c
  Added:       modules/mappers mod_so.h
  Log:
  Nobody objected:
  <IfModule> now takes the module identifier in addition to the
  filename.
  
  CAUTION: this commit breaks the build on netware. It still needs
  to be adjusted. (but I don't have any netware knowledge...)
  Also, developers need to re-run buildconf on unices.
  
  PR: 29003
  Submitted by: Edward Rudd <eddie omegaware.com>, André Malo
  
  Revision  Changes    Path
  1.1506    +3 -0      httpd-2.0/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/CHANGES,v
  retrieving revision 1.1505
  retrieving revision 1.1506
  diff -u -u -r1.1505 -r1.1506
  --- CHANGES	3 Jun 2004 15:00:14 -0000	1.1505
  +++ CHANGES	4 Jun 2004 22:40:46 -0000	1.1506
  @@ -2,6 +2,9 @@
   
     [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>]
  
  
  
  1.261     +1 -1      httpd-2.0/configure.in
  
  Index: configure.in
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/configure.in,v
  retrieving revision 1.260
  retrieving revision 1.261
  diff -u -u -r1.260 -r1.261
  --- configure.in	19 Mar 2004 11:16:03 -0000	1.260
  +++ configure.in	4 Jun 2004 22:40:46 -0000	1.261
  @@ -134,7 +134,7 @@
     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}"
   
  
  
  
  1.63      +29 -0     httpd-2.0/libhttpd.dsp
  
  Index: libhttpd.dsp
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/libhttpd.dsp,v
  retrieving revision 1.62
  retrieving revision 1.63
  diff -u -u -r1.62 -r1.63
  --- libhttpd.dsp	5 Mar 2004 18:52:01 -0000	1.62
  +++ libhttpd.dsp	4 Jun 2004 22:40:46 -0000	1.63
  @@ -241,6 +241,35 @@
   # 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"
  
  
  
  1.9       +12 -0     httpd-2.0/build/build-modules-c.awk
  
  Index: build-modules-c.awk
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/build/build-modules-c.awk,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -u -r1.8 -r1.9
  --- build-modules-c.awk	9 Feb 2004 20:40:47 -0000	1.8
  +++ build-modules-c.awk	4 Jun 2004 22:40:46 -0000	1.9
  @@ -32,6 +32,7 @@
       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) {
  @@ -50,6 +51,17 @@
           printf "  &%s_module,\n", modules[i]
       }
       print "  NULL"
  +    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 "/*"
  
  
  
  1.69      +2 -1      httpd-2.0/include/ap_mmn.h
  
  Index: ap_mmn.h
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/include/ap_mmn.h,v
  retrieving revision 1.68
  retrieving revision 1.69
  diff -u -u -r1.68 -r1.69
  --- ap_mmn.h	25 Apr 2004 17:23:31 -0000	1.68
  +++ ap_mmn.h	4 Jun 2004 22:40:46 -0000	1.69
  @@ -83,6 +83,7 @@
    * 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" */
  @@ -90,7 +91,7 @@
   #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
  
  
  
  1.110     +13 -0     httpd-2.0/include/http_config.h
  
  Index: http_config.h
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/include/http_config.h,v
  retrieving revision 1.109
  retrieving revision 1.110
  diff -u -u -r1.109 -r1.110
  --- http_config.h	25 Apr 2004 17:23:31 -0000	1.109
  +++ http_config.h	4 Jun 2004 22:40:46 -0000	1.110
  @@ -705,6 +705,14 @@
   #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
    */
  @@ -715,6 +723,11 @@
    * @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[]
  
  
  
  1.57      +35 -11    httpd-2.0/modules/mappers/mod_so.c
  
  Index: mod_so.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/mappers/mod_so.c,v
  retrieving revision 1.56
  retrieving revision 1.57
  diff -u -u -r1.56 -r1.57
  --- mod_so.c	25 Apr 2004 17:23:31 -0000	1.56
  +++ mod_so.c	4 Jun 2004 22:40:46 -0000	1.57
  @@ -94,6 +94,8 @@
   #include "http_log.h"
   #include "ap_config.h"
   
  +#include "mod_so.h"
  +
   module AP_MODULE_DECLARE_DATA so_module;
   
   
  @@ -102,11 +104,6 @@
    * 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;
  @@ -117,7 +114,7 @@
   
       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;
   }
  @@ -131,7 +128,7 @@
   
   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)
  @@ -159,8 +156,8 @@
       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;
   
  @@ -182,7 +179,7 @@
        */
       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) {
  @@ -330,6 +327,26 @@
       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)
  @@ -349,6 +366,13 @@
   
   #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"),
  @@ -364,5 +388,5 @@
      so_sconf_create,		/* server config */
      NULL,			    /* merge server config */
      so_cmds,			    /* command apr_table_t */
  -   NULL				    /* register hooks */
  +   register_hooks	    /* register hooks */
   };
  
  
  
  1.1                  httpd-2.0/modules/mappers/mod_so.h
  
  Index: mod_so.h
  ===================================================================
  /* 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 */
  
  
  
  
  1.9       +25 -0     httpd-2.0/os/netware/modules.c
  
  Index: modules.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/os/netware/modules.c,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -u -r1.8 -r1.9
  --- modules.c	9 Feb 2004 20:40:48 -0000	1.8
  +++ modules.c	4 Jun 2004 22:40:47 -0000	1.9
  @@ -69,6 +69,31 @@
     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,
  
  
  
  1.17      +9 -0      httpd-2.0/os/win32/modules.c
  
  Index: modules.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/os/win32/modules.c,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -u -r1.16 -r1.17
  --- modules.c	9 Feb 2004 20:40:49 -0000	1.16
  +++ modules.c	4 Jun 2004 22:40:47 -0000	1.17
  @@ -37,6 +37,15 @@
     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,
  
  
  
  1.280     +24 -0     httpd-2.0/server/core.c
  
  Index: core.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/core.c,v
  retrieving revision 1.279
  retrieving revision 1.280
  diff -u -u -r1.279 -r1.280
  --- core.c	25 May 2004 00:10:25 -0000	1.279
  +++ core.c	4 Jun 2004 22:40:47 -0000	1.280
  @@ -48,6 +48,8 @@
   #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)
  @@ -1895,6 +1897,28 @@
       }
   
       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;
  
  
  

Mime
View raw message