Author: jfrederic.clere(a)jboss.com
Date: 2008-09-18 12:25:08 -0400 (Thu, 18 Sep 2008)
New Revision: 1867
Modified:
trunk/mod_cluster/native/mod_manager/mod_manager.c
Log:
Add directive to make the persistent switchable.
Modified: trunk/mod_cluster/native/mod_manager/mod_manager.c
===================================================================
--- trunk/mod_cluster/native/mod_manager/mod_manager.c 2008-09-18 14:27:12 UTC (rev 1866)
+++ trunk/mod_cluster/native/mod_manager/mod_manager.c 2008-09-18 16:25:08 UTC (rev 1867)
@@ -106,6 +106,9 @@
/* last time the node update logic was called */
apr_time_t last_updated;
+ /* Should be the slotmem persisted (1) or not (0) */
+ int persistent;
+
} mod_manager_config;
/*
@@ -286,6 +289,7 @@
/* Get a provider to handle the shared memory */
storage = ap_lookup_provider(SLOTMEM_STORAGE, "shared", "0");
+ // storage->persistent = 0;
if (storage == NULL) {
ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_EMERG, 0, s,
"ap_lookup_provider %s failed", SLOTMEM_STORAGE);
return !OK;
@@ -1256,6 +1260,20 @@
/* XXX: create the entry in the shared balancer table */
return NULL;
}
+static const char*cmd_manager_pers(cmd_parms *cmd, void *dummy, const char *arg)
+{
+ mod_manager_config *mconf = ap_get_module_config(cmd->server->module_config,
&manager_module);
+ if (strcasecmp(arg, "Off") == 0)
+ mconf->persistent = 0;
+ else if (strcasecmp(arg, "On") == 0)
+ mconf->persistent = 1;
+ else {
+ return "PersistSlots must be one of: "
+ "off | on";
+ }
+ return NULL;
+}
+
static const command_rec manager_cmds[] =
{
AP_INIT_TAKE1(
@@ -1293,6 +1311,13 @@
OR_ALL,
"ManagerBalancerName - name of a balancer corresponding to the
manager"
),
+ AP_INIT_TAKE1(
+ "PersistSlots",
+ cmd_manager_pers,
+ NULL,
+ OR_ALL,
+ "PersistSlots - Persist the slot mem elements on | off (Default: off No
persistence)"
+ ),
{NULL}
};
@@ -1334,6 +1359,7 @@
mconf->maxnode = DEFMAXNODE;
mconf->maxhost = DEFMAXHOST;
mconf->last_updated = 0;
+ mconf->persistent = 0;
return mconf;
}
@@ -1352,6 +1378,7 @@
mconf->maxcontext = DEFMAXCONTEXT;
mconf->maxnode = DEFMAXNODE;
mconf->last_updated = 0;
+ mconf->persistent = 0;
if (mconf2->basefilename)
mconf->basefilename = apr_pstrdup(p, mconf2->basefilename);
@@ -1373,6 +1400,11 @@
else if (mconf1->maxhost != DEFMAXHOST)
mconf->maxhost = mconf1->maxhost;
+ if (mconf2->persistent != 0)
+ mconf->persistent = mconf2->persistent;
+ else if (mconf1->persistent != 0)
+ mconf->persistent = mconf1->persistent;
+
return mconf;
}
Show replies by date