Author: jfrederic.clere(a)jboss.com
Date: 2008-05-26 12:22:33 -0400 (Mon, 26 May 2008)
New Revision: 1619
Modified:
trunk/mod_cluster/native/mod_manager/mod_manager.c
Log:
Arrange the remove logic.
Modified: trunk/mod_cluster/native/mod_manager/mod_manager.c
===================================================================
--- trunk/mod_cluster/native/mod_manager/mod_manager.c 2008-05-26 15:10:16 UTC (rev 1618)
+++ trunk/mod_cluster/native/mod_manager/mod_manager.c 2008-05-26 16:22:33 UTC (rev 1619)
@@ -316,6 +316,7 @@
}
/*
* Insert the context from Context information
+ * Note that if status is REMOVE remove_context will be called.
*/
static int insert_update_contexts(mem_t *mem, char *str, int node, int vhost, int
status)
{
@@ -336,7 +337,11 @@
if (*ptr == ',') {
*ptr = '\0';
strncpy(info.context, previous, sizeof(info.context));
- insert_update_context(mem, &info);
+ if (status != REMOVE)
+ insert_update_context(mem, &info);
+ else
+ remove_context(mem, &info);
+
if (!ret)
ret = info.id;
previous = ptr + 1;
@@ -632,6 +637,9 @@
hostinfo.id = 0;
host = read_host(hoststatsmem, &hostinfo);
if (host == NULL) {
+ /* If REMOVE ignores it */
+ if (status == REMOVE)
+ return NULL;
/* If the Host doesn't exist yet create it */
int vid = 1; /* XXX: That is not really the right value, but that works most time
*/
insert_update_hosts(hoststatsmem, phost->host, node->mess.id, vid);