Author: jfrederic.clere(a)jboss.com
Date: 2008-06-09 08:25:25 -0400 (Mon, 09 Jun 2008)
New Revision: 1677
Modified:
trunk/mod_cluster/native/mod_manager/mod_manager.c
Log:
Fix the C++ warnings when using -Wall -pedantic
Modified: trunk/mod_cluster/native/mod_manager/mod_manager.c
===================================================================
--- trunk/mod_cluster/native/mod_manager/mod_manager.c 2008-06-09 11:16:05 UTC (rev 1676)
+++ trunk/mod_cluster/native/mod_manager/mod_manager.c 2008-06-09 12:25:25 UTC (rev 1677)
@@ -449,16 +449,14 @@
nodeinfo_t nodeinfo;
balancerinfo_t balancerinfo;
int mpm_threads;
- char *JVMRoute;
- char *Domain;
- char *Host;
- char *Port;
- char *Type;
- /* XXX node conf */
struct cluster_host *vhost;
struct cluster_host *phost;
+ int i = 0;
+ int id;
+ int vid = 1; /* zero and "" is empty */
+
char **ptr = process_buff(r, buff);
if (ptr == NULL) {
*errtype = TYPESYNTAX;
@@ -497,7 +495,6 @@
balancerinfo.Maxattempts = 1;
balancerinfo.Timeout = 0;
- int i = 0;
while (ptr[i]) {
/* XXX: balancer part */
if (strcasecmp(ptr[i], "Balancer") == 0) {
@@ -639,7 +636,6 @@
}
/* Insert or update node description */
- int id;
if (insert_update_node(nodestatsmem, &nodeinfo, &id) != APR_SUCCESS) {
*errtype = TYPEMEM;
return MNODEUI;
@@ -649,7 +645,6 @@
phost = vhost;
if (phost->host == NULL && phost->context == NULL)
return NULL; /* Alias and Context missing */
- int vid = 1; /* zero and "" is empty */
while (phost) {
insert_update_hosts(hoststatsmem, phost->host, id, vid);
insert_update_contexts(contextstatsmem, phost->context, id, vid, STOPPED);
@@ -730,12 +725,15 @@
size = get_ids_used_host(hoststatsmem, id);
for (i=0; i<size; i++) {
hostinfo_t *ou;
+ int sizecontext;
+ int *idcontext;
+
get_host(hoststatsmem, &ou, id[i]);
if (ou->node != node->mess.id)
continue;
/* If the host corresponds to a node process all contextes */
- int sizecontext = get_max_size_context(contextstatsmem);
- int *idcontext = apr_palloc(r->pool, sizeof(int) * sizecontext);
+ sizecontext = get_max_size_context(contextstatsmem);
+ idcontext = apr_palloc(r->pool, sizeof(int) * sizecontext);
sizecontext = get_ids_used_context(contextstatsmem, idcontext);
for (j=0; j<sizecontext; j++) {
contextinfo_t *context;
@@ -769,11 +767,15 @@
/* Process an enable/disable/stop/remove application message */
static char * process_appl_cmd(request_rec *r, char *buff, int status, int *errtype)
{
- char *JVMRoute;
nodeinfo_t nodeinfo;
nodeinfo_t *node;
struct cluster_host *vhost;
+ int i = 0;
+ hostinfo_t hostinfo;
+ hostinfo_t *host;
+
+
char **ptr = process_buff(r, buff);
if (ptr == NULL) {
*errtype = TYPESYNTAX;
@@ -786,7 +788,6 @@
vhost->context = NULL;
vhost->next = NULL;
- int i = 0;
while (ptr[i]) {
if (strcasecmp(ptr[i], "JVMRoute") == 0) {
if (strlen(ptr[i+1])>=sizeof(nodeinfo.mess.JVMRoute)) {
@@ -840,9 +841,6 @@
}
/* Read the ID of the virtual corresponding to the first Alias */
- hostinfo_t hostinfo;
- hostinfo_t *host;
-
hostinfo.node = node->mess.id;
if (vhost->host != NULL)
strcpy(hostinfo.host, vhost->host);
@@ -852,11 +850,11 @@
hostinfo.id = 0;
host = read_host(hoststatsmem, &hostinfo);
if (host == NULL) {
+ int vid = 1; /* XXX: That is not really the right value, but that works most time
*/
/* 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, vhost->host, node->mess.id, vid);
hostinfo.id = 0;
if (vhost->host != NULL)
@@ -928,16 +926,18 @@
*/
static char * process_status(request_rec *r, char *buff, int *errtype)
{
- int Load;
+ int Load = -1;
nodeinfo_t nodeinfo;
nodeinfo_t *node;
+
+ int i = 0;
+
char **ptr = process_buff(r, buff);
if (ptr == NULL) {
*errtype = TYPESYNTAX;
return SMESPAR;
}
- int i = 0;
while (ptr[i]) {
if (strcasecmp(ptr[i], "JVMRoute") == 0) {
if (strlen(ptr[i+1])>=sizeof(nodeinfo.mess.JVMRoute)) {
@@ -1143,7 +1143,7 @@
node = "manager.node";
context = "manager.context";
host = "manager.host";
- host = "manager.balancer";
+ balancer = "manager.balancer";
}
nodestatsmem = get_mem_node(node, &mconf->maxnode, p, storage);