Author: jfrederic.clere(a)jboss.com
Date: 2008-05-22 04:56:38 -0400 (Thu, 22 May 2008)
New Revision: 1610
Added:
trunk/mod_cluster/native/include/mod_clustersize.h
Modified:
trunk/mod_cluster/native/include/balancer.h
trunk/mod_cluster/native/include/context.h
trunk/mod_cluster/native/include/host.h
trunk/mod_cluster/native/include/node.h
Log:
Use defines for size.
Modified: trunk/mod_cluster/native/include/balancer.h
===================================================================
--- trunk/mod_cluster/native/include/balancer.h 2008-05-16 14:42:22 UTC (rev 1609)
+++ trunk/mod_cluster/native/include/balancer.h 2008-05-22 08:56:38 UTC (rev 1610)
@@ -44,12 +44,14 @@
#define MEM_T
#endif
+#include "mod_clustersize.h"
+
/* status of the balancer as read/store in httpd. */
struct balancerinfo {
- char balancer[40]; /* Name of the balancer */
+ char balancer[BALANCERSZ]; /* Name of the balancer */
int StickySession; /* 0 : Don't use, 1: Use it */
- char StickySessionCookie[30];
- char StickySessionPath[30];
+ char StickySessionCookie[COOKNAMESZ];
+ char StickySessionPath[PATHNAMESZ];
int StickySessionRemove; /* 0 : Don't remove, 1: Remove it */
int StickySessionForce; /* 0: Don't force, 1: return error */
int Timeout;
Modified: trunk/mod_cluster/native/include/context.h
===================================================================
--- trunk/mod_cluster/native/include/context.h 2008-05-16 14:42:22 UTC (rev 1609)
+++ trunk/mod_cluster/native/include/context.h 2008-05-22 08:56:38 UTC (rev 1610)
@@ -50,9 +50,11 @@
#define STOPPED 3
#define REMOVE 4 /* That status not stored but used by the logic to remove the entry
*/
+#include "mod_clustersize.h"
+
/* status of the context as read/store in httpd. */
struct contextinfo {
- char context[40]; /* Context where the application is mapped. */
+ char context[CONTEXTSZ]; /* Context where the application is mapped. */
int vhost; /* id of the correspond virtual host in hosts table */
int node; /* id of the correspond node in nodes table */
int status; /* status: ENABLED/DISABLED/STOPPED */
Modified: trunk/mod_cluster/native/include/host.h
===================================================================
--- trunk/mod_cluster/native/include/host.h 2008-05-16 14:42:22 UTC (rev 1609)
+++ trunk/mod_cluster/native/include/host.h 2008-05-22 08:56:38 UTC (rev 1610)
@@ -44,11 +44,13 @@
#define MEM_T
#endif
+#include "mod_clustersize.h"
+
/* status of the host as read/store in httpd. */
struct hostinfo {
- char host[40]; /* Alias element of the virtual host */
- int vhost; /* id of the correspond virtual host */
- int node; /* id of the node containing the virtual host */
+ char host[HOSTALIASZ]; /* Alias element of the virtual host */
+ int vhost; /* id of the correspond virtual host */
+ int node; /* id of the node containing the virtual host */
unsigned long updatetime; /* time of last received message */
int id; /* id in table */
Added: trunk/mod_cluster/native/include/mod_clustersize.h
===================================================================
--- trunk/mod_cluster/native/include/mod_clustersize.h (rev 0)
+++ trunk/mod_cluster/native/include/mod_clustersize.h 2008-05-22 08:56:38 UTC (rev 1610)
@@ -0,0 +1,48 @@
+/*
+ * mod_cluster
+ *
+ * Copyright(c) 2008 Red Hat Middleware, LLC,
+ * and individual contributors as indicated by the @authors tag.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library in the file COPYING.LIB;
+ * if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ *
+ * @author Jean-Frederic Clere
+ * @version $Revision$
+ */
+#ifndef MOD_CLUSTERSIZE_H
+#define MOD_CLUSTERSIZE_H
+
+/* For host.h */
+#define HOSTALIASZ 40
+
+/* For context.h */
+#define CONTEXTSZ 40
+
+/* For node.h */
+#define BALANCERSZ 40
+#define JVMROUTESZ 80
+#define DOMAINNDSZ 20
+#define HOSTNODESZ 64
+#define PORTNODESZ 7
+#define SCHEMENDSZ 6
+
+/* For balancer.h */
+#define COOKNAMESZ 30
+#define PATHNAMESZ 30
+
+#endif /* MOD_CLUSTERSIZE_H */
Modified: trunk/mod_cluster/native/include/node.h
===================================================================
--- trunk/mod_cluster/native/include/node.h 2008-05-16 14:42:22 UTC (rev 1609)
+++ trunk/mod_cluster/native/include/node.h 2008-05-22 08:56:38 UTC (rev 1610)
@@ -44,14 +44,16 @@
#define MEM_T
#endif
+#include "mod_clustersize.h"
+
/* configuration of the node received from jboss cluster. */
struct nodemess {
- char balancer[40]; /* name of the balancer */
- char JVMRoute[20];
- char Domain[20];
- char Host[64];
- char Port[7];
- char Type[6];
+ char balancer[BALANCERSZ]; /* name of the balancer */
+ char JVMRoute[JVMROUTESZ];
+ char Domain[DOMAINNDSZ];
+ char Host[HOSTNODESZ];
+ char Port[PORTNODESZ];
+ char Type[SCHEMENDSZ];
int reversed; /* 1 : reversed... 0 : normal */
/* node conf part */
@@ -61,8 +63,6 @@
int smax;
int ttl;
- char strtime[8]; /* date when send by the node */
-
/* part updated in httpd */
int id; /* id in table and worker id */
};
Show replies by date