summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArno Töll <arno@debian.org>2012-11-21 23:03:58 +0100
committerArno Töll <arno@debian.org>2012-11-21 23:03:58 +0100
commit985230456afb0b945234dfac919a6ece3df4a715 (patch)
tree8f820570c0f78de9a32888317a48163721da923a
parentae5d7c9fce70d39274e4da707f384021f6ec46d4 (diff)
downloadlighttpd-985230456afb0b945234dfac919a6ece3df4a715.tar.gz
Imported Upstream version 1.4.26upstream/1.4.26
-rw-r--r--Makefile.in17
-rw-r--r--NEWS14
-rw-r--r--SConstruct2
-rw-r--r--aclocal.m410
-rwxr-xr-xconfigure279
-rw-r--r--configure.ac38
-rw-r--r--doc/Makefile.in2
-rwxr-xr-xltmain.sh8
-rw-r--r--m4/libtool.m413
-rw-r--r--m4/ltversion.m410
-rw-r--r--src/Makefile.in2
-rw-r--r--src/base.h1
-rw-r--r--src/chunk.c2
-rw-r--r--src/connections.c213
-rw-r--r--src/mod_accesslog.c8
-rw-r--r--src/mod_cgi.c7
-rw-r--r--src/mod_fastcgi.c21
-rw-r--r--src/mod_proxy.c29
-rw-r--r--src/mod_redirect.c2
-rw-r--r--src/mod_rewrite.c2
-rwxr-xr-xtests/LightyTest.pm90
-rw-r--r--tests/Makefile.in21
-rw-r--r--tests/docroot/123/Makefile.in2
-rw-r--r--tests/docroot/Makefile.in6
-rw-r--r--tests/docroot/www/Makefile.in6
-rw-r--r--tests/docroot/www/expire/Makefile.in2
-rw-r--r--tests/docroot/www/go/Makefile.in2
-rw-r--r--tests/docroot/www/indexfile/Makefile.in2
-rwxr-xr-xtests/request.t11
-rwxr-xr-xtests/run-tests.pl2
30 files changed, 441 insertions, 383 deletions
diff --git a/Makefile.in b/Makefile.in
index ebf5473..8f67c32 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11 from Makefile.am.
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -332,7 +332,7 @@ distclean-libtool:
# (which will cause the Makefiles to be regenerated when you run `make');
# (2) otherwise, pass the desired values on the `make' command line.
$(RECURSIVE_TARGETS):
- @failcom='exit 1'; \
+ @fail= failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
@@ -357,7 +357,7 @@ $(RECURSIVE_TARGETS):
fi; test -z "$$fail"
$(RECURSIVE_CLEAN_TARGETS):
- @failcom='exit 1'; \
+ @fail= failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
@@ -521,7 +521,8 @@ distdir: $(DISTFILES)
fi; \
done
-test -n "$(am__skip_mode_fix)" \
- || find "$(distdir)" -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
+ || find "$(distdir)" -type d ! -perm -755 \
+ -exec chmod u+rwx,go+rx {} \; -o \
! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
! -type d ! -perm -400 -exec chmod a+r {} \; -o \
! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
@@ -565,17 +566,17 @@ dist dist-all: distdir
distcheck: dist
case '$(DIST_ARCHIVES)' in \
*.tar.gz*) \
- GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\
+ GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
*.tar.bz2*) \
- bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
+ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
*.tar.lzma*) \
- unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\
+ lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\
*.tar.xz*) \
xz -dc $(distdir).tar.xz | $(am__untar) ;;\
*.tar.Z*) \
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
*.shar.gz*) \
- GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\
+ GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
*.zip*) \
unzip $(distdir).zip ;;\
esac
diff --git a/NEWS b/NEWS
index fa02c18..493f0de 100644
--- a/NEWS
+++ b/NEWS
@@ -3,7 +3,19 @@
NEWS
====
-- 1.4.25 -
+- 1.4.26 -
+ * Fix request parser to handle packets with splitted \r\n\r\n (fixes #2105)
+ * Remove dependency on automake >= 1.11 with m4_ifdef check
+ * mod_accesslog: support %e (fixes #2113, thx presbrey)
+ * Fix mod_cgi cgi.execute-x-only option in global block
+ * mod_fastcgi: x-sendfile2 parse error debugging
+ * Fix mod_proxy dead host detection if connect() fails
+ * Fix fd leaks in mod_cgi (fds not closed on pipe/fork failures, found by Rodrigo, fixes #2158, #2159)
+ * Fix segfault with broken rewrite/redirect patterns (fixes #2140, found by crypt)
+ * Append to previous buffer in con read, fix DoS/OOM vulnerability (fixes #2147, found by liming, CVE-2010-0295)
+ * Fix HUP detection in close-state if event-backend doesn't support FDEVENT_HUP (like select or poll on FreeBSD)
+
+- 1.4.25 - 2009-11-21
* mod_magnet: fix pairs() for normal tables and strings (fixes #1307)
* mod_magnet: add traceback for printing lua errors
* mod_rewrite: fix compile error if compiled without pcre
diff --git a/SConstruct b/SConstruct
index 9b41657..3e03e38 100644
--- a/SConstruct
+++ b/SConstruct
@@ -5,7 +5,7 @@ import string
from stat import *
package = 'lighttpd'
-version = '1.4.25'
+version = '1.4.26'
def checkCHeaders(autoconf, hdrs):
p = re.compile('[^A-Z0-9]')
diff --git a/aclocal.m4 b/aclocal.m4
index d694898..009e640 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1,4 +1,4 @@
-# generated automatically by aclocal 1.11 -*- Autoconf -*-
+# generated automatically by aclocal 1.11.1 -*- Autoconf -*-
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
# 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
@@ -13,8 +13,8 @@
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
-m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.64],,
-[m4_warning([this file was generated for autoconf 2.64.
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.65],,
+[m4_warning([this file was generated for autoconf 2.65.
You have another version of autoconf. It may work, but is not guaranteed to.
If you have problems, you may need to regenerate the build system entirely.
To do so, use the procedure documented by the package, typically `autoreconf'.])])
@@ -192,7 +192,7 @@ AC_DEFUN([AM_AUTOMAKE_VERSION],
[am__api_version='1.11'
dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
dnl require some minimum version. Point them to the right macro.
-m4_if([$1], [1.11], [],
+m4_if([$1], [1.11.1], [],
[AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
])
@@ -208,7 +208,7 @@ m4_define([_AM_AUTOCONF_VERSION], [])
# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-[AM_AUTOMAKE_VERSION([1.11])dnl
+[AM_AUTOMAKE_VERSION([1.11.1])dnl
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
diff --git a/configure b/configure
index 47a2ac6..a84da8e 100755
--- a/configure
+++ b/configure
@@ -1,12 +1,14 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.64 for lighttpd 1.4.25.
+# Generated by GNU Autoconf 2.65 for lighttpd 1.4.26.
#
# Report bugs to <contact@lighttpd.net>.
#
+#
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software
-# Foundation, Inc.
+# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
+# Inc.
+#
#
# This configure script is free software; the Free Software Foundation
# gives unlimited permission to copy, distribute and modify it.
@@ -676,7 +678,8 @@ fi
-exec 7<&0 </dev/null 6>&1
+test -n "$DJDIR" || exec 7<&0 </dev/null
+exec 6>&1
# Name of the host.
# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
@@ -698,8 +701,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='lighttpd'
PACKAGE_TARNAME='lighttpd'
-PACKAGE_VERSION='1.4.25'
-PACKAGE_STRING='lighttpd 1.4.25'
+PACKAGE_VERSION='1.4.26'
+PACKAGE_STRING='lighttpd 1.4.26'
PACKAGE_BUGREPORT='contact@lighttpd.net'
PACKAGE_URL=''
@@ -1480,7 +1483,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures lighttpd 1.4.25 to adapt to many kinds of systems.
+\`configure' configures lighttpd 1.4.26 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1551,7 +1554,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of lighttpd 1.4.25:";;
+ short | recursive ) echo "Configuration of lighttpd 1.4.26:";;
esac
cat <<\_ACEOF
@@ -1604,7 +1607,7 @@ Some influential environment variables:
LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
nonstandard directory <lib dir>
LIBS libraries to pass to the linker, e.g. -l<library>
- CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I<include dir> if
+ CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
you have headers in a nonstandard directory <include dir>
CPP C preprocessor
PKG_CONFIG path to pkg-config utility
@@ -1684,8 +1687,8 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-lighttpd configure 1.4.25
-generated by GNU Autoconf 2.64
+lighttpd configure 1.4.26
+generated by GNU Autoconf 2.65
Copyright (C) 2009 Free Software Foundation, Inc.
This configure script is free software; the Free Software Foundation
@@ -1732,7 +1735,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
ac_retval=1
fi
eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
- return $ac_retval
+ as_fn_set_status $ac_retval
} # ac_fn_c_try_compile
@@ -1769,7 +1772,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
ac_retval=1
fi
eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
- return $ac_retval
+ as_fn_set_status $ac_retval
} # ac_fn_c_try_cpp
@@ -1904,7 +1907,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
fi
rm -rf conftest.dSYM conftest_ipa8_conftest.oo
eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
- return $ac_retval
+ as_fn_set_status $ac_retval
} # ac_fn_c_try_run
@@ -1981,7 +1984,7 @@ fi
# left behind by Apple's compiler. We do this before executing the actions.
rm -rf conftest.dSYM conftest_ipa8_conftest.oo
eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
- return $ac_retval
+ as_fn_set_status $ac_retval
} # ac_fn_c_try_link
@@ -2337,15 +2340,15 @@ rm -f conftest.val
fi
eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
- return $ac_retval
+ as_fn_set_status $ac_retval
} # ac_fn_c_compute_int
cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by lighttpd $as_me 1.4.25, which was
-generated by GNU Autoconf 2.64. Invocation command line was
+It was created by lighttpd $as_me 1.4.26, which was
+generated by GNU Autoconf 2.65. Invocation command line was
$ $0 $@
@@ -2598,7 +2601,7 @@ fi
for ac_site_file in "$ac_site_file1" "$ac_site_file2"
do
test "x$ac_site_file" = xNONE && continue
- if test -r "$ac_site_file"; then
+ if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
$as_echo "$as_me: loading site script $ac_site_file" >&6;}
sed 's/^/| /' "$ac_site_file" >&5
@@ -2607,9 +2610,9 @@ $as_echo "$as_me: loading site script $ac_site_file" >&6;}
done
if test -r "$cache_file"; then
- # Some versions of bash will fail to source /dev/null (special
- # files actually), so we avoid doing that.
- if test -f "$cache_file"; then
+ # Some versions of bash will fail to source /dev/null (special files
+ # actually), so we avoid doing that. DJGPP emulates it as a regular file.
+ if test /dev/null != "$cache_file" && test -f "$cache_file"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
$as_echo "$as_me: loading cache $cache_file" >&6;}
case $cache_file in
@@ -3144,6 +3147,7 @@ IFS=$as_save_IFS
fi
+ test -d ./--version && rmdir ./--version
if test "${ac_cv_path_mkdir+set}" = set; then
MKDIR_P="$ac_cv_path_mkdir -p"
else
@@ -3151,7 +3155,6 @@ fi
# value for MKDIR_P within a source directory, because that will
# break other packages using the cache if that directory is
# removed, or if the value is a relative name.
- test -d ./--version && rmdir ./--version
MKDIR_P="$ac_install_sh -d"
fi
fi
@@ -3246,18 +3249,6 @@ else
fi
rmdir .tst 2>/dev/null
-# Check whether --enable-silent-rules was given.
-if test "${enable_silent_rules+set}" = set; then :
- enableval=$enable_silent_rules;
-fi
-
-case $enable_silent_rules in
-yes) AM_DEFAULT_VERBOSITY=0;;
-no) AM_DEFAULT_VERBOSITY=1;;
-*) AM_DEFAULT_VERBOSITY=1;;
-esac
-AM_BACKSLASH='\'
-
if test "`cd $srcdir && pwd`" != "`pwd`"; then
# Use -I$(srcdir) only when $(srcdir) != ., so that make's output
# is not polluted with repeated "-I."
@@ -3280,7 +3271,7 @@ fi
# Define the identity of the package.
PACKAGE='lighttpd'
- VERSION='1.4.25'
+ VERSION='1.4.26'
cat >>confdefs.h <<_ACEOF
@@ -3401,6 +3392,7 @@ $as_echo "$am_cv_prog_tar_ustar" >&6; }
+
# Check whether --enable-silent-rules was given.
if test "${enable_silent_rules+set}" = set; then :
enableval=$enable_silent_rules;
@@ -3414,7 +3406,6 @@ esac
AM_BACKSLASH='\'
-# Checks for programs.
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -3737,32 +3728,30 @@ $as_echo "$ac_try_echo"; } >&5
... rest of stderr output deleted ...
10q' conftest.err >conftest.er1
cat conftest.er1 >&5
- rm -f conftest.er1 conftest.err
fi
+ rm -f conftest.er1 conftest.err
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }
done
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include <stdio.h>
+
int
main ()
{
-FILE *f = fopen ("conftest.out", "w");
- return ferror (f) || fclose (f) != 0;
;
return 0;
}
_ACEOF
ac_clean_files_save=$ac_clean_files
-ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out conftest.out"
+ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
# Try to create an executable without -o first, disregard a.out.
# It will help us diagnose broken compilers, and finding out an intuition
# of exeext.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
-$as_echo_n "checking for C compiler default output file name... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
+$as_echo_n "checking whether the C compiler works... " >&6; }
ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
# The possible output files:
@@ -3824,10 +3813,10 @@ test "$ac_cv_exeext" = no && ac_cv_exeext=
else
ac_file=''
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
-$as_echo "$ac_file" >&6; }
if test -z "$ac_file"; then :
- $as_echo "$as_me: failed program was:" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
@@ -3835,51 +3824,18 @@ $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
{ as_fn_set_status 77
as_fn_error "C compiler cannot create executables
See \`config.log' for more details." "$LINENO" 5; }; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
+$as_echo_n "checking for C compiler default output file name... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
+$as_echo "$ac_file" >&6; }
ac_exeext=$ac_cv_exeext
-# Check that the compiler produces executables we can run. If not, either
-# the compiler is broken, or we cross compile.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
-$as_echo_n "checking whether the C compiler works... " >&6; }
-# If not cross compiling, check that we can run a simple program.
-if test "$cross_compiling" != yes; then
- if { ac_try='./$ac_file'
- { { case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; }; then
- cross_compiling=no
- else
- if test "$cross_compiling" = maybe; then
- cross_compiling=yes
- else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error "cannot run C compiled programs.
-If you meant to cross compile, use \`--host'.
-See \`config.log' for more details." "$LINENO" 5; }
- fi
- fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-
-rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out conftest.out
+rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
ac_clean_files=$ac_clean_files_save
-# Check that the compiler produces executables we can run. If not, either
-# the compiler is broken, or we cross compile.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
-$as_echo_n "checking whether we are cross compiling... " >&6; }
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
-$as_echo "$cross_compiling" >&6; }
-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
$as_echo_n "checking for suffix of executables... " >&6; }
if { { ac_try="$ac_link"
@@ -3912,13 +3868,72 @@ $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error "cannot compute suffix of executables: cannot compile and link
See \`config.log' for more details." "$LINENO" 5; }
fi
-rm -f conftest$ac_cv_exeext
+rm -f conftest conftest$ac_cv_exeext
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
$as_echo "$ac_cv_exeext" >&6; }
rm -f conftest.$ac_ext
EXEEXT=$ac_cv_exeext
ac_exeext=$EXEEXT
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdio.h>
+int
+main ()
+{
+FILE *f = fopen ("conftest.out", "w");
+ return ferror (f) || fclose (f) != 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+ac_clean_files="$ac_clean_files conftest.out"
+# Check that the compiler produces executables we can run. If not, either
+# the compiler is broken, or we cross compile.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
+$as_echo_n "checking whether we are cross compiling... " >&6; }
+if test "$cross_compiling" != yes; then
+ { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+ if { ac_try='./conftest$ac_cv_exeext'
+ { { case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; }; then
+ cross_compiling=no
+ else
+ if test "$cross_compiling" = maybe; then
+ cross_compiling=yes
+ else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error "cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." "$LINENO" 5; }
+ fi
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
+$as_echo "$cross_compiling" >&6; }
+
+rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
+ac_clean_files=$ac_clean_files_save
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
$as_echo_n "checking for suffix of object files... " >&6; }
if test "${ac_cv_objext+set}" = set; then :
@@ -5384,7 +5399,7 @@ fi
case $host_os in
*darwin*|*cygwin*|*aix*|*mingw* ) NO_RDYNAMIC=yes;;
- * ) NO_RDYNAMIC=no;;
+ * ) NO_RDYNAMIC=no;;
esac
if test x$NO_RDYNAMIC = xyes; then
NO_RDYNAMIC_TRUE=
@@ -5510,8 +5525,8 @@ esac
-macro_version='2.2.6'
-macro_revision='1.3012'
+macro_version='2.2.6b'
+macro_revision='1.3017'
@@ -5701,13 +5716,13 @@ if test "${lt_cv_nm_interface+set}" = set; then :
else
lt_cv_nm_interface="BSD nm"
echo "int some_variable = 0;" > conftest.$ac_ext
- (eval echo "\"\$as_me:5704: $ac_compile\"" >&5)
+ (eval echo "\"\$as_me:5719: $ac_compile\"" >&5)
(eval "$ac_compile" 2>conftest.err)
cat conftest.err >&5
- (eval echo "\"\$as_me:5707: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
+ (eval echo "\"\$as_me:5722: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
(eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
cat conftest.err >&5
- (eval echo "\"\$as_me:5710: output\"" >&5)
+ (eval echo "\"\$as_me:5725: output\"" >&5)
cat conftest.out >&5
if $GREP 'External.*some_variable' conftest.out > /dev/null; then
lt_cv_nm_interface="MS dumpbin"
@@ -6162,7 +6177,7 @@ irix5* | irix6* | nonstopux*)
;;
# This must be Linux ELF.
-linux* | k*bsd*-gnu)
+linux* | k*bsd*-gnu | kopensolaris*-gnu)
lt_cv_deplibs_check_method=pass_all
;;
@@ -6901,7 +6916,7 @@ ia64-*-hpux*)
;;
*-*-irix6*)
# Find out which ABI we are using.
- echo '#line 6904 "configure"' > conftest.$ac_ext
+ echo '#line 6919 "configure"' > conftest.$ac_ext
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
(eval $ac_compile) 2>&5
ac_status=$?
@@ -8101,11 +8116,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:8104: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:8119: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:8108: \$? = $ac_status" >&5
+ echo "$as_me:8123: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -8270,7 +8285,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
lt_prog_compiler_static='-non_shared'
;;
- linux* | k*bsd*-gnu)
+ linux* | k*bsd*-gnu | kopensolaris*-gnu)
case $cc_basename in
# old Intel for x86_64 which still supported -KPIC.
ecc*)
@@ -8440,11 +8455,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:8443: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:8458: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:8447: \$? = $ac_status" >&5
+ echo "$as_me:8462: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -8545,11 +8560,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:8548: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:8563: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:8552: \$? = $ac_status" >&5
+ echo "$as_me:8567: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -8600,11 +8615,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:8603: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:8618: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:8607: \$? = $ac_status" >&5
+ echo "$as_me:8622: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -8743,6 +8758,7 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
fi
supports_anon_versioning=no
case `$LD -v 2>&1` in
+ *GNU\ gold*) supports_anon_versioning=yes ;;
*\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
*\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
*\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
@@ -8834,7 +8850,7 @@ _LT_EOF
archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
;;
- gnu* | linux* | tpf* | k*bsd*-gnu)
+ gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
tmp_diet=no
if test "$host_os" = linux-dietlibc; then
case $cc_basename in
@@ -10296,7 +10312,7 @@ linux*oldld* | linux*aout* | linux*coff*)
;;
# This must be Linux ELF.
-linux* | k*bsd*-gnu)
+linux* | k*bsd*-gnu | kopensolaris*-gnu)
version_type=linux
need_lib_prefix=no
need_version=no
@@ -10983,7 +10999,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 10986 "configure"
+#line 11002 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -11079,7 +11095,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 11082 "configure"
+#line 11098 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -11309,7 +11325,6 @@ CC="$lt_save_CC"
CPPFLAGS="${CPPFLAGS} -D_REENTRANT -D__EXTENSIONS__"
-# Checks for header files.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
$as_echo_n "checking for ANSI C header files... " >&6; }
if test "${ac_cv_header_stdc+set}" = set; then :
@@ -11482,7 +11497,6 @@ fi
done
-# Checks for typedefs, structures, and compiler characteristics.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5
$as_echo_n "checking for an ANSI C-conforming const... " >&6; }
if test "${ac_cv_c_const+set}" = set; then :
@@ -11703,7 +11717,6 @@ _ACEOF
fi
-# Checks for library functions.
for ac_header in vfork.h
do :
ac_fn_c_check_header_mongrel "$LINENO" "vfork.h" "ac_cv_header_vfork_h" "$ac_includes_default"
@@ -11918,7 +11931,6 @@ $as_echo "#define HAVE_WORKING_FORK 1" >>confdefs.h
fi
-#AC_FUNC_MMAP
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking return type of signal handlers" >&5
$as_echo_n "checking return type of signal handlers... " >&6; }
if test "${ac_cv_type_signal+set}" = set; then :
@@ -11952,8 +11964,8 @@ cat >>confdefs.h <<_ACEOF
_ACEOF
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether lstat dereferences a symlink specified with a trailing slash" >&5
-$as_echo_n "checking whether lstat dereferences a symlink specified with a trailing slash... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether lstat correctly handles trailing slash" >&5
+$as_echo_n "checking whether lstat correctly handles trailing slash... " >&6; }
if test "${ac_cv_func_lstat_dereferences_slashed_symlink+set}" = set; then :
$as_echo_n "(cached) " >&6
else
@@ -11970,7 +11982,7 @@ int
main ()
{
struct stat sbuf;
- /* Linux will dereference the symlink and fail.
+ /* Linux will dereference the symlink and fail, as required by POSIX.
That is better in the sense that it means we will not
have to compile and use the lstat wrapper. */
return lstat ("conftest.sym/", &sbuf) == 0;
@@ -12005,7 +12017,7 @@ cat >>confdefs.h <<_ACEOF
_ACEOF
-if test $ac_cv_func_lstat_dereferences_slashed_symlink = no; then
+if test "x$ac_cv_func_lstat_dereferences_slashed_symlink" = xno; then
case " $LIBOBJS " in
*" lstat.$ac_objext "* ) ;;
*) LIBOBJS="$LIBOBJS lstat.$ac_objext"
@@ -12460,7 +12472,6 @@ fi
fi
-## openssl on solaris needs -lsocket -lnsl
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing socket" >&5
$as_echo_n "checking for library containing socket... " >&6; }
if test "${ac_cv_search_socket+set}" = set; then :
@@ -14002,7 +14013,6 @@ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
- # for debian based systems
pkg_failed=no
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LUA" >&5
@@ -14065,7 +14075,6 @@ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
- # for freebsd
pkg_failed=no
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LUA" >&5
@@ -14166,7 +14175,6 @@ fi
elif test $pkg_failed = untried; then
- # for freebsd
pkg_failed=no
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LUA" >&5
@@ -14282,7 +14290,6 @@ fi
elif test $pkg_failed = untried; then
- # for debian based systems
pkg_failed=no
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LUA" >&5
@@ -14345,7 +14352,6 @@ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
- # for freebsd
pkg_failed=no
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LUA" >&5
@@ -14446,7 +14452,6 @@ fi
elif test $pkg_failed = untried; then
- # for freebsd
pkg_failed=no
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LUA" >&5
@@ -14839,8 +14844,7 @@ _ACEOF
if test "x$ac_cv_func_sendfile" = xyes; then
- # check if sendfile works
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if sendfile works" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if sendfile works" >&5
$as_echo_n "checking if sendfile works... " >&6; }
if test "x$cross_compiling" = xno; then
if test "$cross_compiling" = yes; then :
@@ -15014,7 +15018,6 @@ fi
-# check for extra compiler options (warning options)
if test "${GCC}" = "yes"; then
CFLAGS="${CFLAGS} -Wall -W -Wshadow -pedantic -std=gnu99"
fi
@@ -15577,8 +15580,8 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by lighttpd $as_me 1.4.25, which was
-generated by GNU Autoconf 2.64. Invocation command line was
+This file was extended by lighttpd $as_me 1.4.26, which was
+generated by GNU Autoconf 2.65. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
CONFIG_HEADERS = $CONFIG_HEADERS
@@ -15618,6 +15621,7 @@ Usage: $0 [OPTION]... [TAG]...
-h, --help print this help, then exit
-V, --version print version number and configuration settings, then exit
+ --config print configuration, then exit
-q, --quiet, --silent
do not print progress messages
-d, --debug don't remove temporary files
@@ -15640,10 +15644,11 @@ Report bugs to <contact@lighttpd.net>."
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-lighttpd config.status 1.4.25
-configured by $0, generated by GNU Autoconf 2.64,
- with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
+lighttpd config.status 1.4.26
+configured by $0, generated by GNU Autoconf 2.65,
+ with options \\"\$ac_cs_config\\"
Copyright (C) 2009 Free Software Foundation, Inc.
This config.status script is free software; the Free Software Foundation
@@ -15681,6 +15686,8 @@ do
ac_cs_recheck=: ;;
--version | --versio | --versi | --vers | --ver | --ve | --v | -V )
$as_echo "$ac_cs_version"; exit ;;
+ --config | --confi | --conf | --con | --co | --c )
+ $as_echo "$ac_cs_config"; exit ;;
--debug | --debu | --deb | --de | --d | -d )
debug=: ;;
--file | --fil | --fi | --f )
@@ -16134,7 +16141,7 @@ s/'"$ac_delim"'$//
t delim
:nl
h
-s/\(.\{148\}\).*/\1/
+s/\(.\{148\}\)..*/\1/
t more1
s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
p
@@ -16148,7 +16155,7 @@ s/.\{148\}//
t nl
:delim
h
-s/\(.\{148\}\).*/\1/
+s/\(.\{148\}\)..*/\1/
t more2
s/["\\]/\\&/g; s/^/"/; s/$/"/
p
@@ -17454,7 +17461,6 @@ else
disable_feature="$disable_feature $features"
fi
-# no crypt call
features="auth-crypt"
if test "$ac_cv_search_crypt" = no; then
disable_feature="$disable_feature $features"
@@ -17498,7 +17504,6 @@ else
fi
-## output
$ECHO
$ECHO "Plugins:"
diff --git a/configure.ac b/configure.ac
index 4a0571e..6f72eeb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,17 +1,19 @@
-# -*- Autoconf -*-
-# Process this file with autoconf to produce a configure script.
+dnl -*- Autoconf -*-
+dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.57)
-AC_INIT([lighttpd], [1.4.25], [contact@lighttpd.net])
+AC_INIT([lighttpd], [1.4.26], [contact@lighttpd.net])
AC_CONFIG_SRCDIR([src/server.c])
AC_CONFIG_HEADER([config.h])
AC_CONFIG_MACRO_DIR([m4])
AC_CANONICAL_TARGET
-AM_INIT_AUTOMAKE([-Wall -Wportability -Wno-override -Werror foreign dist-bzip2 tar-ustar silent-rules color-tests])
-AM_SILENT_RULES
+AM_INIT_AUTOMAKE([-Wall -Wportability -Wno-override -Werror foreign dist-bzip2 tar-ustar])
-# Checks for programs.
+dnl enable with --enable-silent-rules or make V=0 (needs automake >= 1.11)
+m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES])
+
+dnl Checks for programs.
AC_PROG_CC
AM_PROG_CC_C_O
AC_PROG_LD
@@ -30,7 +32,7 @@ AC_MINIX
dnl AC_CANONICAL_HOST
case $host_os in
*darwin*|*cygwin*|*aix*|*mingw* ) NO_RDYNAMIC=yes;;
- * ) NO_RDYNAMIC=no;;
+ * ) NO_RDYNAMIC=no;;
esac
AM_CONDITIONAL(NO_RDYNAMIC, test x$NO_RDYNAMIC = xyes)
@@ -49,7 +51,7 @@ AC_PROG_LIBTOOL
dnl for solaris
CPPFLAGS="${CPPFLAGS} -D_REENTRANT -D__EXTENSIONS__"
-# Checks for header files.
+dnl Checks for header files.
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS([arpa/inet.h fcntl.h netinet/in.h stdlib.h string.h \
@@ -58,7 +60,7 @@ getopt.h sys/epoll.h sys/select.h poll.h sys/poll.h sys/devpoll.h sys/filio.h \
sys/mman.h sys/event.h sys/port.h pwd.h sys/syslimits.h \
sys/resource.h sys/un.h syslog.h sys/prctl.h uuid/uuid.h])
-# Checks for typedefs, structures, and compiler characteristics.
+dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
AC_C_CHAR_UNSIGNED
@@ -71,10 +73,10 @@ AC_CHECK_TYPES(struct sockaddr_storage,,,[#include <sys/socket.h>])
AC_CHECK_TYPES(socklen_t,,,[#include <sys/types.h>
#include <sys/socket.h>])
-# Checks for library functions.
+dnl Checks for library functions.
AC_FUNC_FORK
dnl AC_FUNC_MALLOC
-#AC_FUNC_MMAP
+dnl AC_FUNC_MMAP
dnl AC_FUNC_REALLOC
AC_TYPE_SIGNAL
AC_FUNC_STAT
@@ -172,7 +174,7 @@ if test "$WITH_ATTR" != "no"; then
AC_SUBST(ATTR_LIB)
fi
-## openssl on solaris needs -lsocket -lnsl
+dnl openssl on solaris needs -lsocket -lnsl
AC_SEARCH_LIBS(socket,socket)
AC_SEARCH_LIBS(gethostbyname,nsl socket)
AC_SEARCH_LIBS(hstrerror,resolv)
@@ -419,12 +421,12 @@ if test "$WITH_LUA" != "no"; then
AC_DEFINE([HAVE_LUA], [1], [liblua])
AC_DEFINE([HAVE_LUA_H], [1], [lua.h])
],[
- # for debian based systems
+ dnl for debian based systems
PKG_CHECK_MODULES(LUA, lua5.1 >= 5.1, [
AC_DEFINE([HAVE_LUA], [1], [liblua])
AC_DEFINE([HAVE_LUA_H], [1], [lua.h])
],[
- # for freebsd
+ dnl for freebsd
PKG_CHECK_MODULES(LUA, lua-5.1 >= 5.1, [
AC_DEFINE([HAVE_LUA], [1], [liblua])
AC_DEFINE([HAVE_LUA_H], [1], [lua.h])
@@ -486,7 +488,7 @@ AC_CHECK_SIZEOF(long)
AC_CHECK_SIZEOF(off_t)
if test "x$ac_cv_func_sendfile" = xyes; then
- # check if sendfile works
+ dnl check if sendfile works
AC_MSG_CHECKING(if sendfile works)
if test "x$cross_compiling" = xno; then
AC_TRY_RUN([
@@ -544,7 +546,7 @@ AC_CHECK_LIB(fcgi, FCGI_Accept, [
AM_CONDITIONAL(CHECK_WITH_FASTCGI, test "x$fastcgi_found" = xyes)
-# check for extra compiler options (warning options)
+dnl check for extra compiler options (warning options)
if test "${GCC}" = "yes"; then
CFLAGS="${CFLAGS} -Wall -W -Wshadow -pedantic -std=gnu99"
fi
@@ -645,7 +647,7 @@ else
disable_feature="$disable_feature $features"
fi
-# no crypt call
+dnl no crypt call
features="auth-crypt"
if test "$ac_cv_search_crypt" = no; then
disable_feature="$disable_feature $features"
@@ -689,7 +691,7 @@ else
fi
-## output
+dnl output
$ECHO
$ECHO "Plugins:"
diff --git a/doc/Makefile.in b/doc/Makefile.in
index 7a3fd13..9f0e303 100644
--- a/doc/Makefile.in
+++ b/doc/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11 from Makefile.am.
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
diff --git a/ltmain.sh b/ltmain.sh
index 3506ead..d88da2c 100755
--- a/ltmain.sh
+++ b/ltmain.sh
@@ -1,6 +1,6 @@
# Generated from ltmain.m4sh.
-# ltmain.sh (GNU libtool) 2.2.6
+# ltmain.sh (GNU libtool) 2.2.6b
# Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007 2008 Free Software Foundation, Inc.
@@ -65,7 +65,7 @@
# compiler: $LTCC
# compiler flags: $LTCFLAGS
# linker: $LD (gnu? $with_gnu_ld)
-# $progname: (GNU libtool) 2.2.6 Debian-2.2.6a-4
+# $progname: (GNU libtool) 2.2.6b Debian-2.2.6b-2
# automake: $automake_version
# autoconf: $autoconf_version
#
@@ -73,9 +73,9 @@
PROGRAM=ltmain.sh
PACKAGE=libtool
-VERSION="2.2.6 Debian-2.2.6a-4"
+VERSION="2.2.6b Debian-2.2.6b-2"
TIMESTAMP=""
-package_revision=1.3012
+package_revision=1.3017
# Be Bourne compatible
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
diff --git a/m4/libtool.m4 b/m4/libtool.m4
index 1e7ea47..a3fee53 100644
--- a/m4/libtool.m4
+++ b/m4/libtool.m4
@@ -2445,7 +2445,7 @@ linux*oldld* | linux*aout* | linux*coff*)
;;
# This must be Linux ELF.
-linux* | k*bsd*-gnu)
+linux* | k*bsd*-gnu | kopensolaris*-gnu)
version_type=linux
need_lib_prefix=no
need_version=no
@@ -3084,7 +3084,7 @@ irix5* | irix6* | nonstopux*)
;;
# This must be Linux ELF.
-linux* | k*bsd*-gnu)
+linux* | k*bsd*-gnu | kopensolaris*-gnu)
lt_cv_deplibs_check_method=pass_all
;;
@@ -3705,7 +3705,7 @@ m4_if([$1], [CXX], [
;;
esac
;;
- linux* | k*bsd*-gnu)
+ linux* | k*bsd*-gnu | kopensolaris*-gnu)
case $cc_basename in
KCC*)
# KAI C++ Compiler
@@ -3989,7 +3989,7 @@ m4_if([$1], [CXX], [
_LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
;;
- linux* | k*bsd*-gnu)
+ linux* | k*bsd*-gnu | kopensolaris*-gnu)
case $cc_basename in
# old Intel for x86_64 which still supported -KPIC.
ecc*)
@@ -4285,6 +4285,7 @@ dnl Note also adjust exclude_expsyms for C++ above.
fi
supports_anon_versioning=no
case `$LD -v 2>&1` in
+ *GNU\ gold*) supports_anon_versioning=yes ;;
*\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
*\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
*\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
@@ -4376,7 +4377,7 @@ _LT_EOF
_LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
;;
- gnu* | linux* | tpf* | k*bsd*-gnu)
+ gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
tmp_diet=no
if test "$host_os" = linux-dietlibc; then
case $cc_basename in
@@ -5860,7 +5861,7 @@ if test "$_lt_caught_CXX_error" != yes; then
_LT_TAGVAR(inherit_rpath, $1)=yes
;;
- linux* | k*bsd*-gnu)
+ linux* | k*bsd*-gnu | kopensolaris*-gnu)
case $cc_basename in
KCC*)
# Kuck and Associates, Inc. (KAI) C++ Compiler
diff --git a/m4/ltversion.m4 b/m4/ltversion.m4
index b8e154f..f3c5309 100644
--- a/m4/ltversion.m4
+++ b/m4/ltversion.m4
@@ -9,15 +9,15 @@
# Generated from ltversion.in.
-# serial 3012 ltversion.m4
+# serial 3017 ltversion.m4
# This file is part of GNU Libtool
-m4_define([LT_PACKAGE_VERSION], [2.2.6])
-m4_define([LT_PACKAGE_REVISION], [1.3012])
+m4_define([LT_PACKAGE_VERSION], [2.2.6b])
+m4_define([LT_PACKAGE_REVISION], [1.3017])
AC_DEFUN([LTVERSION_VERSION],
-[macro_version='2.2.6'
-macro_revision='1.3012'
+[macro_version='2.2.6b'
+macro_revision='1.3017'
_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
_LT_DECL(, macro_revision, 0)
])
diff --git a/src/Makefile.in b/src/Makefile.in
index 03daa9b..1af1f5f 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11 from Makefile.am.
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
diff --git a/src/base.h b/src/base.h
index d14c090..4243bd2 100644
--- a/src/base.h
+++ b/src/base.h
@@ -431,7 +431,6 @@ typedef struct {
#ifdef USE_OPENSSL
SSL *ssl;
- buffer *ssl_error_want_reuse_buffer;
# ifndef OPENSSL_NO_TLSEXT
buffer *tlsext_server_name;
# endif
diff --git a/src/chunk.c b/src/chunk.c
index 0cc26da..7583db6 100644
--- a/src/chunk.c
+++ b/src/chunk.c
@@ -197,8 +197,6 @@ int chunkqueue_append_buffer(chunkqueue *cq, buffer *mem) {
int chunkqueue_append_buffer_weak(chunkqueue *cq, buffer *mem) {
chunk *c;
- if (mem->used == 0) return 0;
-
c = chunkqueue_get_unused_chunk(cq);
c->type = MEM_CHUNK;
c->offset = 0;
diff --git a/src/connections.c b/src/connections.c
index 84adb86..27e9a98 100644
--- a/src/connections.c
+++ b/src/connections.c
@@ -192,40 +192,42 @@ static void dump_packet(const unsigned char *data, size_t len) {
static int connection_handle_read_ssl(server *srv, connection *con) {
#ifdef USE_OPENSSL
- int r, ssl_err, len, count = 0;
+ int r, ssl_err, len, count = 0, read_offset, toread;
buffer *b = NULL;
if (!con->conf.is_ssl) return -1;
- /* don't resize the buffer if we were in SSL_ERROR_WANT_* */
-
ERR_clear_error();
do {
- if (!con->ssl_error_want_reuse_buffer) {
- b = buffer_init();
- buffer_prepare_copy(b, SSL_pending(con->ssl) + (16 * 1024)); /* the pending bytes + 16kb */
+ if (NULL != con->read_queue->last) {
+ b = con->read_queue->last->mem;
+ }
+
+ if (NULL == b || b->size - b->used < 1024) {
+ b = chunkqueue_get_append_buffer(con->read_queue);
+ len = SSL_pending(con->ssl);
+ if (len < 4*1024) len = 4*1024; /* always alloc >= 4k buffer */
+ buffer_prepare_copy(b, len + 1);
/* overwrite everything with 0 */
memset(b->ptr, 0, b->size);
- } else {
- b = con->ssl_error_want_reuse_buffer;
}
- len = SSL_read(con->ssl, b->ptr, b->size - 1);
- con->ssl_error_want_reuse_buffer = NULL; /* reuse it only once */
+ read_offset = (b->used > 0) ? b->used - 1 : 0;
+ toread = b->size - 1 - read_offset;
+
+ len = SSL_read(con->ssl, b->ptr + read_offset, toread);
if (len > 0) {
- b->used = len;
+ if (b->used > 0) b->used--;
+ b->used += len;
b->ptr[b->used++] = '\0';
- /* we move the buffer to the chunk-queue, no need to free it */
+ con->bytes_read += len;
- chunkqueue_append_buffer_weak(con->read_queue, b);
count += len;
- con->bytes_read += len;
- b = NULL;
}
- } while (len > 0 && count < MAX_READ_LIMIT);
+ } while (len == toread && count < MAX_READ_LIMIT);
if (len < 0) {
@@ -234,11 +236,11 @@ static int connection_handle_read_ssl(server *srv, connection *con) {
case SSL_ERROR_WANT_READ:
case SSL_ERROR_WANT_WRITE:
con->is_readable = 0;
- con->ssl_error_want_reuse_buffer = b;
- b = NULL;
+ /* the manual says we have to call SSL_read with the same arguments next time.
+ * we ignore this restriction; no one has complained about it in 1.5 yet, so it probably works anyway.
+ */
- /* we have to steal the buffer from the queue-queue */
return 0;
case SSL_ERROR_SYSCALL:
/**
@@ -297,16 +299,11 @@ static int connection_handle_read_ssl(server *srv, connection *con) {
connection_set_state(srv, con, CON_STATE_ERROR);
- buffer_free(b);
-
return -1;
} else if (len == 0) {
con->is_readable = 0;
/* the other end close the connection -> KEEP-ALIVE */
- /* pipelining */
- buffer_free(b);
-
return -2;
}
@@ -321,26 +318,41 @@ static int connection_handle_read_ssl(server *srv, connection *con) {
static int connection_handle_read(server *srv, connection *con) {
int len;
buffer *b;
- int toread;
+ int toread, read_offset;
if (con->conf.is_ssl) {
return connection_handle_read_ssl(srv, con);
}
+ b = (NULL != con->read_queue->last) ? con->read_queue->last->mem : NULL;
+
+ /* default size for chunks is 4kb; only use bigger chunks if FIONREAD tells
+ * us more than 4kb is available
+ * if FIONREAD doesn't signal a big chunk we fill the previous buffer
+ * if it has >= 1kb free
+ */
#if defined(__WIN32)
- b = chunkqueue_get_append_buffer(con->read_queue);
- buffer_prepare_copy(b, 4 * 1024);
- len = recv(con->fd, b->ptr, b->size - 1, 0);
-#else
- if (ioctl(con->fd, FIONREAD, &toread) || toread == 0) {
+ if (NULL == b || b->size - b->used < 1024) {
b = chunkqueue_get_append_buffer(con->read_queue);
buffer_prepare_copy(b, 4 * 1024);
+ }
+
+ read_offset = (b->used == 0) ? 0 : b->used - 1;
+ len = recv(con->fd, b->ptr + read_offset, b->size - 1 - read_offset, 0);
+#else
+ if (ioctl(con->fd, FIONREAD, &toread) || toread == 0 || toread <= 4*1024) {
+ if (NULL == b || b->size - b->used < 1024) {
+ b = chunkqueue_get_append_buffer(con->read_queue);
+ buffer_prepare_copy(b, 4 * 1024);
+ }
} else {
if (toread > MAX_READ_LIMIT) toread = MAX_READ_LIMIT;
b = chunkqueue_get_append_buffer(con->read_queue);
buffer_prepare_copy(b, toread + 1);
}
- len = read(con->fd, b->ptr, b->size - 1);
+
+ read_offset = (b->used == 0) ? 0 : b->used - 1;
+ len = read(con->fd, b->ptr + read_offset, b->size - 1 - read_offset);
#endif
if (len < 0) {
@@ -374,7 +386,8 @@ static int connection_handle_read(server *srv, connection *con) {
con->is_readable = 0;
}
- b->used = len;
+ if (b->used > 0) b->used--;
+ b->used += len;
b->ptr[b->used++] = '\0';
con->bytes_read += len;
@@ -850,13 +863,6 @@ int connection_reset(server *srv, connection *con) {
/* The cond_cache gets reset in response.c */
/* config_cond_cache_reset(srv, con); */
-#ifdef USE_OPENSSL
- if (con->ssl_error_want_reuse_buffer) {
- buffer_free(con->ssl_error_want_reuse_buffer);
- con->ssl_error_want_reuse_buffer = NULL;
- }
-#endif
-
con->header_len = 0;
con->in_error_handler = 0;
@@ -945,62 +951,50 @@ static int connection_handle_read_state(server *srv, connection *con) {
last_chunk = NULL;
last_offset = 0;
- for (c = cq->first; !last_chunk && c; c = c->next) {
+ for (c = cq->first; c; c = c->next) {
buffer b;
size_t i;
b.ptr = c->mem->ptr + c->offset;
b.used = c->mem->used - c->offset;
+ if (b.used > 0) b.used--; /* buffer "used" includes terminating zero */
- for (i = 0; !last_chunk && i < b.used; i++) {
+ for (i = 0; i < b.used; i++) {
char ch = b.ptr[i];
- size_t have_chars = 0;
-
- switch (ch) {
- case '\r':
- /* we have to do a 4 char lookup */
- have_chars = b.used - i - 1;
- if (have_chars >= 4) {
- /* all chars are in this buffer */
-
- if (0 == strncmp(b.ptr + i, "\r\n\r\n", 4)) {
- /* found */
- last_chunk = c;
- last_offset = i + 4;
-
- break;
- }
- } else {
- chunk *lookahead_chunk = c->next;
- size_t missing_chars;
- /* looks like the following chars are not in the same chunk */
-
- missing_chars = 4 - have_chars;
-
- if (lookahead_chunk && lookahead_chunk->type == MEM_CHUNK) {
- /* is the chunk long enough to contain the other chars ? */
-
- if (lookahead_chunk->mem->used > missing_chars) {
- if (0 == strncmp(b.ptr + i, "\r\n\r\n", have_chars) &&
- 0 == strncmp(lookahead_chunk->mem->ptr, "\r\n\r\n" + have_chars, missing_chars)) {
-
- last_chunk = lookahead_chunk;
- last_offset = missing_chars;
-
- break;
+ if ('\r' == ch) {
+ /* chec if \n\r\n follows */
+ size_t j = i+1;
+ chunk *cc = c;
+ const char header_end[] = "\r\n\r\n";
+ int header_end_match_pos = 1;
+
+ for ( ; cc; cc = cc->next, j = 0 ) {
+ buffer bb;
+ bb.ptr = cc->mem->ptr + cc->offset;
+ bb.used = cc->mem->used - cc->offset;
+ if (bb.used > 0) bb.used--; /* buffer "used" includes terminating zero */
+
+ for ( ; j < bb.used; j++) {
+ ch = bb.ptr[j];
+
+ if (ch == header_end[header_end_match_pos]) {
+ header_end_match_pos++;
+ if (4 == header_end_match_pos) {
+ last_chunk = cc;
+ last_offset = j+1;
+ goto found_header_end;
}
} else {
- /* a splited \r \n */
- break;
+ goto reset_search;
}
}
}
-
- break;
}
+reset_search: ;
}
}
+found_header_end:
/* found */
if (last_chunk) {
@@ -1140,8 +1134,15 @@ static int connection_handle_read_state(server *srv, connection *con) {
} else {
buffer *b;
- b = chunkqueue_get_append_buffer(dst_cq);
- buffer_copy_string_len(b, c->mem->ptr + c->offset, toRead);
+ if (dst_cq->last &&
+ dst_cq->last->type == MEM_CHUNK) {
+ b = dst_cq->last->mem;
+ } else {
+ b = chunkqueue_get_append_buffer(dst_cq);
+ /* prepare buffer size for remaining POST data; is < 64kb */
+ buffer_prepare_copy(b, con->request.content_length - dst_cq->bytes_in + 1);
+ }
+ buffer_append_string_len(b, c->mem->ptr + c->offset, toRead);
}
c->offset += toRead;
@@ -1244,28 +1245,12 @@ static handler_t connection_handle_fdevent(void *s, void *context, int revents)
if (con->state == CON_STATE_CLOSE) {
/* flush the read buffers */
- int b;
-
- if (ioctl(con->fd, FIONREAD, &b)) {
- log_error_write(srv, __FILE__, __LINE__, "ss",
- "ioctl() failed", strerror(errno));
- }
+ int len;
+ char buf[1024];
- if (b > 0) {
- char buf[1024];
-#if 0
- log_error_write(srv, __FILE__, __LINE__, "sdd",
- "CLOSE-read()", con->fd, b);
-#endif
-
- /* */
- read(con->fd, buf, sizeof(buf));
- } else {
- /* nothing to read - yet. But that doesn't
- * mean something won't show up in our buffers
- * sometime soon, so we can't quite until
- * poll() gives us the HUP notification.
- */
+ len = read(con->fd, buf, sizeof(buf));
+ if (len == 0 || (len < 0 && errno != EAGAIN && errno != EINTR) ) {
+ con->close_timeout_ts = srv->cur_ts - (HTTP_LINGER_TIMEOUT+1);
}
}
@@ -1387,7 +1372,6 @@ int connection_state_machine(server *srv, connection *con) {
while (done == 0) {
size_t ostate = con->state;
- int b;
switch (con->state) {
case CON_STATE_REQUEST_START: /* transient */
@@ -1620,25 +1604,14 @@ int connection_state_machine(server *srv, connection *con) {
* still have unread data, and closing before reading
* it will make the client not see all our output.
*/
- if (ioctl(con->fd, FIONREAD, &b)) {
- log_error_write(srv, __FILE__, __LINE__, "ss",
- "ioctl() failed", strerror(errno));
- }
- if (b > 0) {
+ {
+ int len;
char buf[1024];
-#if 0
- log_error_write(srv, __FILE__, __LINE__, "sdd",
- "CLOSE-read()", con->fd, b);
-#endif
- /* */
- read(con->fd, buf, sizeof(buf));
- } else {
- /* nothing to read - yet. But that doesn't
- * mean something won't show up in our buffers
- * sometime soon, so we can't quite until
- * poll() gives us the HUP notification.
- */
+ len = read(con->fd, buf, sizeof(buf));
+ if (len == 0 || (len < 0 && errno != EAGAIN && errno != EINTR) ) {
+ con->close_timeout_ts = srv->cur_ts - (HTTP_LINGER_TIMEOUT+1);
+ }
}
if (srv->cur_ts - con->close_timeout_ts > HTTP_LINGER_TIMEOUT) {
diff --git a/src/mod_accesslog.c b/src/mod_accesslog.c
index b6e3814..07cb82e 100644
--- a/src/mod_accesslog.c
+++ b/src/mod_accesslog.c
@@ -788,6 +788,13 @@ REQUESTDONE_FUNC(log_access_write) {
buffer_append_string_len(b, CONST_STR_LEN("-"));
}
break;
+ case FORMAT_ENV:
+ if (NULL != (ds = (data_string *)array_get_element(con->environment, p->conf.parsed_format->ptr[j]->string->ptr))) {
+ accesslog_append_escaped(b, ds->value);
+ } else {
+ buffer_append_string_len(b, CONST_STR_LEN("-"));
+ }
+ break;
case FORMAT_FILENAME:
if (con->physical.path->used > 1) {
buffer_append_string_buffer(b, con->physical.path);
@@ -864,7 +871,6 @@ REQUESTDONE_FUNC(log_access_write) {
{ 'A', FORMAT_LOCAL_ADDR },
{ 'C', FORMAT_COOKIE },
{ 'D', FORMAT_TIME_USED_MS },
- { 'e', FORMAT_ENV },
*/
break;
diff --git a/src/mod_cgi.c b/src/mod_cgi.c
index 47bbbbe..dd2b9bc 100644
--- a/src/mod_cgi.c
+++ b/src/mod_cgi.c
@@ -747,6 +747,8 @@ static int cgi_create_env(server *srv, connection *con, plugin_data *p, buffer *
}
if (pipe(from_cgi_fds)) {
+ close(to_cgi_fds[0]);
+ close(to_cgi_fds[1]);
log_error_write(srv, __FILE__, __LINE__, "ss", "pipe failed:", strerror(errno));
return -1;
}
@@ -1035,6 +1037,10 @@ static int cgi_create_env(server *srv, connection *con, plugin_data *p, buffer *
case -1:
/* error */
log_error_write(srv, __FILE__, __LINE__, "ss", "fork failed:", strerror(errno));
+ close(from_cgi_fds[0]);
+ close(from_cgi_fds[1]);
+ close(to_cgi_fds[0]);
+ close(to_cgi_fds[1]);
return -1;
break;
default: {
@@ -1181,6 +1187,7 @@ static int mod_cgi_patch_connection(server *srv, connection *con, plugin_data *p
plugin_config *s = p->config_storage[0];
PATCH(cgi);
+ PATCH(execute_x_only);
/* skip the first, the global context */
for (i = 1; i < srv->config_context->used; i++) {
diff --git a/src/mod_fastcgi.c b/src/mod_fastcgi.c
index 269572f..dfc605e 100644
--- a/src/mod_fastcgi.c
+++ b/src/mod_fastcgi.c
@@ -2307,6 +2307,9 @@ static int fcgi_response_parse(server *srv, connection *con, plugin_data *p, buf
filename = pos;
if (NULL == (range = strchr(pos, ' '))) {
/* missing range */
+ if (p->conf.debug) {
+ log_error_write(srv, __FILE__, __LINE__, "ss", "Couldn't find range after filename:", filename);
+ }
return 1;
}
buffer_copy_string_len(srv->tmp_buf, filename, range - filename);
@@ -2338,14 +2341,24 @@ static int fcgi_response_parse(server *srv, connection *con, plugin_data *p, buf
char *rpos = NULL;
errno = 0;
begin_range = strtoll(range, &rpos, 10);
- if (errno != 0 || begin_range < 0 || rpos == range) return 1;
- if ('-' != *rpos++) return 1;
+ if (errno != 0 || begin_range < 0 || rpos == range) goto range_failed;
+ if ('-' != *rpos++) goto range_failed;
if (rpos != pos) {
range = rpos;
end_range = strtoll(range, &rpos, 10);
- if (errno != 0 || end_range < 0 || rpos == range) return 1;
+ if (errno != 0 || end_range < 0 || rpos == range) goto range_failed;
+ }
+ if (rpos != pos) goto range_failed;
+
+ goto range_success;
+
+range_failed:
+ if (p->conf.debug) {
+ log_error_write(srv, __FILE__, __LINE__, "ss", "Couldn't decode range after filename:", filename);
}
- if (rpos != pos) return 1;
+ return 1;
+
+range_success: ;
}
/* no parameters accepted */
diff --git a/src/mod_proxy.c b/src/mod_proxy.c
index 33ac1d8..6a8b8b1 100644
--- a/src/mod_proxy.c
+++ b/src/mod_proxy.c
@@ -1047,11 +1047,32 @@ static handler_t proxy_handle_fdevent(void *s, void *ctx, int revents) {
*
*/
- proxy_connection_close(srv, hctx);
- joblist_append(srv, con);
+ if (hctx->host) {
+ hctx->host->is_disabled = 1;
+ hctx->host->disable_ts = srv->cur_ts;
+ log_error_write(srv, __FILE__, __LINE__, "sbdd", "proxy-server disabled:",
+ hctx->host->host,
+ hctx->host->port,
+ hctx->fd);
+
+ /* disable this server */
+ hctx->host->is_disabled = 1;
+ hctx->host->disable_ts = srv->cur_ts;
+
+ proxy_connection_close(srv, hctx);
+
+ /* reset the enviroment and restart the sub-request */
+ buffer_reset(con->physical.path);
+ con->mode = DIRECT;
- con->http_status = 503;
- con->mode = DIRECT;
+ joblist_append(srv, con);
+ } else {
+ proxy_connection_close(srv, hctx);
+ joblist_append(srv, con);
+
+ con->mode = DIRECT;
+ con->http_status = 503;
+ }
return HANDLER_FINISHED;
}
diff --git a/src/mod_redirect.c b/src/mod_redirect.c
index 7a0f82a..976d845 100644
--- a/src/mod_redirect.c
+++ b/src/mod_redirect.c
@@ -210,7 +210,7 @@ static handler_t mod_redirect_uri_handler(server *srv, connection *con, void *p_
buffer_reset(p->location);
start = 0;
- for (k = 0; k < pattern_len; k++) {
+ for (k = 0; k + 1 < pattern_len; k++) {
if (pattern[k] == '$' || pattern[k] == '%') {
/* got one */
diff --git a/src/mod_rewrite.c b/src/mod_rewrite.c
index 0888b2f..058e756 100644
--- a/src/mod_rewrite.c
+++ b/src/mod_rewrite.c
@@ -394,7 +394,7 @@ static int process_rewrite_rules(server *srv, connection *con, plugin_data *p, r
buffer_reset(con->request.uri);
start = 0;
- for (k = 0; k < pattern_len; k++) {
+ for (k = 0; k+1 < pattern_len; k++) {
if (pattern[k] == '$' || pattern[k] == '%') {
/* got one */
diff --git a/tests/LightyTest.pm b/tests/LightyTest.pm
index 19f0162..ebdfd36 100755
--- a/tests/LightyTest.pm
+++ b/tests/LightyTest.pm
@@ -76,7 +76,7 @@ sub stop_proc {
kill('TERM', $pid) or return -1;
return -1 if ($pid != waitpid($pid, 0));
} else {
- diag("Process not started, nothing to stop");
+ diag("\nProcess not started, nothing to stop");
return -1;
}
@@ -98,7 +98,7 @@ sub wait_for_port_with_proc {
return -1;
}
if (0 >= $timeout) {
- diag("Timeout while trying to connect; killing child");
+ diag("\nTimeout while trying to connect; killing child");
kill('TERM', $child);
return -1;
}
@@ -128,10 +128,10 @@ sub start_proc {
} elsif (defined $ENV{"TRACEME"} && $ENV{"TRACEME"} eq 'valgrind') {
$cmdline = "valgrind --tool=memcheck --show-reachable=yes --leak-check=yes --log-file=valgrind ".$cmdline;
}
- # diag("starting lighttpd at :".$self->{PORT}.", cmdline: ".$cmdline );
+ # diag("\nstarting lighttpd at :".$self->{PORT}.", cmdline: ".$cmdline );
my $child = fork();
if (not defined $child) {
- diag("Fork failed");
+ diag("\nFork failed");
return -1;
}
if ($child == 0) {
@@ -139,7 +139,7 @@ sub start_proc {
}
if (0 != $self->wait_for_port_with_proc($self->{PORT}, $child)) {
- diag(sprintf('The process %i is not up', $child));
+ diag(sprintf('\nThe process %i is not up', $child));
return -1;
}
@@ -157,6 +157,7 @@ sub handle_http {
my @request = $t->{REQUEST};
my @response = $t->{RESPONSE};
+ my $slow = defined $t->{SLOWREQUEST};
my $is_debug = $ENV{"TRACE_HTTP"};
my $remote =
@@ -165,33 +166,56 @@ sub handle_http {
PeerPort => $self->{PORT});
if (not defined $remote) {
- diag("connect failed: $!");
+ diag("\nconnect failed: $!");
return -1;
}
$remote->autoflush(1);
- diag("sending request header to ".$host.":".$self->{PORT}) if $is_debug;
- foreach(@request) {
- # pipeline requests
- s/\r//g;
- s/\n/$EOL/g;
+ if (!$slow) {
+ diag("\nsending request header to ".$host.":".$self->{PORT}) if $is_debug;
+ foreach(@request) {
+ # pipeline requests
+ s/\r//g;
+ s/\n/$EOL/g;
- print $remote $_.$BLANK;
- diag("<< ".$_) if $is_debug;
+ print $remote $_.$BLANK;
+ diag("\n<< ".$_) if $is_debug;
+ }
+ shutdown($remote, 1); # I've stopped writing data
+ } else {
+ diag("\nsending request header to ".$host.":".$self->{PORT}) if $is_debug;
+ foreach(@request) {
+ # pipeline requests
+ chomp;
+ s/\r//g;
+ s/\n/$EOL/g;
+
+ print $remote $_;
+ diag("<< ".$_."\n") if $is_debug;
+ select(undef, undef, undef, 0.1);
+ print $remote "\015";
+ select(undef, undef, undef, 0.1);
+ print $remote "\012";
+ select(undef, undef, undef, 0.1);
+ print $remote "\015";
+ select(undef, undef, undef, 0.1);
+ print $remote "\012";
+ select(undef, undef, undef, 0.1);
+ }
+
}
- shutdown($remote, 1); # I've stopped writing data
- diag("... done") if $is_debug;
+ diag("\n... done") if $is_debug;
my $lines = "";
- diag("receiving response") if $is_debug;
+ diag("\nreceiving response") if $is_debug;
# read everything
while(<$remote>) {
$lines .= $_;
diag(">> ".$_) if $is_debug;
}
- diag("... done") if $is_debug;
+ diag("\n... done") if $is_debug;
close $remote;
@@ -209,7 +233,7 @@ sub handle_http {
(my $line, $lines) = split($EOL, $lines, 2);
# header finished
- last if(length($line) == 0);
+ last if(!defined $line or length($line) == 0);
if ($ln == 0) {
# response header
@@ -221,21 +245,21 @@ sub handle_http {
(my $h = $1) =~ tr/[A-Z]/[a-z]/;
if (defined $resp_hdr{$h}) {
-# diag(sprintf("header '%s' is duplicated: '%s' and '%s'\n",
+# diag(sprintf("\nheader '%s' is duplicated: '%s' and '%s'\n",
# $h, $resp_hdr{$h}, $2));
$resp_hdr{$h} .= ', '.$2;
} else {
$resp_hdr{$h} = $2;
}
} else {
- diag(sprintf("unexpected line '%s'\n", $line));
+ diag(sprintf("\nunexpected line '%s'", $line));
return -1;
}
}
}
if (not defined($resp_line)) {
- diag(sprintf("empty response\n"));
+ diag(sprintf("\nempty response"));
return -1;
}
@@ -259,29 +283,29 @@ sub handle_http {
# check conditions
if ($resp_line =~ /^(HTTP\/1\.[01]) ([0-9]{3}) .+$/) {
if ($href->{'HTTP-Protocol'} ne $1) {
- diag(sprintf("proto failed: expected '%s', got '%s'\n", $href->{'HTTP-Protocol'}, $1));
+ diag(sprintf("\nproto failed: expected '%s', got '%s'", $href->{'HTTP-Protocol'}, $1));
return -1;
}
if ($href->{'HTTP-Status'} ne $2) {
- diag(sprintf("status failed: expected '%s', got '%s'\n", $href->{'HTTP-Status'}, $2));
+ diag(sprintf("\nstatus failed: expected '%s', got '%s'", $href->{'HTTP-Status'}, $2));
return -1;
}
} else {
- diag(sprintf("unexpected resp_line '%s'\n", $resp_line));
+ diag(sprintf("\nunexpected resp_line '%s'", $resp_line));
return -1;
}
if (defined $href->{'HTTP-Content'}) {
$resp_body = "" unless defined $resp_body;
if ($href->{'HTTP-Content'} ne $resp_body) {
- diag(sprintf("body failed: expected '%s', got '%s'\n", $href->{'HTTP-Content'}, $resp_body));
+ diag(sprintf("\nbody failed: expected '%s', got '%s'", $href->{'HTTP-Content'}, $resp_body));
return -1;
}
}
if (defined $href->{'-HTTP-Content'}) {
if (defined $resp_body && $resp_body ne '') {
- diag(sprintf("body failed: expected empty body, got '%s'\n", $resp_body));
+ diag(sprintf("\nbody failed: expected empty body, got '%s'", $resp_body));
return -1;
}
}
@@ -309,12 +333,12 @@ sub handle_http {
if ($key_inverted) {
if (defined $resp_hdr{$k}) {
- diag(sprintf("header '%s' MUST not be set\n", $k));
+ diag(sprintf("\nheader '%s' MUST not be set", $k));
return -1;
}
} else {
if (not defined $resp_hdr{$k}) {
- diag(sprintf("required header '%s' is missing\n", $k));
+ diag(sprintf("\nrequired header '%s' is missing", $k));
return -1;
}
}
@@ -322,12 +346,12 @@ sub handle_http {
if ($verify_value) {
if ($href->{$_} =~ /^\/(.+)\/$/) {
if ($resp_hdr{$k} !~ /$1/) {
- diag(sprintf("response-header failed: expected '%s', got '%s', regex: %s\n",
+ diag(sprintf("\nresponse-header failed: expected '%s', got '%s', regex: %s",
$href->{$_}, $resp_hdr{$k}, $1));
return -1;
}
} elsif ($href->{$_} ne $resp_hdr{$k}) {
- diag(sprintf("response-header failed: expected '%s', got '%s'\n",
+ diag(sprintf("\nresponse-header failed: expected '%s', got '%s'",
$href->{$_}, $resp_hdr{$k}));
return -1;
}
@@ -337,7 +361,7 @@ sub handle_http {
# we should have sucked up everything
if (defined $lines) {
- diag(sprintf("unexpected lines '%s'\n", $lines));
+ diag(sprintf("\nunexpected lines '%s'", $lines));
return -1;
}
@@ -348,7 +372,7 @@ sub spawnfcgi {
my ($self, $binary, $port) = @_;
my $child = fork();
if (not defined $child) {
- diag("Couldn't fork\n");
+ diag("\nCouldn't fork");
return -1;
}
if ($child == 0) {
@@ -362,7 +386,7 @@ sub spawnfcgi {
exec $binary or die($?);
} else {
if (0 != $self->wait_for_port_with_proc($port, $child)) {
- diag(sprintf('The process %i is not up (port %i, %s)', $child, $port, $binary));
+ diag(sprintf("\nThe process %i is not up (port %i, %s)", $child, $port, $binary));
return -1;
}
return $child;
diff --git a/tests/Makefile.in b/tests/Makefile.in
index 0f2bba5..2a15119 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11 from Makefile.am.
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -104,21 +104,8 @@ AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
distdir
ETAGS = etags
CTAGS = ctags
-# If stdout is a non-dumb tty, use colors. If test -t is not supported,
-# then this fails; a conservative approach. Of course do not redirect
-# stdout here, just stderr.
am__tty_colors = \
-red=; grn=; lgn=; blu=; std=; \
-test "X$(AM_COLOR_TESTS)" != Xno \
-&& test "X$$TERM" != Xdumb \
-&& { test "X$(AM_COLOR_TESTS)" = Xalways || test -t 1 2>/dev/null; } \
-&& { \
- red=''; \
- grn=''; \
- lgn=''; \
- blu=''; \
- std=''; \
-}
+red=; grn=; lgn=; blu=; std=
DIST_SUBDIRS = $(SUBDIRS)
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
am__relativize = \
@@ -444,7 +431,7 @@ clean-libtool:
# (which will cause the Makefiles to be regenerated when you run `make');
# (2) otherwise, pass the desired values on the `make' command line.
$(RECURSIVE_TARGETS):
- @failcom='exit 1'; \
+ @fail= failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
@@ -469,7 +456,7 @@ $(RECURSIVE_TARGETS):
fi; test -z "$$fail"
$(RECURSIVE_CLEAN_TARGETS):
- @failcom='exit 1'; \
+ @fail= failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
diff --git a/tests/docroot/123/Makefile.in b/tests/docroot/123/Makefile.in
index 48640b5..51ef0f2 100644
--- a/tests/docroot/123/Makefile.in
+++ b/tests/docroot/123/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11 from Makefile.am.
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
diff --git a/tests/docroot/Makefile.in b/tests/docroot/Makefile.in
index caa017c..7782a33 100644
--- a/tests/docroot/Makefile.in
+++ b/tests/docroot/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11 from Makefile.am.
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -287,7 +287,7 @@ clean-libtool:
# (which will cause the Makefiles to be regenerated when you run `make');
# (2) otherwise, pass the desired values on the `make' command line.
$(RECURSIVE_TARGETS):
- @failcom='exit 1'; \
+ @fail= failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
@@ -312,7 +312,7 @@ $(RECURSIVE_TARGETS):
fi; test -z "$$fail"
$(RECURSIVE_CLEAN_TARGETS):
- @failcom='exit 1'; \
+ @fail= failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
diff --git a/tests/docroot/www/Makefile.in b/tests/docroot/www/Makefile.in
index 4bc2422..b670fdb 100644
--- a/tests/docroot/www/Makefile.in
+++ b/tests/docroot/www/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11 from Makefile.am.
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -292,7 +292,7 @@ clean-libtool:
# (which will cause the Makefiles to be regenerated when you run `make');
# (2) otherwise, pass the desired values on the `make' command line.
$(RECURSIVE_TARGETS):
- @failcom='exit 1'; \
+ @fail= failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
@@ -317,7 +317,7 @@ $(RECURSIVE_TARGETS):
fi; test -z "$$fail"
$(RECURSIVE_CLEAN_TARGETS):
- @failcom='exit 1'; \
+ @fail= failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
diff --git a/tests/docroot/www/expire/Makefile.in b/tests/docroot/www/expire/Makefile.in
index b578612..f36fc1b 100644
--- a/tests/docroot/www/expire/Makefile.in
+++ b/tests/docroot/www/expire/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11 from Makefile.am.
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
diff --git a/tests/docroot/www/go/Makefile.in b/tests/docroot/www/go/Makefile.in
index cbba39f..cba6259 100644
--- a/tests/docroot/www/go/Makefile.in
+++ b/tests/docroot/www/go/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11 from Makefile.am.
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
diff --git a/tests/docroot/www/indexfile/Makefile.in b/tests/docroot/www/indexfile/Makefile.in
index b42f571..a255bad 100644
--- a/tests/docroot/www/indexfile/Makefile.in
+++ b/tests/docroot/www/indexfile/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11 from Makefile.am.
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
diff --git a/tests/request.t b/tests/request.t
index 0a35f57..1960f5d 100755
--- a/tests/request.t
+++ b/tests/request.t
@@ -8,7 +8,7 @@ BEGIN {
use strict;
use IO::Socket;
-use Test::More tests => 41;
+use Test::More tests => 42;
use LightyTest;
my $tf = LightyTest->new();
@@ -389,5 +389,14 @@ EOF
$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 304, '-Content-Length' => '' } ];
ok($tf->handle_http($t) == 0, 'Status 304 has no Content-Length (#1002)');
+$t->{REQUEST} = ( <<EOF
+GET /12345.txt HTTP/1.0
+Host: 123.example.org
+EOF
+ );
+$t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.0', 'HTTP-Status' => 200, 'HTTP-Content' => '12345'."\n", 'Content-Type' => 'text/plain' } ];
+$t->{SLOWREQUEST} = 1;
+ok($tf->handle_http($t) == 0, 'GET, slow \\r\\n\\r\\n (#2105)');
+
ok($tf->stop_proc == 0, "Stopping lighttpd");
diff --git a/tests/run-tests.pl b/tests/run-tests.pl
index 3650d55..6136eac 100755
--- a/tests/run-tests.pl
+++ b/tests/run-tests.pl
@@ -17,4 +17,4 @@ while ($f = readdir(DIR)) {
}
}
closedir DIR;
-runtests @fs;
+runtests (sort @fs);