mmanders    02/04/12 08:55:59

  Modified:    jk/native/apache-2.0 mod_jk.c
  Log:
  Moved cleanup routine to the right place.  At least on NetWare, the module is loaded 
multiple times and the first time, cleanup wasn't happening.  Since it is a pool 
cleanup, I now register the cleanup where the pool is first used.
  
  Revision  Changes    Path
  1.43      +31 -31    jakarta-tomcat-connectors/jk/native/apache-2.0/mod_jk.c
  
  Index: mod_jk.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/apache-2.0/mod_jk.c,v
  retrieving revision 1.42
  retrieving revision 1.43
  diff -u -r1.42 -r1.43
  --- mod_jk.c  11 Apr 2002 21:52:43 -0000      1.42
  +++ mod_jk.c  12 Apr 2002 15:55:59 -0000      1.43
  @@ -60,7 +60,7 @@
    * Description: Apache 2 plugin for Jakarta/Tomcat                         *
    * Author:      Gal Shachor <[EMAIL PROTECTED]>                           *
    *                 Henri Gomez <[EMAIL PROTECTED]>                               *
  - * Version:     $Revision: 1.42 $                                           *
  + * Version:     $Revision: 1.43 $                                           *
    ***************************************************************************/
   
   /*
  @@ -1328,6 +1328,35 @@
       return DECLINED;
   }
   
  +/** Standard apache hook, cleanup jk
  + */
  +static apr_status_t jk_apr_pool_cleanup(void *data)
  +{
  +    server_rec *s = data;
  +    
  +    while (NULL != s)
  +    {
  +        jk_server_conf_t *conf =
  +            (jk_server_conf_t *)ap_get_module_config(s->module_config, &jk_module);
  +    
  +    
  +        if (conf)
  +        {
  +            wc_close(conf->log);
  +            if (conf->worker_properties)
  +                map_free(&conf->worker_properties);
  +            if (conf->uri_to_context)
  +                map_free(&conf->uri_to_context);
  +            if (conf->automount)
  +                map_free(&conf->automount);
  +            if (conf->uw_map)
  +                uri_worker_map_free(&conf->uw_map, conf->log);
  +            jk_close_file_logger(&conf->log);
  +        }
  +        s = s->next;
  +    }
  +}
  +
   /** Create default jk_config. XXX This is mostly server-independent,
       all servers are using something similar - should go to common.
    */
  @@ -1390,6 +1419,7 @@
   
       c->s = s;
   
  +    apr_pool_cleanup_register(p, s, jk_apr_pool_cleanup, jk_apr_pool_cleanup);
       return c;
   }
   
  @@ -1466,35 +1496,6 @@
       return overrides;
   }
   
  -/** Standard apache hook, cleanup jk
  - */
  -static apr_status_t jk_child_exit(void *data)
  -{
  -    server_rec *s = data;
  -    
  -    while (NULL != s)
  -    {
  -        jk_server_conf_t *conf =
  -            (jk_server_conf_t *)ap_get_module_config(s->module_config, &jk_module);
  -    
  -    
  -        if (conf)
  -        {
  -            wc_close(conf->log);
  -            if (conf->worker_properties)
  -                map_free(&conf->worker_properties);
  -            if (conf->uri_to_context)
  -                map_free(&conf->uri_to_context);
  -            if (conf->automount)
  -                map_free(&conf->automount);
  -            if (conf->uw_map)
  -                uri_worker_map_free(&conf->uw_map, conf->log);
  -            jk_close_file_logger(&conf->log);
  -        }
  -        s = s->next;
  -    }
  -}
  -
   /** Standard apache callback, initialize jk.
    */
   static void jk_child_init(apr_pool_t *pconf, 
  @@ -1503,7 +1504,6 @@
       jk_server_conf_t *conf =
           (jk_server_conf_t *)ap_get_module_config(s->module_config, &jk_module);
   
  -    apr_pool_cleanup_register(pconf, s, jk_child_exit, jk_child_exit);
   /*     init_jk( pconf, conf, s ); */
   }
   
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to