httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject cvs commit: httpd-2.0/server listen.c
Date Mon, 31 Mar 2003 04:30:52 GMT
wrowe       2003/03/30 20:30:52

  Modified:    server   Tag: APACHE_2_0_BRANCH listen.c
  Log:
    Quit registering *two* cleanups listening sockets prior to exec.
    We open them once, register a cleanup only once.
  
  Submitted by:	Jeff Trawick
  Reviewed by:	FirstBill, OtherBill
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.83.2.3  +13 -2     httpd-2.0/server/listen.c
  
  Index: listen.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/listen.c,v
  retrieving revision 1.83.2.2
  retrieving revision 1.83.2.3
  diff -u -r1.83.2.2 -r1.83.2.3
  --- listen.c	3 Feb 2003 17:32:00 -0000	1.83.2.2
  +++ listen.c	31 Mar 2003 04:30:52 -0000	1.83.2.3
  @@ -340,6 +340,8 @@
       ap_listen_rec *lr;
       ap_listen_rec *next;
       int num_open;
  +    const char *userdata_key = "ap_listen_open";
  +    void *data;
   
       /* Don't allocate a default listener.  If we need to listen to a
        * port, then the user needs to have a Listen directive in their
  @@ -370,8 +372,17 @@
       }
       old_listeners = NULL;
   
  -    apr_pool_cleanup_register(pool, NULL, apr_pool_cleanup_null,
  -                              close_listeners_on_exec);
  +    /* we come through here on both passes of the open logs phase
  +     * only register the cleanup once... otherwise we try to close
  +     * listening sockets twice when cleaning up prior to exec
  +     */
  +    apr_pool_userdata_get(&data, userdata_key, pool);
  +    if (!data) {
  +        apr_pool_userdata_set((const void *)1, userdata_key,
  +                              apr_pool_cleanup_null, pool);
  +        apr_pool_cleanup_register(pool, NULL, apr_pool_cleanup_null,
  +                                  close_listeners_on_exec);
  +    }
   
       return num_open ? 0 : -1;
   }
  
  
  

Mime
View raw message