Author: jfrederic.clere(a)jboss.com
Date: 2008-03-26 07:07:00 -0400 (Wed, 26 Mar 2008)
New Revision: 1459
Modified:
sandbox/httpd/src/native/mod_manager/mod_manager.c
Log:
Force mod-cluster when the method is one of ours.
1 - Allow ProxyPass / bla....
2 - no need of SetHandler mod-cluster in httpd.conf
Modified: sandbox/httpd/src/native/mod_manager/mod_manager.c
===================================================================
--- sandbox/httpd/src/native/mod_manager/mod_manager.c 2008-03-25 10:17:25 UTC (rev 1458)
+++ sandbox/httpd/src/native/mod_manager/mod_manager.c 2008-03-26 11:07:00 UTC (rev 1459)
@@ -487,7 +487,38 @@
x[j] = '\0';
return j;
}
+/*
+ * This routine is called before mod_proxy translate name.
+ * This allows us to make decisions before mod_proxy
+ * to be able to fill tables even with ProxyPass / balancer...
+ */
+static int manager_trans(request_rec *r)
+{
+ int ours = 0;
+ if (strcasecmp(r->method, "CONFIG") == 0)
+ ours = 1;
+ else if (strcasecmp(r->method, "ENABLE-APP") == 0)
+ ours = 1;
+ else if (strcasecmp(r->method, "DISABLE-APP") == 0)
+ ours = 1;
+ else if (strcasecmp(r->method, "STOP-APP") == 0)
+ ours = 1;
+ else if (strcasecmp(r->method, "REMOVE-APP") == 0)
+ ours = 1;
+ else if (strcasecmp(r->method, "STATUS") == 0)
+ ours = 1;
+ else if (strcasecmp(r->method, "DUMP") == 0)
+ ours = 1;
+ if (ours) {
+ /* The method one of ours */
+ r->handler = "mod-cluster";
+ return OK;
+ }
+
+ return DECLINED;
+}
+
/* Process the requests from the ModClusterService */
static int manager_handler(request_rec *r)
{
@@ -603,10 +634,15 @@
static void manager_hooks(apr_pool_t *p)
{
+ static const char * const aszSucc[]={ "mod_proxy.c", NULL };
/* Create the shared tables for mod_proxy_cluster */
ap_hook_post_config(manager_init, NULL, NULL, APR_HOOK_MIDDLE);
+ /* post read_request handling: to be handle to use ProxyPass / */
+ ap_hook_translate_name(manager_trans, NULL, aszSucc,
+ APR_HOOK_FIRST);
+
/* Process the request from the ModClusterService */
ap_hook_handler(manager_handler, NULL, NULL, APR_HOOK_MIDDLE);
Show replies by date