joes 2003/04/16 20:34:56
Modified: . Makefile.am acinclude.m4
env Makefile.am mod_apreq.c
src Makefile.am apreq_parsers.c
Added: . configure.ac
env libapreq_cgi.c
Removed: . configure.in
Log:
Add rudimentary cgi environment; mv configure.in configure.am
Revision Changes Path
1.3 +3 -1 httpd-apreq-2/Makefile.am
Index: Makefile.am
===================================================================
RCS file: /home/cvs/httpd-apreq-2/Makefile.am,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- Makefile.am 12 Apr 2003 04:52:14 -0000 1.2
+++ Makefile.am 17 Apr 2003 03:34:55 -0000 1.3
@@ -1,3 +1,5 @@
AUTOMAKE_OPTIONS = foreign
SUBDIRS = src env
-EXTRA_DIST = libapreq.pod
+EXTRA_DIST = README
+
+test: check
1.3 +3 -1 httpd-apreq-2/acinclude.m4
Index: acinclude.m4
===================================================================
RCS file: /home/cvs/httpd-apreq-2/acinclude.m4,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- acinclude.m4 15 Apr 2003 09:36:11 -0000 1.2
+++ acinclude.m4 17 Apr 2003 03:34:55 -0000 1.3
@@ -6,7 +6,9 @@
APACHE2_INCLUDES="$APACHE2/include"
APACHE2_MODULES="$APACHE2/modules"
APACHE2_LIBS="$APACHE2/lib"
- AC_SUBST(APACHE2_INCLUDES) AC_SUBST(APACHE2_MODULES)
AC_SUBST(APACHE2_LIBS)
+ AC_SUBST(APACHE2_INCLUDES)
+ AC_SUBST(APACHE2_MODULES)
+ AC_SUBST(APACHE2_LIBS)
])
AC_DEFUN(APR_ADDTO,[
1.1 httpd-apreq-2/configure.ac
Index: configure.ac
===================================================================
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.13)
AC_INIT("libapreq - Apache Request Library", 2.0, [EMAIL PROTECTED], libapreq)
AM_INIT_AUTOMAKE
dnl AC_CONFIG_AUX_DIR(./build)
AC_PROG_MAKE_SET
dnl Checks for programs.
AC_PROG_CC
AM_PROG_LIBTOOL
AC_PROG_RANLIB
AC_PROG_INSTALL
AC_PROG_LN_S
dnl AC_ARG_ENABLE(maintainer-mode,[ --enable-maintainer-mode Turn on
debugging
dnl and compile time warnings],
dnl [APR_ADDTO(CFLAGS,-g)
dnl if test "$GCC" = "yes"; then
dnl APR_ADDTO(CFLAGS,[-Wall -Wmissing-prototypes -Wstrict-prototypes
dnl -Wmissing-declarations])
dnl elif test "$AIX_XLC" = "yes"; then
dnl APR_ADDTO(CFLAGS,-qfullpath -qinitauto=FE -qwarn64 -qcheck=all)
dnl fi
dnl ])dnl
AM_MAINTAINER_MODE
dnl Checks for header files.
dnl Checks for typedefs, structures, and compiler characteristics.
dnl Checks for library functions.
AC_APREQ
AC_OUTPUT([Makefile src/Makefile env/Makefile t/Makefile])
1.3 +9 -1 httpd-apreq-2/env/Makefile.am
Index: Makefile.am
===================================================================
RCS file: /home/cvs/httpd-apreq-2/env/Makefile.am,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- Makefile.am 15 Apr 2003 09:36:11 -0000 1.2
+++ Makefile.am 17 Apr 2003 03:34:56 -0000 1.3
@@ -1,5 +1,13 @@
-lib_LTLIBRARIES = mod_apreq.la
+lib_LTLIBRARIES = mod_apreq.la libapreq_cgi.la
INCLUDES = [EMAIL PROTECTED]@ -I../src
+
mod_apreq_la_SOURCES = mod_apreq.c
mod_apreq_la_LDFLAGS = -rpath @APACHE2_LIBS@ -dynamic -module
mod_apreq_la_LIBADD = ../src/libapreq.la
+mod_apreq_ls_CPPFLAGS = [EMAIL PROTECTED]@
+
+
+libapreq_cgi_la_SOURCES = libapreq_cgi.c
+libapreq_cgi_la_LDFLAGS = -rpath @APACHE2_LIBS@ -version-info 2:0
+libapreq_cgi_la_LIBADD = ../src/libapreq.la
+libapreq_cgi_la_CPPFLAGS = [EMAIL PROTECTED]@
1.4 +5 -2 httpd-apreq-2/env/mod_apreq.c
Index: mod_apreq.c
===================================================================
RCS file: /home/cvs/httpd-apreq-2/env/mod_apreq.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- mod_apreq.c 15 Apr 2003 09:36:11 -0000 1.3
+++ mod_apreq.c 17 Apr 2003 03:34:56 -0000 1.4
@@ -62,6 +62,7 @@
#include "apreq.h"
#include "apreq_env.h"
+#include "apreq_params.h"
#include "apreq_parsers.h"
#include "apreq_cookie.h"
@@ -236,8 +237,10 @@
APR_BRIGADE_CONCAT(bb, ctx->bb_in);
}
- apreq_log(APREQ_DEBUG rv, r, "dump body:");
- apreq_table_do(dump_table, r, ctx->req->body, NULL);
+ if (ctx->req->body) {
+ apreq_log(APREQ_DEBUG rv, r, "dump body:");
+ apreq_table_do(dump_table, r, ctx->req->body, NULL);
+ }
return rv;
}
1.1 httpd-apreq-2/env/libapreq_cgi.c
Index: libapreq_cgi.c
===================================================================
/* ====================================================================
* The Apache Software License, Version 1.1
*
* Copyright (c) 2000-2003 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Apache" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
#include "apreq.h"
#include "apreq_env.h"
#include "apreq_params.h"
#include "apreq_parsers.h"
#include "apreq_cookie.h"
#include "apr_lib.h"
#include "apr_strings.h"
#include <stdlib.h>
#include <stdio.h>
#define dENV struct env_ctx *env = (struct env_ctx *)ctx
/* the "warehouse" */
struct env_ctx {
apr_pool_t *pool;
apreq_request_t *req;
apreq_jar_t *jar;
apr_bucket_brigade *bb;
};
static const char env_name[] = "CGI";
#define CRLF "\015\012"
static apr_pool_t *env_pool(void *ctx)
{
dENV;
return env->pool;
}
static const char *env_in(void *ctx, const char *name)
{
return getenv(name);
}
static apr_status_t env_out(void *ctx, const char *name, char *value)
{
return printf("%s: %s" CRLF, name, value) > 0 ? APR_SUCCESS :
APR_EGENERAL;
}
static const char *env_args(void *ctx)
{
return getenv("QUERY_STRING");
}
static void *env_jar(void *ctx, void *jar)
{
dENV;
if (jar != NULL) {
apreq_jar_t *old_jar = env->jar;
env->jar = jar;
return old_jar;
}
return env->jar;
}
static void *env_request(void *ctx, void *req)
{
dENV;
if (req != NULL) {
apreq_request_t *old_req = env->req;
env->req = req;
return old_req;
}
return env->req;
}
static apreq_cfg_t *env_cfg(void *ctx)
{
/* XXX: not implemented */
return NULL;
}
static int dump_table(void *ctx, const char *key, const char *value)
{
dENV;
dAPREQ_LOG;
apreq_log(APREQ_DEBUG 0, env, "%s => %s", key, value);
return 1;
}
APREQ_LOG(env_log)
{
}
const struct apreq_env APREQ_ENV =
{
env_name,
env_pool,
env_in,
env_out,
env_args,
env_jar,
env_request,
env_cfg,
env_log
};
1.6 +4 -2 httpd-apreq-2/src/Makefile.am
Index: Makefile.am
===================================================================
RCS file: /home/cvs/httpd-apreq-2/src/Makefile.am,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- Makefile.am 15 Apr 2003 09:36:11 -0000 1.5
+++ Makefile.am 17 Apr 2003 03:34:56 -0000 1.6
@@ -1,8 +1,10 @@
+INCLUDES = [EMAIL PROTECTED]@
+LIBS = [EMAIL PROTECTED]@
+
lib_LTLIBRARIES = libapreq.la
pkginclude_HEADERS = apreq.h apreq_cookie.h apreq_params.h \
apreq_tables.h apreq_env.h apreq_parsers.h
libapreq_la_SOURCES = apreq.c apreq_tables.c apreq_cookie.c \
apreq_params.c apreq_parsers.c
libapreq_la_LDFLAGS = -lapr-0 -laprutil-0 -version-info 2:0 -rpath
@APACHE2_LIBS@
-INCLUDES = [EMAIL PROTECTED]@
-LIBS = [EMAIL PROTECTED]@
+libapreq_la_CPPFLAGS = [EMAIL PROTECTED]@ [EMAIL PROTECTED]@
1.12 +0 -4 httpd-apreq-2/src/apreq_parsers.c
Index: apreq_parsers.c
===================================================================
RCS file: /home/cvs/httpd-apreq-2/src/apreq_parsers.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- apreq_parsers.c 15 Apr 2003 21:47:23 -0000 1.11
+++ apreq_parsers.c 17 Apr 2003 03:34:56 -0000 1.12
@@ -263,8 +263,6 @@
apr_status_t s = apr_bucket_read(e, &data, &dlen, APR_BLOCK_READ);
if (APR_BUCKET_IS_EOS(e)) {
- apreq_log(APREQ_DEBUG s, req->env,
- "got eos bucket: %d, %d", nlen, vlen);
return parser->v.status == URL_NAME ? APR_SUCCESS :
split_urlword(pool, t, bb, nlen+1, vlen);
}
@@ -297,8 +295,6 @@
switch (data[off++]) {
case '&':
case ';':
- apreq_log(APREQ_DEBUG 0, req->env,
- "got word: %d, %d", nlen, vlen);
s = split_urlword(pool, t, bb, nlen+1, vlen+1);
if (s != APR_SUCCESS)
return s;