httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From traw...@locus.apache.org
Subject cvs commit: httpd-2.0/modules/generators mod_cgid.c
Date Wed, 13 Dec 2000 04:03:20 GMT
trawick     00/12/12 20:03:20

  Modified:    modules/generators mod_cgid.c
  Log:
  Get mod_cgid to work as a DSO by changing the way it
  keeps track of whether or not its post config hook has
  been called before.  Instead of a static variable (which
  is replaced when the DSO is loaded a second time), use
  userdata in the process pool.
  
  Still to go: mod_file_cache, mod_rewrite
  
  Revision  Changes    Path
  1.53      +10 -5     httpd-2.0/modules/generators/mod_cgid.c
  
  Index: mod_cgid.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/generators/mod_cgid.c,v
  retrieving revision 1.52
  retrieving revision 1.53
  diff -u -r1.52 -r1.53
  --- mod_cgid.c	2000/12/12 20:34:20	1.52
  +++ mod_cgid.c	2000/12/13 04:03:19	1.53
  @@ -107,7 +107,6 @@
   module AP_MODULE_DECLARE_DATA cgid_module; 
   
   static void cgid_init(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp, server_rec *main_server);

  -static int once_through = 0; 
   
   static apr_pool_t *pcgi; 
   
  @@ -510,12 +509,15 @@
       return -1; 
   } 
   
  -static void cgid_init(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp, server_rec *main_server)

  +static void cgid_init(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp, 
  +                      server_rec *main_server) 
   { 
       pid_t pid; 
       apr_proc_t *procnew;
  +    void *data;
   
  -    if (once_through > 0) { 
  +    apr_get_userdata(&data, "cgid_init", main_server->process->pool);
  +    if (data != NULL) {
           apr_create_pool(&pcgi, p); 
   
           if ((pid = fork()) < 0) {
  @@ -533,8 +535,11 @@
   #if APR_HAS_OTHER_CHILD
           apr_register_other_child(procnew, cgid_maint, NULL, NULL, p);
   #endif
  -    } 
  -    else once_through++; 
  +    }
  +    else {
  +        apr_set_userdata((const void *)1, "cgid_init", apr_null_cleanup,
  +                         main_server->process->pool);
  +    }
   } 
   
   static void *create_cgid_config(apr_pool_t *p, server_rec *s) 
  
  
  

Mime
View raw message