fielding    98/12/11 21:26:05

  Modified:    src      ApacheCore.def CHANGES
               src/include ap_mmn.h http_config.h
               src/main http_config.c
               src/modules/standard mod_so.c
               src/support httpd.exp
  Log:
  Added two new core API functions, ap_single_module_configure() and
  ap_single_module_init(), which are now used by mod_so to correctly
  initialize a module after loading. This fixes a problem with unusable
  handlers, for instance mod_perl's perl-script handler was not found
  when mod_perl was loaded as a DSO, and the same applied to other
  similar modules. Bumped MMN and added function names to ApacheCore.def.
  
  Submitted by: Ralf S. Engelschall
  Reviewed by:  Roy Fielding, Lars Eilebrecht
  
  Revision  Changes    Path
  1.3       +4 -1      apache-1.3/src/ApacheCore.def
  
  Index: ApacheCore.def
  ===================================================================
  RCS file: /home/cvs/apache-1.3/src/ApacheCore.def,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ApacheCore.def    1998/11/11 14:41:27     1.2
  +++ ApacheCore.def    1998/12/12 05:26:00     1.3
  @@ -317,5 +317,8 @@
        so_module   @310
        top_module   @311
        ap_fnmatch   @312
  -     
  +     ap_method_number_of   @313
  +     ap_exists_config_define   @314
  +     ap_single_module_configure   @315
  +     ap_single_module_init   @316
   
  
  
  
  1.1170    +7 -0      apache-1.3/src/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/apache-1.3/src/CHANGES,v
  retrieving revision 1.1169
  retrieving revision 1.1170
  diff -u -r1.1169 -r1.1170
  --- CHANGES   1998/12/12 03:54:16     1.1169
  +++ CHANGES   1998/12/12 05:26:00     1.1170
  @@ -1,5 +1,12 @@
   Changes with Apache 1.3.4
   
  +  *) Added two new core API functions, ap_single_module_configure() and
  +     ap_single_module_init(), which are now used by mod_so to correctly
  +     initialize a module after loading. This fixes a problem with unusable
  +     handlers, for instance mod_perl's perl-script handler was not found
  +     when mod_perl was loaded as a DSO, and the same applied to other
  +     similar modules. [Ralf S. Engelschall]
  +
     *) PORT: Add defines for USE_FLOCK_SERIALIZED_ACCEPT and
        SINGLE_LISTEN_UNSERIALIZED_ACCEPT to NetBSD/OpenBSD section
        of ap_config.h to allow serialized accept for multiport listens.
  
  
  
  1.13      +4 -2      apache-1.3/src/include/ap_mmn.h
  
  Index: ap_mmn.h
  ===================================================================
  RCS file: /home/cvs/apache-1.3/src/include/ap_mmn.h,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- ap_mmn.h  1998/12/04 19:12:15     1.12
  +++ ap_mmn.h  1998/12/12 05:26:02     1.13
  @@ -188,12 +188,14 @@
    *                        exit_generation to running_generation.  Somewhere
    *                        earlier vhostrec was added, but it's only safe to 
use
    *                        as of this rev.  See scoreboard.h for 
documentation.
  + * 19981211             - DSO changes -- added ap_single_module_configure()
  + *                                    -- added ap_single_module_init()
    */
   
   #ifndef MODULE_MAGIC_NUMBER_MAJOR
  -#define MODULE_MAGIC_NUMBER_MAJOR 19981204
  +#define MODULE_MAGIC_NUMBER_MAJOR 19981211
   #endif
  -#define MODULE_MAGIC_NUMBER_MINOR 1                     /* 0...n */
  +#define MODULE_MAGIC_NUMBER_MINOR 0                     /* 0...n */
   #define MODULE_MAGIC_NUMBER MODULE_MAGIC_NUMBER_MAJOR        /* backward 
compat */
   
   /* Useful for testing for features. */
  
  
  
  1.97      +5 -0      apache-1.3/src/include/http_config.h
  
  Index: http_config.h
  ===================================================================
  RCS file: /home/cvs/apache-1.3/src/include/http_config.h,v
  retrieving revision 1.96
  retrieving revision 1.97
  diff -u -r1.96 -r1.97
  --- http_config.h     1998/11/03 13:05:09     1.96
  +++ http_config.h     1998/12/12 05:26:02     1.97
  @@ -336,6 +336,11 @@
   extern module *ap_preloaded_modules[];
   extern API_VAR_EXPORT module **ap_loaded_modules;
   
  +/* For mod_so.c... */
  +
  +void ap_single_module_configure(pool *p, server_rec *s, module *m);
  +void ap_single_module_init(pool *p, server_rec *s, module *m);
  +
   /* For http_main.c... */
   
   server_rec *ap_read_config(pool *conf_pool, pool *temp_pool, char 
*config_name);
  
  
  
  1.137     +17 -0     apache-1.3/src/main/http_config.c
  
  Index: http_config.c
  ===================================================================
  RCS file: /home/cvs/apache-1.3/src/main/http_config.c,v
  retrieving revision 1.136
  retrieving revision 1.137
  diff -u -r1.136 -r1.137
  --- http_config.c     1998/12/02 00:00:02     1.136
  +++ http_config.c     1998/12/12 05:26:03     1.137
  @@ -1476,6 +1476,23 @@
       return s;
   }
   
  +void ap_single_module_configure(pool *p, server_rec *s, module *m)
  +{
  +    if (m->create_server_config)
  +        ap_set_module_config(s->module_config, m,
  +                             (*m->create_server_config)(p, s));
  +    if (m->create_dir_config)
  +        ap_set_module_config(s->lookup_defaults, m,
  +                             (*m->create_dir_config)(p, NULL));
  +}
  +
  +void ap_single_module_init(pool *p, server_rec *s, module *m)
  +{
  +    if (m->init)
  +        (*m->init)(s, p);
  +    build_method_shortcuts();
  +    init_handlers(p);
  +}
   
   void ap_init_modules(pool *p, server_rec *s)
   {
  
  
  
  1.27      +5 -8      apache-1.3/src/modules/standard/mod_so.c
  
  Index: mod_so.c
  ===================================================================
  RCS file: /home/cvs/apache-1.3/src/modules/standard/mod_so.c,v
  retrieving revision 1.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- mod_so.c  1998/09/19 12:27:24     1.26
  +++ mod_so.c  1998/12/12 05:26:04     1.27
  @@ -125,6 +125,7 @@
    */
   
   
  +#define CORE_PRIVATE
   #include "httpd.h"
   #include "http_config.h"
   #include "http_log.h"
  @@ -266,15 +267,11 @@
                     (void (*)(void*))unload_module, ap_null_cleanup);
   
       /* 
  -     * Finally we need to run the configuration functions 
  -     * in new modules now.
  +     * Finally we need to create the configuration for the
  +     * module and initialize it
        */
  -    if (modp->create_server_config)
  -      ((void**)cmd->server->module_config)[modp->module_index] =
  -     (*modp->create_server_config)(cmd->pool, cmd->server);
  -    if (modp->create_dir_config)
  -      ((void**)cmd->server->lookup_defaults)[modp->module_index] =
  -     (*modp->create_dir_config)(cmd->pool, NULL);
  +    ap_single_module_configure(cmd->pool, cmd->server, modp);
  +    ap_single_module_init(cmd->pool, cmd->server, modp);
   
       return NULL;
   }
  
  
  
  1.6       +4 -0      apache-1.3/src/support/httpd.exp
  
  Index: httpd.exp
  ===================================================================
  RCS file: /home/cvs/apache-1.3/src/support/httpd.exp,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- httpd.exp 1998/09/01 20:21:14     1.5
  +++ httpd.exp 1998/12/12 05:26:05     1.6
  @@ -95,6 +95,7 @@
   ap_escape_quotes
   ap_escape_shell_cmd
   ap_excess_requests_per_child
  +ap_exists_config_define
   ap_exists_scoreboard_image
   ap_extended_status
   ap_finalize_request_protocol
  @@ -185,6 +186,7 @@
   ap_md5digest
   ap_meets_conditions
   ap_merge_per_dir_configs
  +ap_method_number_of
   ap_month_snames
   ap_no2slash
   ap_note_auth_failure
  @@ -300,6 +302,8 @@
   ap_show_directives
   ap_show_modules
   ap_signal
  +ap_single_module_configure
  +ap_single_module_init
   ap_slack
   ap_snprintf
   ap_soft_timeout
  
  
  

Reply via email to