httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@locus.apache.org
Subject cvs commit: apache-2.0/src/modules/example mod_example.c
Date Tue, 28 Nov 2000 18:52:25 GMT
rbb         00/11/28 10:52:25

  Modified:    src/modules/example mod_example.c
  Log:
  Get mod_example building cleanly.
  
  Revision  Changes    Path
  1.15      +28 -23    apache-2.0/src/modules/example/mod_example.c
  
  Index: mod_example.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/modules/example/mod_example.c,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- mod_example.c	2000/08/21 15:39:41	1.14
  +++ mod_example.c	2000/11/28 18:52:24	1.15
  @@ -67,8 +67,11 @@
   #include "http_log.h"
   #include "http_main.h"
   #include "http_protocol.h"
  +#include "http_request.h"
   #include "util_script.h"
   
  +#include "apr_strings.h"
  +
   #include <stdio.h>
   
   /*--------------------------------------------------------------------------*/
  @@ -289,7 +292,7 @@
   /*
    * This routine sets up some module-wide cells if they haven't been already.
    */
  -static void setup_module_cells()
  +static void setup_module_cells(void)
   {
       /*
        * If we haven't already allocated our module-private pool, do so now.
  @@ -648,61 +651,64 @@
   }
   
   /* 
  - * This function is called during server initialisation when an heavy-weight
  - * process (such as a child) is being initialised.  As with the
  - * module initialisation function, any information that needs to be recorded
  - * must be in static cells, since there's no configuration record.
  + * This function is called when an heavy-weight process (such as a child) is
  + * being run down or destroyed.  As with the child initialisation function,
  + * any information that needs to be recorded must be in static cells, since
  + * there's no configuration record.
    *
    * There is no return value.
    */
   
   /*
  - * All our process initialiser does is add its trace to the log.
  + * All our process-death routine does is add its trace to the log.
    */
  -static void example_child_init(apr_pool_t *p, server_rec *s)
  +static apr_status_t example_child_exit(void *sv)
   {
  -
  +    server_rec *s = sv;
       char *note;
       char *sname = s->server_hostname;
   
       /*
  -     * Set up any module cells that ought to be initialised.
  -     */
  -    setup_module_cells();
  -    /*
        * The arbitrary text we add to our trace entry indicates for which server
        * we're being called.
        */
       sname = (sname != NULL) ? sname : "";
  -    note = apr_pstrcat(p, "example_child_init(", sname, ")", NULL);
  +    note = apr_pstrcat(s->process->pool, "example_child_exit(", sname, ")", NULL);
       trace_add(s, NULL, NULL, note);
  +    return APR_SUCCESS;
   }
   
   /* 
  - * This function is called when an heavy-weight process (such as a child) is
  - * being run down or destroyed.  As with the child initialisation function,
  - * any information that needs to be recorded must be in static cells, since
  - * there's no configuration record.
  + * This function is called during server initialisation when an heavy-weight
  + * process (such as a child) is being initialised.  As with the
  + * module initialisation function, any information that needs to be recorded
  + * must be in static cells, since there's no configuration record.
    *
    * There is no return value.
    */
   
   /*
  - * All our process-death routine does is add its trace to the log.
  + * All our process initialiser does is add its trace to the log.
    */
  -static void example_child_exit(server_rec *s, apr_pool_t *p)
  +static void example_child_init(apr_pool_t *p, server_rec *s)
   {
   
       char *note;
       char *sname = s->server_hostname;
   
       /*
  +     * Set up any module cells that ought to be initialised.
  +     */
  +    setup_module_cells();
  +    /*
        * The arbitrary text we add to our trace entry indicates for which server
        * we're being called.
        */
       sname = (sname != NULL) ? sname : "";
  -    note = apr_pstrcat(p, "example_child_exit(", sname, ")", NULL);
  +    note = apr_pstrcat(p, "example_child_init(", sname, ")", NULL);
       trace_add(s, NULL, NULL, note);
  +
  +    apr_register_cleanup(p, s, example_child_exit, example_child_exit);
   }
   
   /*
  @@ -1137,14 +1143,13 @@
    */
   static const command_rec example_cmds[] =
   {
  -    {
  +    AP_INIT_NO_ARGS(
           "Example",                          /* directive name */
           cmd_example,                        /* config action routine */
           NULL,                               /* argument to include in call */
           OR_OPTIONS,                         /* where available */
  -        NO_ARGS,                            /* arguments */
           "Example directive - no arguments"  /* directive description */
  -    },
  +    ),
       {NULL}
   };
   
  
  
  

Mime
View raw message