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/modules/proxy mod_proxy.h proxy_util.c
Date Wed, 11 Aug 2004 22:13:50 GMT
wrowe       2004/08/11 15:13:50

  Modified:    modules/proxy mod_proxy.h proxy_util.c
  Log:
  Make proxy_conn always accesible for preforked MPM and
  APR_HAS_THREADS enabled.
  
  Add init_conn_worker for creating apr_reslist that maintains connection
  pool. For prefork mpm's use the single connection container.
  
  Submitted by: mturk
  
  Revision  Changes    Path
  1.102     +1 -2      httpd-2.0/modules/proxy/mod_proxy.h
  
  Index: mod_proxy.h
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/proxy/mod_proxy.h,v
  retrieving revision 1.101
  retrieving revision 1.102
  diff -u -r1.101 -r1.102
  --- mod_proxy.h	11 Aug 2004 22:05:20 -0000	1.101
  +++ mod_proxy.h	11 Aug 2004 22:13:50 -0000	1.102
  @@ -205,9 +205,8 @@
       apr_sockaddr_t *addr;   /* Preparsed remote address info */
   #if APR_HAS_THREADS
       apr_reslist_t  *res;    /* Connection resource list */
  -#else
  -    proxy_conn     *conn;   /* Single connection for prefork mpm's */
   #endif
  +    proxy_conn     *conn;   /* Single connection for prefork mpm's */
   } proxy_conn_pool;
   
   /* Worker configuration */
  
  
  
  1.115     +25 -0     httpd-2.0/modules/proxy/proxy_util.c
  
  Index: proxy_util.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/proxy/proxy_util.c,v
  retrieving revision 1.114
  retrieving revision 1.115
  diff -u -r1.114 -r1.115
  --- proxy_util.c	11 Aug 2004 22:12:02 -0000	1.114
  +++ proxy_util.c	11 Aug 2004 22:13:50 -0000	1.115
  @@ -1355,6 +1355,31 @@
       return APR_SUCCESS;
   }
   
  +static apr_status_t init_conn_worker(proxy_worker *worker, server_rec *s)
  +{
  +    apr_status_t rv;
  +#if APR_HAS_THREADS
  +    if (worker->hmax) {
  +        rv = apr_reslist_create(&(worker->cp->res),
  +                                worker->min, worker->smax,
  +                                worker->hmax, worker->ttl,
  +                                connection_constructor, connection_destructor,
  +                                s, worker->cp->pool);
  +    }
  +    else
  +#endif
  +    {
  +        worker->cp->conn = apr_pcalloc(worker->cp->pool, sizeof(proxy_conn));
  +        /* register the pool cleanup */
  +        apr_pool_cleanup_register(worker->cp->pool, (void *)worker->cp->conn,
  +                                  proxy_conn_cleanup, apr_pool_cleanup_null);      
  +
  +        ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s,
  +                     "proxy: socket is created");
  +        rv = APR_SUCCESS;
  +    }
  +    return rv;
  +}
   
   PROXY_DECLARE(apr_status_t)
   ap_proxy_determine_connection(apr_pool_t *p, request_rec *r,
  
  
  

Mime
View raw message