Author: jfrederic.clere(a)jboss.com
Date: 2008-06-16 13:21:34 -0400 (Mon, 16 Jun 2008)
New Revision: 1702
Modified:
trunk/mod_cluster/native/mod_manager/mod_manager.c
Log:
Start additing info stuff.
Modified: trunk/mod_cluster/native/mod_manager/mod_manager.c
===================================================================
--- trunk/mod_cluster/native/mod_manager/mod_manager.c 2008-06-16 14:33:38 UTC (rev 1701)
+++ trunk/mod_cluster/native/mod_manager/mod_manager.c 2008-06-16 17:21:34 UTC (rev 1702)
@@ -711,7 +711,35 @@
}
return NULL;
}
+/*
+ * Process a INFO command.
+ * Statics informations ;-)
+ */
+static char * process_info(request_rec *r, char *buff, int *errtype)
+{
+ int size, i;
+ int *id;
+ ap_set_content_type(r, "text/plain");
+
+ size = get_max_size_node(nodestatsmem);
+ id = apr_palloc(r->pool, sizeof(int) * size);
+ size = get_ids_used_node(nodestatsmem, id);
+ for (i=0; i<size; i++) {
+ nodeinfo_t *ou;
+ proxy_worker_stat *proxystat;
+ get_node(nodestatsmem, &ou, id[i]);
+ ap_rprintf(r, "node: [%d:%d] JVMRoute: %s Domain: [%s] Host: %s Port: %s
Type: %s\n",
+ id[i], ou->mess.id, ou->mess.JVMRoute, ou->mess.Domain,
+ ou->mess.Host, ou->mess.Port, ou->mess.Type);
+ proxystat = (proxy_worker_stat *) ou->stat;
+ ap_rprintf(r, " [%d:%d] status: %d elected: %d lbstatus: %d lbfactor:
%d lbset: %d\n",
+ id[i], ou->mess.id, proxystat->status, proxystat->elected,
proxystat->lbstatus, proxystat->lbfactor, proxystat->lbset);
+
+ }
+ return NULL;
+}
+
/* Process a *-APP command that applies to the node */
static char * process_node_cmd(request_rec *r, int status, int *errtype, nodeinfo_t
*node)
{
@@ -1031,6 +1059,8 @@
ours = 1;
else if (strcasecmp(r->method, "ERROR") == 0)
ours = 1;
+ else if (strcasecmp(r->method, "INFO") == 0)
+ ours = 1;
if (ours) {
/* The method one of ours */
r->handler = "mod-cluster";
@@ -1091,6 +1121,8 @@
errstring = process_status(r, buff, &errtype);
else if (strcasecmp(r->method, "DUMP") == 0)
errstring = process_dump(r, buff, &errtype);
+ else if (strcasecmp(r->method, "INFO") == 0)
+ errstring = process_info(r, buff, &errtype);
else {
errstring = SCMDUNS;
errtype = TYPESYNTAX;
Show replies by date