Author: jfrederic.clere(a)jboss.com
Date: 2008-04-23 07:43:57 -0400 (Wed, 23 Apr 2008)
New Revision: 1558
Modified:
sandbox/httpd/src/native/common/node.c
Log:
Don't overwrite the mod_proxy_cluster part of the information.
Modified: sandbox/httpd/src/native/common/node.c
===================================================================
--- sandbox/httpd/src/native/common/node.c 2008-04-23 11:41:41 UTC (rev 1557)
+++ sandbox/httpd/src/native/common/node.c 2008-04-23 11:43:57 UTC (rev 1558)
@@ -88,9 +88,18 @@
nodeinfo_t *in = (nodeinfo_t *)*data;
nodeinfo_t *ou = (nodeinfo_t *)mem;
if (strcmp(in->mess.JVMRoute, ou->mess.JVMRoute) == 0) {
- memcpy(ou, in, sizeof(nodeinfo_t));
+ /*
+ * The node information is made of several pieces:
+ * Information from the cluster (nodemess_t).
+ * updatetime (time of last received message).
+ * balancer (provided by httpd).
+ * offset (of the area shared with the proxy logic).
+ * stat (shared area with the proxy logic we shouldn't modify it here).
+ */
+ memcpy(ou, in, sizeof(nodemess_t));
ou->mess.id = id;
ou->updatetime = (unsigned long) apr_time_sec(apr_time_now());
+ memcpy(ou->balancer, in->balancer, sizeof(ou->balancer));
ou->offset = sizeof(nodemess_t) + sizeof(unsigned long) +
sizeof(ou->balancer) + sizeof(int);
*data = ou;
return APR_SUCCESS;
@@ -123,6 +132,9 @@
/* set of offset to the proxy_worker_stat */
ou->offset = sizeof(nodemess_t) + sizeof(unsigned long) + sizeof(ou->balancer)
+ sizeof(int);
+ /* blank the proxy status information */
+ memset(ou->stat, '\0', SIZEOFSCORE);
+
return APR_SUCCESS;
}
Show replies by date