httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jfcl...@apache.org
Subject svn commit: r426845 - in /httpd/httpd/branches/httpd-proxy-scoreboard/modules/proxy: mod_proxy.c mod_proxy.h proxy_util.c
Date Sat, 29 Jul 2006 22:24:02 GMT
Author: jfclere
Date: Sat Jul 29 15:24:00 2006
New Revision: 426845

URL: http://svn.apache.org/viewvc?rev=426845&view=rev
Log:
Add ProxySlotMemLoc parameter: location of the file associated with the slot mem.

Modified:
    httpd/httpd/branches/httpd-proxy-scoreboard/modules/proxy/mod_proxy.c
    httpd/httpd/branches/httpd-proxy-scoreboard/modules/proxy/mod_proxy.h
    httpd/httpd/branches/httpd-proxy-scoreboard/modules/proxy/proxy_util.c

Modified: httpd/httpd/branches/httpd-proxy-scoreboard/modules/proxy/mod_proxy.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/httpd-proxy-scoreboard/modules/proxy/mod_proxy.c?rev=426845&r1=426844&r2=426845&view=diff
==============================================================================
--- httpd/httpd/branches/httpd-proxy-scoreboard/modules/proxy/mod_proxy.c (original)
+++ httpd/httpd/branches/httpd-proxy-scoreboard/modules/proxy/mod_proxy.c Sat Jul 29 15:24:00
2006
@@ -933,6 +933,7 @@
     ps->timeout_set = 0;
     ps->badopt = bad_error;
     ps->badopt_set = 0;
+    ps->slotmem_loc = NULL;
     ps->pool = p;
 
     return ps;
@@ -966,6 +967,7 @@
     ps->timeout= (overrides->timeout_set == 0) ? base->timeout : overrides->timeout;
     ps->badopt = (overrides->badopt_set == 0) ? base->badopt : overrides->badopt;
     ps->proxy_status = (overrides->proxy_status_set == 0) ? base->proxy_status :
overrides->proxy_status;
+    ps->slotmem_loc = (overrides->slotmem_loc == NULL) ? base->slotmem_loc : overrides->slotmem_loc;
     ps->pool = p;
     return ps;
 }
@@ -1646,6 +1648,16 @@
     return NULL;
 }
 
+static const char *
+    set_slotmem_loc(cmd_parms *cmd, void *dummy, const char *arg)
+{
+    server_rec *s = cmd->server;
+    proxy_server_conf *conf =
+        (proxy_server_conf *) ap_get_module_config(s->module_config, &proxy_module);
+    conf->slotmem_loc = apr_pstrdup(cmd->pool, arg);
+    return NULL;
+}
+
 static void ap_add_per_proxy_conf(server_rec *s, ap_conf_vector_t *dir_config)
 {
     proxy_server_conf *sconf = ap_get_module_config(s->module_config,
@@ -1795,6 +1807,8 @@
      "Configure Status: proxy status to one of: on | off | full"),
     AP_INIT_RAW_ARGS("ProxySet", set_proxy_param, NULL, RSRC_CONF|ACCESS_CONF,
      "A balancer or worker name with list of params"),
+    AP_INIT_TAKE1("ProxySlotMemLoc", set_slotmem_loc, NULL, RSRC_CONF,
+     "Location of the shared area to store the workers information: file-path (default: anonymous"),
     {NULL}
 };
 
@@ -1849,6 +1863,8 @@
 static int proxy_post_config(apr_pool_t *pconf, apr_pool_t *plog,
                              apr_pool_t *ptemp, server_rec *s)
 {
+    proxy_server_conf *sconf = ap_get_module_config(s->module_config,
+                                                    &proxy_module);
 
     proxy_ssl_enable = APR_RETRIEVE_OPTIONAL_FN(ssl_proxy_enable);
     proxy_ssl_disable = APR_RETRIEVE_OPTIONAL_FN(ssl_engine_disable);
@@ -1856,7 +1872,7 @@
     proxy_ssl_val = APR_RETRIEVE_OPTIONAL_FN(ssl_var_lookup);
 
     /* if we have a memory provider create the comarea here */
-    proxy_create_comarea(pconf);
+    proxy_create_comarea(pconf, sconf->slotmem_loc);
 
     /* Also fill the comarea of the health-checker */
     proxy_checkstorage_add_workers(pconf, s);

Modified: httpd/httpd/branches/httpd-proxy-scoreboard/modules/proxy/mod_proxy.h
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/httpd-proxy-scoreboard/modules/proxy/mod_proxy.h?rev=426845&r1=426844&r2=426845&view=diff
==============================================================================
--- httpd/httpd/branches/httpd-proxy-scoreboard/modules/proxy/mod_proxy.h (original)
+++ httpd/httpd/branches/httpd-proxy-scoreboard/modules/proxy/mod_proxy.h Sat Jul 29 15:24:00
2006
@@ -186,6 +186,7 @@
         status_full
     } proxy_status;             /* Status display options */
     char proxy_status_set;
+    char *slotmem_loc;
     apr_pool_t *pool;           /* Pool used for allocating this struct */
 } proxy_server_conf;
 
@@ -446,7 +447,7 @@
 
 /* proxy_util.c */
 
-PROXY_DECLARE(void) proxy_create_comarea(apr_pool_t *pconf);
+PROXY_DECLARE(void) proxy_create_comarea(apr_pool_t *pconf, char *name);
 PROXY_DECLARE(void) proxy_checkstorage_add_workers(apr_pool_t *pconf, server_rec *s);
 PROXY_DECLARE(void) proxy_lookup_storage_provider();
 

Modified: httpd/httpd/branches/httpd-proxy-scoreboard/modules/proxy/proxy_util.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/httpd-proxy-scoreboard/modules/proxy/proxy_util.c?rev=426845&r1=426844&r2=426845&view=diff
==============================================================================
--- httpd/httpd/branches/httpd-proxy-scoreboard/modules/proxy/proxy_util.c (original)
+++ httpd/httpd/branches/httpd-proxy-scoreboard/modules/proxy/proxy_util.c Sat Jul 29 15:24:00
2006
@@ -1634,6 +1634,8 @@
     ap_slotmem_t *myscore;
     apr_status_t rv;
     apr_size_t item_size = sizeof(proxy_worker_stat);
+    proxy_server_conf *sconf = ap_get_module_config(s->module_config,
+                                                    &proxy_module);
 
     if (worker->s && PROXY_WORKER_IS_INITIALIZED(worker)) {
         /* The worker share is already initialized */
@@ -1651,7 +1653,7 @@
     /* Use storage provider when a storage is existing */
     if (storage) {
 
-        rv = storage->ap_slotmem_create(&myscore, "proxy/comarea", item_size, ap_proxy_lb_workers(),
conf->pool);
+        rv = storage->ap_slotmem_create(&myscore, sconf->slotmem_loc, item_size,
ap_proxy_lb_workers(), conf->pool);
         if (rv == APR_SUCCESS)
             rv = storage->ap_slotmem_mem(myscore, worker->id, &score);
         if (rv != APR_SUCCESS)
@@ -2230,14 +2232,14 @@
 }
 
 /* Create shared area (comarea) called from mod_proxy post_config */
-PROXY_DECLARE(void) proxy_create_comarea(apr_pool_t *pconf)
+PROXY_DECLARE(void) proxy_create_comarea(apr_pool_t *pconf, char *name)
 {
     ap_slotmem_t *myscore;
     apr_size_t item_size = sizeof(proxy_worker_stat);
     if (checkstorage)
         item_size = checkstorage->getentrysize();
     if (storage)
-        storage->ap_slotmem_create(&myscore, "proxy/comarea", item_size, ap_proxy_lb_workers(),
pconf);
+        storage->ap_slotmem_create(&myscore, name, item_size, ap_proxy_lb_workers(),
pconf);
 }
 /* get the storage provider for the shared area called from mod_proxy pre_config */
 PROXY_DECLARE(void) proxy_lookup_storage_provider()



Mime
View raw message