Author: jfrederic.clere(a)jboss.com
Date: 2007-10-26 03:43:50 -0400 (Fri, 26 Oct 2007)
New Revision: 1145
Added:
sandbox/examples/
sandbox/examples/.deps
sandbox/examples/Makefile.in
sandbox/examples/buildconf
sandbox/examples/configure.in
sandbox/examples/mod_redirect.c
Log:
Add an example for case 19020... Base for examples for customer support.
Added: sandbox/examples/.deps
===================================================================
Added: sandbox/examples/Makefile.in
===================================================================
--- sandbox/examples/Makefile.in (rev 0)
+++ sandbox/examples/Makefile.in 2007-10-26 07:43:50 UTC (rev 1145)
@@ -0,0 +1,30 @@
+#
+# Copyright 2007 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 = @MANAGER_BASE@
+
+MOD_OBJS_LO=
+
+include $(APACHE_BASE)/build/rules.mk
+SH_COMPILE = $(LIBTOOL) --mode=compile $(BASE_CC) -I../common -prefer-pic -c $<
&& touch $@
+
+all: mod_redirect.so
+
+mod_redirect.so: mod_redirect.la
+ $(APACHE_BASE)/build/instdso.sh SH_LIBTOOL='$(LIBTOOL)' mod_redirect.la `pwd`
+
+mod_redirect.la: mod_redirect.slo
+ $(SH_LINK) -rpath $(libexecdir) -module -avoid-version mod_redirect.lo $(MOD_OBJS_LO)
Added: sandbox/examples/buildconf
===================================================================
--- sandbox/examples/buildconf (rev 0)
+++ sandbox/examples/buildconf 2007-10-26 07:43:50 UTC (rev 1145)
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+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: sandbox/examples/buildconf
___________________________________________________________________
Name: svn:executable
+ *
Added: sandbox/examples/configure.in
===================================================================
--- sandbox/examples/configure.in (rev 0)
+++ sandbox/examples/configure.in 2007-10-26 07:43:50 UTC (rev 1145)
@@ -0,0 +1,24 @@
+dnl configure for mod_redirect
+dnl
+
+AC_INIT(mod_redirect.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_redirect need a valid apache location)
+ fi
+],
+[ AC_MSG_ERROR(Please use --with-apache[=DIR])])
+MANAGER_BASE=`pwd`
+
+AC_SUBST(APACHE_BASE)
+AC_SUBST(MANAGER_BASE)
+AC_OUTPUT(Makefile)
Added: sandbox/examples/mod_redirect.c
===================================================================
--- sandbox/examples/mod_redirect.c (rev 0)
+++ sandbox/examples/mod_redirect.c 2007-10-26 07:43:50 UTC (rev 1145)
@@ -0,0 +1,61 @@
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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,
+ * 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.
+ */
+#include "httpd.h"
+#include "http_config.h"
+#include "http_core.h"
+#include "http_log.h"
+#include "http_main.h"
+#include "http_protocol.h"
+#include "http_request.h"
+#include "util_script.h"
+#include "http_connection.h"
+#ifdef HAVE_UNIX_SUEXEC
+#include "unixd.h"
+#endif
+#include "scoreboard.h"
+#include "mpm_common.h"
+
+#include "apr_strings.h"
+
+#include <stdio.h>
+
+
+/* example of redirect for case 19020 */
+static int x_handler(request_rec *r)
+{
+ char locbuf[2048];
+ snprintf(locbuf, sizeof(locbuf), "%s",
"http://example.com:7779/t.gif");
+ apr_table_setn (r->headers_out, "Location", locbuf);
+ return (HTTP_TEMPORARY_REDIRECT);
+}
+static void x_register_hooks(apr_pool_t *p)
+{
+ ap_hook_handler(x_handler, NULL, NULL, APR_HOOK_MIDDLE);
+}
+static void *x_create_dir_config(apr_pool_t *pool, char *x)
+{
+ return NULL;
+}
+module AP_MODULE_DECLARE_DATA redirect_module =
+{
+ STANDARD20_MODULE_STUFF,
+ x_create_dir_config, /* per-directory config creator */
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ x_register_hooks, /* set up other request processing hooks */
+};