Author: jfrederic.clere(a)jboss.com
Date: 2008-06-11 11:25:22 -0400 (Wed, 11 Jun 2008)
New Revision: 1694
Added:
trunk/mod_cluster/native/mod_proxy_cluster/Makefile.in
trunk/mod_cluster/native/mod_proxy_cluster/buildconf
trunk/mod_cluster/native/mod_proxy_cluster/configure.in
Modified:
trunk/mod_cluster/native/mod_proxy_cluster/mod_proxy_cluster.c
Log:
Remove ajp util dependencies.
Added: trunk/mod_cluster/native/mod_proxy_cluster/Makefile.in
===================================================================
--- trunk/mod_cluster/native/mod_proxy_cluster/Makefile.in (rev
0)
+++ trunk/mod_cluster/native/mod_proxy_cluster/Makefile.in 2008-06-11 15:25:22 UTC (rev
1694)
@@ -0,0 +1,30 @@
+#
+# Copyright 2006 Red Hat Middleware, LLC.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#
http://www.apache.org/licenses/LICENSE-2.0
+# Unless required by applicable law or agreed to in writing, software distributed
+# under the License is distributed on an "AS IS" BASIS,i
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+APACHE_BASE = @APACHE_BASE@
+top_builddir = @APACHE_BASE@
+# For .deps.
+builddir = @CLUSTER_BASE@
+
+MOD_OBJS_LO=
+
+include $(APACHE_BASE)/build/rules.mk
+SH_COMPILE = $(LIBTOOL) --mode=compile $(BASE_CC) -I../include -prefer-pic -c $<
&& touch $@
+
+all: mod_proxy_cluster.so
+
+mod_proxy_cluster.so: mod_proxy_cluster.la
+ $(APACHE_BASE)/build/instdso.sh SH_LIBTOOL='$(LIBTOOL)' mod_proxy_cluster.la
`pwd`
+
+mod_proxy_cluster.la: mod_proxy_cluster.slo
+ $(SH_LINK) -rpath $(libexecdir) -module -avoid-version mod_proxy_cluster.lo
$(MOD_OBJS_LO)
Added: trunk/mod_cluster/native/mod_proxy_cluster/buildconf
===================================================================
--- trunk/mod_cluster/native/mod_proxy_cluster/buildconf (rev 0)
+++ trunk/mod_cluster/native/mod_proxy_cluster/buildconf 2008-06-11 15:25:22 UTC (rev
1694)
@@ -0,0 +1,11 @@
+# Remove aclocal.m4 as it'll break some builds...
+rm -rf aclocal.m4 autom4te*.cache
+
+echo "Creating configure ..."
+### do some work to toss config.cache?
+if ${AUTOCONF:-autoconf}; then
+ :
+else
+ echo "autoconf failed"
+ exit 1
+fi
Property changes on: trunk/mod_cluster/native/mod_proxy_cluster/buildconf
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/mod_cluster/native/mod_proxy_cluster/configure.in
===================================================================
--- trunk/mod_cluster/native/mod_proxy_cluster/configure.in (rev
0)
+++ trunk/mod_cluster/native/mod_proxy_cluster/configure.in 2008-06-11 15:25:22 UTC (rev
1694)
@@ -0,0 +1,24 @@
+dnl configure for mod_manager
+dnl
+
+AC_INIT(mod_proxy_cluster.c)
+
+AC_MSG_CHECKING(for Apache httpd installation)
+AC_ARG_WITH(apache,
+[ --with-apache[=DIR] DIR is the apache base installation
+],
+[ if test "$withval" = "yes"; then
+ withval=/usr/local/etc/httpd
+ fi
+ if test "$withval" != "no"; then
+ APACHE_BASE=$withval
+ else
+ AC_MSG_ERROR(mod_manager need a valid apache location)
+ fi
+],
+[ AC_MSG_ERROR(Please use --with-apache[=DIR])])
+CLUSTER_BASE=`pwd`
+
+AC_SUBST(APACHE_BASE)
+AC_SUBST(CLUSTER_BASE)
+AC_OUTPUT(Makefile)
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-11 14:16:31 UTC
(rev 1693)
+++ trunk/mod_cluster/native/mod_proxy_cluster/mod_proxy_cluster.c 2008-06-11 15:25:22 UTC
(rev 1694)
@@ -35,7 +35,6 @@
#include "http_protocol.h"
#include "http_core.h"
#include "mod_proxy.h"
-#include "ajp.h"
#include "mod_proxy_cluster.h"
@@ -754,7 +753,67 @@
/*
* Do a ping/pong to the node
+ * XXX: ajp_handle_cping_cpong should come from a provider as
+ * it is already in modules/proxy/ajp_utils.c
*/
+static apr_status_t ajp_handle_cping_cpong(apr_socket_t *sock,
+ request_rec *r,
+ apr_interval_time_t timeout)
+{
+ char buf[5];
+ apr_size_t written = 5;
+ apr_interval_time_t org;
+ apr_status_t status;
+
+ /* built the cping message */
+ buf[0] = 0x12;
+ buf[1] = 0x34;
+ buf[2] = (apr_byte_t) 0;
+ buf[3] = (apr_byte_t) 1;
+ buf[4] = (unsigned char)10;
+
+ status = apr_socket_send(sock, buf, &written);
+ if (status != APR_SUCCESS) {
+ ap_log_error(APLOG_MARK, APLOG_ERR, status, NULL,
+ "ajp_handle_cping_cpong(): send failed");
+ return status;
+ }
+ status = apr_socket_timeout_get(sock, &org);
+ if (status != APR_SUCCESS) {
+ ap_log_error(APLOG_MARK, APLOG_ERR, status, NULL,
+ "ajp_handle_cping_cpong(): apr_socket_timeout_get
failed");
+ return status;
+ }
+ status = apr_socket_timeout_set(sock, timeout);
+ written = 5;
+ status = apr_socket_recv(sock, buf, &written);
+ if (status != APR_SUCCESS) {
+ ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
+ "ajp_handle_cping_cpong: apr_socket_recv failed");
+ goto cleanup;
+ }
+ if (buf[0] != 0x41 || buf[1] != 0x42 || buf[2] != 0 || buf[3] != 1 || buf[4] !=
(unsigned char)9) {
+ ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
+ "ajp_handle_cping_cpong: awaited CPONG, received %02x %02x %02x %02x
%02x",
+ buf[0] & 0xFF,
+ buf[1] & 0xFF,
+ buf[2] & 0xFF,
+ buf[3] & 0xFF,
+ buf[4] & 0xFF);
+ status = APR_EGENERAL;
+ }
+cleanup:
+ status = apr_socket_timeout_set(sock, org);
+ if (status != APR_SUCCESS) {
+ ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
+ "ajp_handle_cping_cpong: apr_socket_timeout_set failed");
+ return status;
+ }
+
+ ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
+ "ajp_handle_cping_cpong: Done");
+ return status;
+}
static apr_status_t proxy_cluster_try_pingpong(request_rec *r, proxy_worker *worker, char
*scheme)
{
apr_status_t rv;