JBoss Native SVN: r1652 - trunk/mod_cluster/native/mod_proxy_cluster.
by jbossnative-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2008-06-03 16:34:37 -0400 (Tue, 03 Jun 2008)
New Revision: 1652
Modified:
trunk/mod_cluster/native/mod_proxy_cluster/mod_proxy_cluster.c
Log:
Don't use scpool if it is not here.
Modified: trunk/mod_cluster/native/mod_proxy_cluster/mod_proxy_cluster.c
===================================================================
--- trunk/mod_cluster/native/mod_proxy_cluster/mod_proxy_cluster.c 2008-06-03 15:23:05 UTC (rev 1651)
+++ trunk/mod_cluster/native/mod_proxy_cluster/mod_proxy_cluster.c 2008-06-03 20:34:37 UTC (rev 1652)
@@ -294,11 +294,13 @@
* struct like hostname and addr (at least in the case where we have
* keepalive connections that timed out).
*/
+#if AP_MODULE_MAGIC_AT_LEAST(20051115,13)
apr_pool_create(&scpool, ctx);
apr_pool_tag(scpool, "proxy_conn_scpool");
+ conn->scpool = scpool;
+#endif
conn->pool = ctx;
- conn->scpool = scpool;
conn->worker = worker;
#if APR_HAS_THREADS
conn->inreslist = 1;
16 years, 6 months
JBoss Native SVN: r1651 - trunk/mod_cluster/native/mod_manager.
by jbossnative-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2008-06-03 11:23:05 -0400 (Tue, 03 Jun 2008)
New Revision: 1651
Modified:
trunk/mod_cluster/native/mod_manager/balancer.c
trunk/mod_cluster/native/mod_manager/context.c
trunk/mod_cluster/native/mod_manager/host.c
trunk/mod_cluster/native/mod_manager/node.c
Log:
Remove the useless APR_DECLARE().
--this line, and those below, will be ignored--
M mod_manager/context.c
M mod_manager/node.c
M mod_manager/balancer.c
M mod_manager/host.c
Modified: trunk/mod_cluster/native/mod_manager/balancer.c
===================================================================
--- trunk/mod_cluster/native/mod_manager/balancer.c 2008-06-03 14:59:57 UTC (rev 1650)
+++ trunk/mod_cluster/native/mod_manager/balancer.c 2008-06-03 15:23:05 UTC (rev 1651)
@@ -133,7 +133,7 @@
}
return APR_NOTFOUND;
}
-APR_DECLARE(balancerinfo_t *) read_balancer(mem_t *s, balancerinfo_t *balancer)
+balancerinfo_t * read_balancer(mem_t *s, balancerinfo_t *balancer)
{
apr_status_t rv;
balancerinfo_t *ou = balancer;
@@ -154,7 +154,7 @@
* @param ids in the balancer table.
* @return APR_SUCCESS if all went well
*/
-APR_DECLARE(apr_status_t) get_balancer(mem_t *s, balancerinfo_t **balancer, int ids)
+apr_status_t get_balancer(mem_t *s, balancerinfo_t **balancer, int ids)
{
return(s->storage->ap_slotmem_mem(s->slotmem, ids, (void **) balancer));
}
@@ -165,7 +165,7 @@
* @param balancer balancer to remove from the shared table.
* @return APR_SUCCESS if all went well
*/
-APR_DECLARE(apr_status_t) remove_balancer(mem_t *s, balancerinfo_t *balancer)
+apr_status_t remove_balancer(mem_t *s, balancerinfo_t *balancer)
{
apr_status_t rv;
balancerinfo_t *ou = balancer;
@@ -186,7 +186,7 @@
* @param ids array of int to store the used id (must be big enough).
* @return number of balancer existing or -1 if error.
*/
-APR_DECLARE(int) get_ids_used_balancer(mem_t *s, int *ids)
+int get_ids_used_balancer(mem_t *s, int *ids)
{
return (s->storage->ap_slotmem_get_used(s->slotmem, ids));
}
@@ -196,7 +196,7 @@
* @param pointer to the shared table.
* @return number of balancer existing or -1 if error.
*/
-APR_DECLARE(int) get_max_size_balancer(mem_t *s)
+int get_max_size_balancer(mem_t *s)
{
return (s->storage->ap_slotmem_get_max_size(s->slotmem));
}
Modified: trunk/mod_cluster/native/mod_manager/context.c
===================================================================
--- trunk/mod_cluster/native/mod_manager/context.c 2008-06-03 14:59:57 UTC (rev 1650)
+++ trunk/mod_cluster/native/mod_manager/context.c 2008-06-03 15:23:05 UTC (rev 1651)
@@ -134,7 +134,7 @@
}
return APR_NOTFOUND;
}
-APR_DECLARE(contextinfo_t *) read_context(mem_t *s, contextinfo_t *context)
+contextinfo_t * read_context(mem_t *s, contextinfo_t *context)
{
apr_status_t rv;
contextinfo_t *ou = context;
@@ -155,7 +155,7 @@
* @param ids in the context table.
* @return APR_SUCCESS if all went well
*/
-APR_DECLARE(apr_status_t) get_context(mem_t *s, contextinfo_t **context, int ids)
+apr_status_t get_context(mem_t *s, contextinfo_t **context, int ids)
{
return(s->storage->ap_slotmem_mem(s->slotmem, ids, (void **) context));
}
@@ -166,7 +166,7 @@
* @param context context to remove from the shared table.
* @return APR_SUCCESS if all went well
*/
-APR_DECLARE(apr_status_t) remove_context(mem_t *s, contextinfo_t *context)
+apr_status_t remove_context(mem_t *s, contextinfo_t *context)
{
apr_status_t rv;
contextinfo_t *ou = context;
@@ -187,7 +187,7 @@
* @param ids array of int to store the used id (must be big enough).
* @return number of context existing or -1 if error.
*/
-APR_DECLARE(int) get_ids_used_context(mem_t *s, int *ids)
+int get_ids_used_context(mem_t *s, int *ids)
{
return (s->storage->ap_slotmem_get_used(s->slotmem, ids));
}
@@ -197,7 +197,7 @@
* @param pointer to the shared table.
* @return number of context existing or -1 if error.
*/
-APR_DECLARE(int) get_max_size_context(mem_t *s)
+int get_max_size_context(mem_t *s)
{
return (s->storage->ap_slotmem_get_max_size(s->slotmem));
}
Modified: trunk/mod_cluster/native/mod_manager/host.c
===================================================================
--- trunk/mod_cluster/native/mod_manager/host.c 2008-06-03 14:59:57 UTC (rev 1650)
+++ trunk/mod_cluster/native/mod_manager/host.c 2008-06-03 15:23:05 UTC (rev 1651)
@@ -133,7 +133,7 @@
}
return APR_NOTFOUND;
}
-APR_DECLARE(hostinfo_t *) read_host(mem_t *s, hostinfo_t *host)
+hostinfo_t * read_host(mem_t *s, hostinfo_t *host)
{
apr_status_t rv;
hostinfo_t *ou = host;
@@ -154,7 +154,7 @@
* @param ids in the host table.
* @return APR_SUCCESS if all went well
*/
-APR_DECLARE(apr_status_t) get_host(mem_t *s, hostinfo_t **host, int ids)
+apr_status_t get_host(mem_t *s, hostinfo_t **host, int ids)
{
return(s->storage->ap_slotmem_mem(s->slotmem, ids, (void **) host));
}
@@ -165,7 +165,7 @@
* @param host host to remove from the shared table.
* @return APR_SUCCESS if all went well
*/
-APR_DECLARE(apr_status_t) remove_host(mem_t *s, hostinfo_t *host)
+apr_status_t remove_host(mem_t *s, hostinfo_t *host)
{
apr_status_t rv;
hostinfo_t *ou = host;
@@ -186,7 +186,7 @@
* @param ids array of int to store the used id (must be big enough).
* @return number of host existing or -1 if error.
*/
-APR_DECLARE(int) get_ids_used_host(mem_t *s, int *ids)
+int get_ids_used_host(mem_t *s, int *ids)
{
return (s->storage->ap_slotmem_get_used(s->slotmem, ids));
}
@@ -196,7 +196,7 @@
* @param pointer to the shared table.
* @return number of host existing or -1 if error.
*/
-APR_DECLARE(int) get_max_size_host(mem_t *s)
+int get_max_size_host(mem_t *s)
{
return (s->storage->ap_slotmem_get_max_size(s->slotmem));
}
Modified: trunk/mod_cluster/native/mod_manager/node.c
===================================================================
--- trunk/mod_cluster/native/mod_manager/node.c 2008-06-03 14:59:57 UTC (rev 1650)
+++ trunk/mod_cluster/native/mod_manager/node.c 2008-06-03 15:23:05 UTC (rev 1651)
@@ -148,7 +148,7 @@
}
return APR_NOTFOUND;
}
-APR_DECLARE(nodeinfo_t *) read_node(mem_t *s, nodeinfo_t *node)
+nodeinfo_t * read_node(mem_t *s, nodeinfo_t *node)
{
apr_status_t rv;
nodeinfo_t *ou = node;
@@ -169,7 +169,7 @@
* @param ids in the node table.
* @return APR_SUCCESS if all went well
*/
-APR_DECLARE(apr_status_t) get_node(mem_t *s, nodeinfo_t **node, int ids)
+apr_status_t get_node(mem_t *s, nodeinfo_t **node, int ids)
{
return(s->storage->ap_slotmem_mem(s->slotmem, ids, (void **) node));
}
@@ -180,7 +180,7 @@
* @param node node to remove from the shared table.
* @return APR_SUCCESS if all went well
*/
-APR_DECLARE(apr_status_t) remove_node(mem_t *s, nodeinfo_t *node)
+apr_status_t remove_node(mem_t *s, nodeinfo_t *node)
{
apr_status_t rv;
nodeinfo_t *ou = node;
@@ -201,7 +201,7 @@
* @param ids array of int to store the used id (must be big enough).
* @return number of node existing or -1 if error.
*/
-APR_DECLARE(int) get_ids_used_node(mem_t *s, int *ids)
+int get_ids_used_node(mem_t *s, int *ids)
{
return (s->storage->ap_slotmem_get_used(s->slotmem, ids));
}
@@ -211,7 +211,7 @@
* @param pointer to the shared table.
* @return number of node existing or -1 if error.
*/
-APR_DECLARE(int) get_max_size_node(mem_t *s)
+int get_max_size_node(mem_t *s)
{
return (s->storage->ap_slotmem_get_max_size(s->slotmem));
}
16 years, 6 months
JBoss Native SVN: r1650 - trunk/mod_cluster/native/include.
by jbossnative-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2008-06-03 10:59:57 -0400 (Tue, 03 Jun 2008)
New Revision: 1650
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/mod_proxy_cluster.h
trunk/mod_cluster/native/include/node.h
trunk/mod_cluster/native/include/slotmem.h
Log:
remove the useless APR_DECLARE().
Modified: trunk/mod_cluster/native/include/balancer.h
===================================================================
--- trunk/mod_cluster/native/include/balancer.h 2008-06-03 13:19:34 UTC (rev 1649)
+++ trunk/mod_cluster/native/include/balancer.h 2008-06-03 14:59:57 UTC (rev 1650)
@@ -70,7 +70,7 @@
* @return APR_SUCCESS if all went well
*
*/
-APR_DECLARE(apr_status_t) insert_update_balancer(mem_t *s, balancerinfo_t *balancer);
+apr_status_t insert_update_balancer(mem_t *s, balancerinfo_t *balancer);
/**
* read a balancer record from the shared table
@@ -78,7 +78,7 @@
* @param balancer balancer to read from the shared table.
* @return address of the read balancer or NULL if error.
*/
-APR_DECLARE(balancerinfo_t *) read_balancer(mem_t *s, balancerinfo_t *balancer);
+balancerinfo_t * read_balancer(mem_t *s, balancerinfo_t *balancer);
/**
* get a balancer record from the shared table
@@ -86,7 +86,7 @@
* @param balancer address of the balancer read from the shared table.
* @return APR_SUCCESS if all went well
*/
-APR_DECLARE(apr_status_t) get_balancer(mem_t *s, balancerinfo_t **balancer, int ids);
+apr_status_t get_balancer(mem_t *s, balancerinfo_t **balancer, int ids);
/**
* remove(free) a balancer record from the shared table
@@ -94,7 +94,7 @@
* @param balancer balancer to remove from the shared table.
* @return APR_SUCCESS if all went well
*/
-APR_DECLARE(apr_status_t) remove_balancer(mem_t *s, balancerinfo_t *balancer);
+apr_status_t remove_balancer(mem_t *s, balancerinfo_t *balancer);
/*
* get the ids for the used (not free) balancers in the table
@@ -102,14 +102,14 @@
* @param ids array of int to store the used id (must be big enough).
* @return number of balancer existing or -1 if error.
*/
-APR_DECLARE(int) get_ids_used_balancer(mem_t *s, int *ids);
+int get_ids_used_balancer(mem_t *s, int *ids);
/*
* get the size of the table (max size).
* @param pointer to the shared table.
* @return size of the existing table or -1 if error.
*/
-APR_DECLARE(int) get_max_size_balancer(mem_t *s);
+int get_max_size_balancer(mem_t *s);
/**
* attach to the shared balancer table
@@ -118,7 +118,7 @@
* @param p pool to use for allocations.
* @return address of struct used to access the table.
*/
-APR_DECLARE(mem_t *) get_mem_balancer(char *string, int *num, apr_pool_t *p, slotmem_storage_method *storage);
+mem_t * get_mem_balancer(char *string, int *num, apr_pool_t *p, slotmem_storage_method *storage);
/**
* create a shared balancer table
* @param name to use to create the table.
@@ -126,7 +126,7 @@
* @param p pool to use for allocations.
* @return address of struct used to access the table.
*/
-APR_DECLARE(mem_t *) create_mem_balancer(char *string, int *num, apr_pool_t *p, slotmem_storage_method *storage);
+mem_t * create_mem_balancer(char *string, int *num, apr_pool_t *p, slotmem_storage_method *storage);
/**
* provider for the mod_proxy_cluster or mod_jk modules.
@@ -138,16 +138,16 @@
* @param balancer address of pointer to return the balancer.
* @return APR_SUCCESS if all went well
*/
-APR_DECLARE(apr_status_t) (* read_balancer)(int ids, balancerinfo_t **balancer);
+apr_status_t (* read_balancer)(int ids, balancerinfo_t **balancer);
/**
* read the list of ident of used balancers.
* @param ids address to store the idents.
* @return APR_SUCCESS if all went well
*/
-APR_DECLARE(int) (* get_ids_used_balancer)(int *ids);
+int (* get_ids_used_balancer)(int *ids);
/**
* read the max number of balancers in the shared table
*/
-APR_DECLARE(int) (*get_max_size_balancer)();
+int (*get_max_size_balancer)();
};
#endif /*BALANCER_H*/
Modified: trunk/mod_cluster/native/include/context.h
===================================================================
--- trunk/mod_cluster/native/include/context.h 2008-06-03 13:19:34 UTC (rev 1649)
+++ trunk/mod_cluster/native/include/context.h 2008-06-03 14:59:57 UTC (rev 1650)
@@ -72,7 +72,7 @@
* @return APR_SUCCESS if all went well
*
*/
-APR_DECLARE(apr_status_t) insert_update_context(mem_t *s, contextinfo_t *context);
+apr_status_t insert_update_context(mem_t *s, contextinfo_t *context);
/**
* read a context record from the shared table
@@ -80,7 +80,7 @@
* @param context context to read from the shared table.
* @return address of the read context or NULL if error.
*/
-APR_DECLARE(contextinfo_t *) read_context(mem_t *s, contextinfo_t *context);
+contextinfo_t * read_context(mem_t *s, contextinfo_t *context);
/**
* get a context record from the shared table
@@ -88,7 +88,7 @@
* @param context address of the context read from the shared table.
* @return APR_SUCCESS if all went well
*/
-APR_DECLARE(apr_status_t) get_context(mem_t *s, contextinfo_t **context, int ids);
+apr_status_t get_context(mem_t *s, contextinfo_t **context, int ids);
/**
* remove(free) a context record from the shared table
@@ -96,7 +96,7 @@
* @param context context to remove from the shared table.
* @return APR_SUCCESS if all went well
*/
-APR_DECLARE(apr_status_t) remove_context(mem_t *s, contextinfo_t *context);
+apr_status_t remove_context(mem_t *s, contextinfo_t *context);
/*
* get the ids for the used (not free) contexts in the table
@@ -104,14 +104,14 @@
* @param ids array of int to store the used id (must be big enough).
* @return number of context existing or -1 if error.
*/
-APR_DECLARE(int) get_ids_used_context(mem_t *s, int *ids);
+int get_ids_used_context(mem_t *s, int *ids);
/*
* get the size of the table (max size).
* @param pointer to the shared table.
* @return size of the existing table or -1 if error.
*/
-APR_DECLARE(int) get_max_size_context(mem_t *s);
+int get_max_size_context(mem_t *s);
/**
* attach to the shared context table
@@ -120,7 +120,7 @@
* @param p pool to use for allocations.
* @return address of struct used to access the table.
*/
-APR_DECLARE(mem_t *) get_mem_context(char *string, int *num, apr_pool_t *p, slotmem_storage_method *storage);
+mem_t * get_mem_context(char *string, int *num, apr_pool_t *p, slotmem_storage_method *storage);
/**
* create a shared context table
* @param name to use to create the table.
@@ -128,7 +128,7 @@
* @param p pool to use for allocations.
* @return address of struct used to access the table.
*/
-APR_DECLARE(mem_t *) create_mem_context(char *string, int *num, apr_pool_t *p, slotmem_storage_method *storage);
+mem_t * create_mem_context(char *string, int *num, apr_pool_t *p, slotmem_storage_method *storage);
/**
* provider for the mod_proxy_cluster or mod_jk modules.
@@ -140,16 +140,16 @@
* @param context address of pointer to return the context.
* @return APR_SUCCESS if all went well
*/
-APR_DECLARE(apr_status_t) (* read_context)(int ids, contextinfo_t **context);
+apr_status_t (* read_context)(int ids, contextinfo_t **context);
/**
* read the list of ident of used contexts.
* @param ids address to store the idents.
* @return APR_SUCCESS if all went well
*/
-APR_DECLARE(int) (* get_ids_used_context)(int *ids);
+int (* get_ids_used_context)(int *ids);
/**
* read the max number of contexts in the shared table
*/
-APR_DECLARE(int) (*get_max_size_context)();
+int (*get_max_size_context)();
};
#endif /*CONTEXT_H*/
Modified: trunk/mod_cluster/native/include/host.h
===================================================================
--- trunk/mod_cluster/native/include/host.h 2008-06-03 13:19:34 UTC (rev 1649)
+++ trunk/mod_cluster/native/include/host.h 2008-06-03 14:59:57 UTC (rev 1650)
@@ -65,7 +65,7 @@
* @return APR_SUCCESS if all went well
*
*/
-APR_DECLARE(apr_status_t) insert_update_host(mem_t *s, hostinfo_t *host);
+apr_status_t insert_update_host(mem_t *s, hostinfo_t *host);
/**
* read a host record from the shared table
@@ -73,7 +73,7 @@
* @param host host to read from the shared table.
* @return address of the read host or NULL if error.
*/
-APR_DECLARE(hostinfo_t *) read_host(mem_t *s, hostinfo_t *host);
+hostinfo_t * read_host(mem_t *s, hostinfo_t *host);
/**
* get a host record from the shared table
@@ -81,7 +81,7 @@
* @param host address of the host read from the shared table.
* @return APR_SUCCESS if all went well
*/
-APR_DECLARE(apr_status_t) get_host(mem_t *s, hostinfo_t **host, int ids);
+apr_status_t get_host(mem_t *s, hostinfo_t **host, int ids);
/**
* remove(free) a host record from the shared table
@@ -89,7 +89,7 @@
* @param host host to remove from the shared table.
* @return APR_SUCCESS if all went well
*/
-APR_DECLARE(apr_status_t) remove_host(mem_t *s, hostinfo_t *host);
+apr_status_t remove_host(mem_t *s, hostinfo_t *host);
/*
* get the ids for the used (not free) hosts in the table
@@ -97,14 +97,14 @@
* @param ids array of int to store the used id (must be big enough).
* @return number of host existing or -1 if error.
*/
-APR_DECLARE(int) get_ids_used_host(mem_t *s, int *ids);
+int get_ids_used_host(mem_t *s, int *ids);
/*
* get the size of the table (max size).
* @param pointer to the shared table.
* @return size of the existing table or -1 if error.
*/
-APR_DECLARE(int) get_max_size_host(mem_t *s);
+int get_max_size_host(mem_t *s);
/**
* attach to the shared host table
@@ -113,7 +113,7 @@
* @param p pool to use for allocations.
* @return address of struct used to access the table.
*/
-APR_DECLARE(mem_t *) get_mem_host(char *string, int *num, apr_pool_t *p, slotmem_storage_method *storage);
+mem_t * get_mem_host(char *string, int *num, apr_pool_t *p, slotmem_storage_method *storage);
/**
* create a shared host table
* @param name to use to create the table.
@@ -121,7 +121,7 @@
* @param p pool to use for allocations.
* @return address of struct used to access the table.
*/
-APR_DECLARE(mem_t *) create_mem_host(char *string, int *num, apr_pool_t *p, slotmem_storage_method *storage);
+mem_t * create_mem_host(char *string, int *num, apr_pool_t *p, slotmem_storage_method *storage);
/**
* provider for the mod_proxy_cluster or mod_jk modules.
@@ -133,16 +133,16 @@
* @param host address of pointer to return the host.
* @return APR_SUCCESS if all went well
*/
-APR_DECLARE(apr_status_t) (* read_host)(int ids, hostinfo_t **host);
+apr_status_t (* read_host)(int ids, hostinfo_t **host);
/**
* read the list of ident of used hosts.
* @param ids address to store the idents.
* @return APR_SUCCESS if all went well
*/
-APR_DECLARE(int) (* get_ids_used_host)(int *ids);
+int (* get_ids_used_host)(int *ids);
/**
* read the max number of hosts in the shared table
*/
-APR_DECLARE(int) (*get_max_size_host)();
+int (*get_max_size_host)();
};
#endif /*HOST_H*/
Modified: trunk/mod_cluster/native/include/mod_proxy_cluster.h
===================================================================
--- trunk/mod_cluster/native/include/mod_proxy_cluster.h 2008-06-03 13:19:34 UTC (rev 1649)
+++ trunk/mod_cluster/native/include/mod_proxy_cluster.h 2008-06-03 14:59:57 UTC (rev 1650)
@@ -36,7 +36,7 @@
* @param scheme AJP/http/https protocol to use.
* @return 0: All OK 500 : Error
*/
-APR_DECLARE(int) (* proxy_node_isup)(request_rec *r, int id, char *scheme, int load);
+int (* proxy_node_isup)(request_rec *r, int id, char *scheme, int load);
};
typedef struct balancer_method balancer_method;
#endif /*MOD_PROXY_CLUSTER_H*/
Modified: trunk/mod_cluster/native/include/node.h
===================================================================
--- trunk/mod_cluster/native/include/node.h 2008-06-03 13:19:34 UTC (rev 1649)
+++ trunk/mod_cluster/native/include/node.h 2008-06-03 14:59:57 UTC (rev 1650)
@@ -91,7 +91,7 @@
* @return APR_SUCCESS if all went well
*
*/
-APR_DECLARE(apr_status_t) insert_update_node(mem_t *s, nodeinfo_t *node, int *id);
+apr_status_t insert_update_node(mem_t *s, nodeinfo_t *node, int *id);
/**
* read a node record from the shared table
@@ -99,7 +99,7 @@
* @param node node to read from the shared table.
* @return address of the read node or NULL if error.
*/
-APR_DECLARE(nodeinfo_t *) read_node(mem_t *s, nodeinfo_t *node);
+nodeinfo_t * read_node(mem_t *s, nodeinfo_t *node);
/**
* get a node record from the shared table
@@ -107,7 +107,7 @@
* @param node address of the node read from the shared table.
* @return APR_SUCCESS if all went well
*/
-APR_DECLARE(apr_status_t) get_node(mem_t *s, nodeinfo_t **node, int ids);
+apr_status_t get_node(mem_t *s, nodeinfo_t **node, int ids);
/**
* remove(free) a node record from the shared table
@@ -115,7 +115,7 @@
* @param node node to remove from the shared table.
* @return APR_SUCCESS if all went well
*/
-APR_DECLARE(apr_status_t) remove_node(mem_t *s, nodeinfo_t *node);
+apr_status_t remove_node(mem_t *s, nodeinfo_t *node);
/*
* get the ids for the used (not free) nodes in the table
@@ -123,14 +123,14 @@
* @param ids array of int to store the used id (must be big enough).
* @return number of node existing or -1 if error.
*/
-APR_DECLARE(int) get_ids_used_node(mem_t *s, int *ids);
+int get_ids_used_node(mem_t *s, int *ids);
/*
* get the size of the table (max size).
* @param pointer to the shared table.
* @return size of the existing table or -1 if error.
*/
-APR_DECLARE(int) get_max_size_node(mem_t *s);
+int get_max_size_node(mem_t *s);
/**
* attach to the shared node table
@@ -139,7 +139,7 @@
* @param p pool to use for allocations.
* @return address of struct used to access the table.
*/
-APR_DECLARE(mem_t *) get_mem_node(char *string, int *num, apr_pool_t *p, slotmem_storage_method *storage);
+mem_t * get_mem_node(char *string, int *num, apr_pool_t *p, slotmem_storage_method *storage);
/**
* create a shared node table
* @param name to use to create the table.
@@ -147,7 +147,7 @@
* @param p pool to use for allocations.
* @return address of struct used to access the table.
*/
-APR_DECLARE(mem_t *) create_mem_node(char *string, int *num, apr_pool_t *p, slotmem_storage_method *storage);
+mem_t * create_mem_node(char *string, int *num, apr_pool_t *p, slotmem_storage_method *storage);
/**
* provider for the mod_proxy_cluster or mod_jk modules.
@@ -159,29 +159,29 @@
* @param node address of pointer to return the node.
* @return APR_SUCCESS if all went well
*/
-APR_DECLARE(apr_status_t) (* read_node)(int ids, nodeinfo_t **node);
+apr_status_t (* read_node)(int ids, nodeinfo_t **node);
/**
* read the list of ident of used nodes.
* @param ids address to store the idents.
* @return APR_SUCCESS if all went well
*/
-APR_DECLARE(int) (* get_ids_used_node)(int *ids);
+int (* get_ids_used_node)(int *ids);
/**
* read the max number of nodes in the shared table
*/
-APR_DECLARE(int) (*get_max_size_node)();
+int (*get_max_size_node)();
/**
* check the nodes for modifications.
* XXX: void *data is server_rec *s in fact.
*/
-APR_DECLARE(apr_time_t) (*worker_nodes_need_update)(void *data, apr_pool_t *pool);
+apr_time_t (*worker_nodes_need_update)(void *data, apr_pool_t *pool);
/*
* mark that the worker node are now up to date.
*/
-APR_DECLARE(int) (*worker_nodes_are_updated)(void *data);
+int (*worker_nodes_are_updated)(void *data);
/*
* Remove the node from shared memory (free the slotmem)
*/
-APR_DECLARE(int) (*remove_node)(nodeinfo_t *node);
+int (*remove_node)(nodeinfo_t *node);
};
#endif /*NODE_H*/
Modified: trunk/mod_cluster/native/include/slotmem.h
===================================================================
--- trunk/mod_cluster/native/include/slotmem.h 2008-06-03 13:19:34 UTC (rev 1649)
+++ trunk/mod_cluster/native/include/slotmem.h 2008-06-03 14:59:57 UTC (rev 1650)
@@ -67,7 +67,7 @@
* @param pool is pool used to create scoreboard
* @return APR_SUCCESS if all went well
*/
-APR_DECLARE(apr_status_t) (* ap_slotmem_do)(ap_slotmem_t *s, ap_slotmem_callback_fn_t *func, void *data, apr_pool_t *pool);
+apr_status_t (* ap_slotmem_do)(ap_slotmem_t *s, ap_slotmem_callback_fn_t *func, void *data, apr_pool_t *pool);
/**
* create a new slotmem with each item size is item_size.
@@ -79,7 +79,7 @@
* @param pool is pool used to create scoreboard
* @return APR_SUCCESS if all went well
*/
-APR_DECLARE(apr_status_t) (* ap_slotmem_create)(ap_slotmem_t **new, const char *name, apr_size_t item_size, int item_num, apr_pool_t *pool);
+apr_status_t (* ap_slotmem_create)(ap_slotmem_t **new, const char *name, apr_size_t item_size, int item_num, apr_pool_t *pool);
/**
* attach to an existing slotmem.
@@ -91,7 +91,7 @@
* @param pool is pool to memory allocate.
* @return APR_SUCCESS if all went well
*/
-APR_DECLARE(apr_status_t) (* ap_slotmem_attach)(ap_slotmem_t **new, const char *name, apr_size_t *item_size, int *item_num, apr_pool_t *pool);
+apr_status_t (* ap_slotmem_attach)(ap_slotmem_t **new, const char *name, apr_size_t *item_size, int *item_num, apr_pool_t *pool);
/**
* get the memory associated with this worker slot.
* @param s ap_slotmem_t to use.
@@ -99,7 +99,7 @@
* @param mem address to store the pointer to the slot
* @return APR_SUCCESS if all went well (the slot must be an allocated slot).
*/
-APR_DECLARE(apr_status_t) (* ap_slotmem_mem)(ap_slotmem_t *s, int item_id, void**mem);
+apr_status_t (* ap_slotmem_mem)(ap_slotmem_t *s, int item_id, void**mem);
/**
* alloc a slot from the slotmem free idems.
* @param s ap_slotmem_t to use.
@@ -107,7 +107,7 @@
* @param mem address to store the pointer to the slot
* @return APR_SUCCESS if all went well
*/
-APR_DECLARE(apr_status_t) (* ap_slotmem_alloc)(ap_slotmem_t *s, int *item_id, void**mem);
+apr_status_t (* ap_slotmem_alloc)(ap_slotmem_t *s, int *item_id, void**mem);
/**
* free a slot (return it to the free list).
* @param s ap_slotmem_t to use.
@@ -115,32 +115,32 @@
* @param mem pointer to the slot
* @return APR_SUCCESS if all went well
*/
-APR_DECLARE(apr_status_t) (* ap_slotmem_free)(ap_slotmem_t *s, int item_id, void*mem);
+apr_status_t (* ap_slotmem_free)(ap_slotmem_t *s, int item_id, void*mem);
/**
* Lock the slotmem.
* @param s ap_slotmem_t to use.
* @return APR_SUCCESS if all went well
*/
-APR_DECLARE(apr_status_t) (* ap_slotmem_lock)(ap_slotmem_t *s);
+apr_status_t (* ap_slotmem_lock)(ap_slotmem_t *s);
/**
* Unlock the slotmem.
* @param s ap_slotmem_t to use.
* @return APR_SUCCESS if all went well
*/
-APR_DECLARE(apr_status_t) (* ap_slotmem_unlock)(ap_slotmem_t *s);
+apr_status_t (* ap_slotmem_unlock)(ap_slotmem_t *s);
/**
* Return the used id in the slotmem table.
* @param s ap_slotmem_t to use.
* @param ids array of int where to store the free idents.
* @return number of slotmem in use.
*/
-APR_DECLARE(int) (*ap_slotmem_get_used)(ap_slotmem_t *s, int *ids);
+int (*ap_slotmem_get_used)(ap_slotmem_t *s, int *ids);
/**
* Return the size of the slotmem table.
* @param s ap_slotmem_t to use.
* @return number of slotmem that cant be stored in the slotmem table.
*/
-APR_DECLARE(int) (*ap_slotmem_get_max_size)(ap_slotmem_t *s);
+int (*ap_slotmem_get_max_size)(ap_slotmem_t *s);
};
typedef struct slotmem_storage_method slotmem_storage_method;
16 years, 6 months
JBoss Native SVN: r1649 - trunk/mod_cluster/native/mod_proxy_cluster.
by jbossnative-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2008-06-03 09:19:34 -0400 (Tue, 03 Jun 2008)
New Revision: 1649
Modified:
trunk/mod_cluster/native/mod_proxy_cluster/mod_proxy_cluster.c
Log:
cleanup and remove my_ap_proxy_add_worker_to_balancer().
Modified: trunk/mod_cluster/native/mod_proxy_cluster/mod_proxy_cluster.c
===================================================================
--- trunk/mod_cluster/native/mod_proxy_cluster/mod_proxy_cluster.c 2008-06-02 16:45:07 UTC (rev 1648)
+++ trunk/mod_cluster/native/mod_proxy_cluster/mod_proxy_cluster.c 2008-06-03 13:19:34 UTC (rev 1649)
@@ -51,28 +51,13 @@
static struct balancer_storage_method *balancer_storage = NULL;
/*
- * XXX: Should use the proxy_util.c one?.
- */
-static void my_ap_proxy_add_worker_to_balancer(apr_pool_t *pool, proxy_balancer *balancer,
- proxy_worker *worker)
-{
- proxy_worker *runtime;
-
- runtime = apr_array_push(balancer->workers);
- memcpy(runtime, worker, sizeof(proxy_worker));
- /* Increase the total runtime count */
- proxy_lb_workers++;
-
-}
-
-/*
* Create/Get the worker before using it
*/
static void create_worker(proxy_server_conf *conf, proxy_balancer *balancer,
server_rec *server, proxy_worker **worker,
nodeinfo_t *node)
{
- char url[6+64+7+4]; /* Type :// Host : Port */
+ char url[SCHEMENDSZ+HOSTNODESZ+PORTNODESZ+5]; /* Type :// Host : Port */
char *ptr;
int reuse = 0;
@@ -136,8 +121,31 @@
(*worker)->s->redirect[0] = '\0';
}
- if (!reuse)
- my_ap_proxy_add_worker_to_balancer(conf->pool, balancer, *worker);
+ if (!reuse) {
+ /*
+ * Create the corresponding balancer worker information
+ * copying for proxy_util.c ap_proxy_add_worker_to_balancer
+ */
+ proxy_worker *runtime;
+ runtime = apr_array_push(balancer->workers);
+ memcpy(runtime, (*worker), sizeof(proxy_worker));
+ } else {
+ /* Update the corresponding balancer worker information */
+ proxy_worker *runtime;
+ int i;
+ char name[HOSTNODESZ+PORTNODESZ+2];
+ runtime = (proxy_worker *)balancer->workers->elts;
+ strcpy(name, node->mess.Host);
+ strcat(name, ":");
+ strcat(name, node->mess.Port);
+ for (i = 0; i < balancer->workers->nelts; i++, runtime++) {
+ if (runtime->name) {
+ if (strcmp(name, runtime->name) == 0) {
+ memcpy(runtime, (*worker), sizeof(proxy_worker));
+ }
+ }
+ }
+ }
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, server,
"Created: worker for %s %d (status): %d", url, (*worker)->id, (*worker)->s->status);
}
@@ -206,8 +214,10 @@
"remove_workers_node %d", i);
if (i == 0) {
/* No connection in use: clean the worker */
- apr_pool_destroy(worker->cp->pool);
- worker->cp->pool = NULL;
+ if (worker->cp->pool) {
+ apr_pool_destroy(worker->cp->pool);
+ worker->cp->pool = NULL;
+ }
worker->id = 0;
/* XXX: How to remove the worker from the apr_array of the balancer */
16 years, 6 months
JBoss Native SVN: r1648 - trunk/mod_cluster/native/mod_proxy_cluster.
by jbossnative-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2008-06-02 12:45:07 -0400 (Mon, 02 Jun 2008)
New Revision: 1648
Modified:
trunk/mod_cluster/native/mod_proxy_cluster/mod_proxy_cluster.c
Log:
Don't add if alredy there.
Add missing worker++.
Modified: trunk/mod_cluster/native/mod_proxy_cluster/mod_proxy_cluster.c
===================================================================
--- trunk/mod_cluster/native/mod_proxy_cluster/mod_proxy_cluster.c 2008-06-02 11:55:05 UTC (rev 1647)
+++ trunk/mod_cluster/native/mod_proxy_cluster/mod_proxy_cluster.c 2008-06-02 16:45:07 UTC (rev 1648)
@@ -74,6 +74,7 @@
{
char url[6+64+7+4]; /* Type :// Host : Port */
char *ptr;
+ int reuse = 0;
/* build the name (scheme and port) when needed */
strcpy(url, node->mess.Type);
@@ -98,6 +99,7 @@
/* We are going to reuse a removed one */
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, server,
"Created: reusing worker for %s", url);
+ reuse = 1;
} else {
return; /* Done Already existing */
}
@@ -134,7 +136,8 @@
(*worker)->s->redirect[0] = '\0';
}
- my_ap_proxy_add_worker_to_balancer(conf->pool, balancer, *worker);
+ if (!reuse)
+ my_ap_proxy_add_worker_to_balancer(conf->pool, balancer, *worker);
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, server,
"Created: worker for %s %d (status): %d", url, (*worker)->id, (*worker)->s->status);
}
@@ -818,6 +821,7 @@
for (i = 0; i < conf->workers->nelts; i++) {
if (worker->id == id)
break;
+ worker++;
}
if (i == conf->workers->nelts) {
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
16 years, 6 months
JBoss Native SVN: r1647 - trunk/mod_cluster/native/mod_manager.
by jbossnative-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2008-06-02 07:55:05 -0400 (Mon, 02 Jun 2008)
New Revision: 1647
Modified:
trunk/mod_cluster/native/mod_manager/mod_manager.c
Log:
Don't process stuff on "removed" nodes.
Modified: trunk/mod_cluster/native/mod_manager/mod_manager.c
===================================================================
--- trunk/mod_cluster/native/mod_manager/mod_manager.c 2008-05-30 18:41:31 UTC (rev 1646)
+++ trunk/mod_cluster/native/mod_manager/mod_manager.c 2008-06-02 11:55:05 UTC (rev 1647)
@@ -821,6 +821,17 @@
return MNODERD;
}
+ /* If the node is marked removed check what to do */
+ if (node->mess.remove) {
+ if (status == REMOVE)
+ return NULL; /* Already done */
+ else {
+ /* Act has if the node wasn't found */
+ *errtype = TYPEMEM;
+ return MNODERD;
+ }
+ }
+
/* Process the * APP commands */
if (strcmp(r->uri, "*") == 0 || strcmp(r->uri, "/*") ==0) {
return (process_node_cmd(r, status, errtype, node));
16 years, 6 months