summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am6
-rw-r--r--src/Makefile.in478
-rw-r--r--src/array.c6
-rw-r--r--src/array.h7
-rw-r--r--src/base.h35
-rw-r--r--src/bitset.c6
-rw-r--r--src/buffer.c4
-rw-r--r--src/buffer.h6
-rw-r--r--src/chunk.c4
-rw-r--r--src/configfile-glue.c43
-rw-r--r--src/configfile.c80
-rw-r--r--src/configparser.c174
-rw-r--r--src/configparser.y28
-rw-r--r--src/connections.c103
-rw-r--r--src/crc32.h6
-rw-r--r--src/data_array.c4
-rw-r--r--src/data_config.c4
-rw-r--r--src/data_count.c4
-rw-r--r--src/data_fastcgi.c6
-rw-r--r--src/data_integer.c4
-rw-r--r--src/data_string.c4
-rw-r--r--src/etag.c14
-rw-r--r--src/etag.h4
-rw-r--r--src/fdevent.c7
-rw-r--r--src/fdevent.h14
-rw-r--r--src/fdevent_freebsd_kqueue.c9
-rw-r--r--src/fdevent_linux_rtsig.c8
-rw-r--r--src/fdevent_linux_sysepoll.c7
-rw-r--r--src/fdevent_poll.c9
-rw-r--r--src/fdevent_select.c9
-rw-r--r--src/fdevent_solaris_devpoll.c7
-rw-r--r--src/http-header-glue.c38
-rw-r--r--src/http_auth.c40
-rw-r--r--src/http_auth_digest.c5
-rw-r--r--src/http_auth_digest.h2
-rw-r--r--src/http_chunk.c10
-rw-r--r--src/inet_ntop_cache.c9
-rw-r--r--src/joblist.c6
-rw-r--r--src/keyvalue.c6
-rw-r--r--src/keyvalue.h2
-rw-r--r--src/lemon.c19
-rw-r--r--src/log.c76
-rw-r--r--src/md5.c2
-rw-r--r--src/mod_access.c8
-rw-r--r--src/mod_accesslog.c171
-rw-r--r--src/mod_alias.c10
-rw-r--r--src/mod_auth.c14
-rw-r--r--src/mod_cgi.c49
-rw-r--r--src/mod_cml.c18
-rw-r--r--src/mod_cml_funcs.c18
-rw-r--r--src/mod_cml_funcs.h2
-rw-r--r--src/mod_cml_lua.c11
-rw-r--r--src/mod_compress.c37
-rw-r--r--src/mod_dirlisting.c22
-rw-r--r--src/mod_evasive.c8
-rw-r--r--src/mod_evhost.c14
-rw-r--r--src/mod_expire.c12
-rw-r--r--src/mod_extforward.c18
-rw-r--r--src/mod_fastcgi.c543
-rw-r--r--src/mod_flv_streaming.c10
-rw-r--r--src/mod_indexfile.c11
-rw-r--r--src/mod_magnet.c245
-rw-r--r--src/mod_magnet_cache.c6
-rw-r--r--src/mod_mysql_vhost.c31
-rw-r--r--src/mod_proxy.c57
-rw-r--r--src/mod_redirect.c18
-rw-r--r--src/mod_rewrite.c154
-rw-r--r--src/mod_rrdtool.c21
-rw-r--r--src/mod_scgi.c92
-rw-r--r--src/mod_secure_download.c18
-rw-r--r--src/mod_setenv.c10
-rw-r--r--src/mod_simple_vhost.c12
-rw-r--r--src/mod_skeleton.c10
-rw-r--r--src/mod_ssi.c33
-rw-r--r--src/mod_ssi_expr.c6
-rw-r--r--src/mod_ssi_exprparser.c82
-rw-r--r--src/mod_ssi_exprparser.y8
-rw-r--r--src/mod_staticfile.c10
-rw-r--r--src/mod_status.c40
-rw-r--r--src/mod_trigger_b4_dl.c16
-rw-r--r--src/mod_userdir.c12
-rw-r--r--src/mod_usertrack.c12
-rw-r--r--src/mod_webdav.c56
-rw-r--r--src/network.c322
-rw-r--r--src/network_backends.h8
-rw-r--r--src/network_freebsd_sendfile.c10
-rw-r--r--src/network_linux_sendfile.c11
-rw-r--r--src/network_openssl.c11
-rw-r--r--src/network_solaris_sendfilev.c12
-rw-r--r--src/network_write.c90
-rw-r--r--src/network_writev.c10
-rw-r--r--src/plugin.c13
-rw-r--r--src/proc_open.c19
-rw-r--r--src/request.c44
-rw-r--r--src/response.c28
-rw-r--r--src/response.h5
-rw-r--r--src/server.c72
-rw-r--r--src/settings.h9
-rw-r--r--src/splaytree.c5
-rw-r--r--src/stat_cache.c22
-rw-r--r--src/status_counter.c3
-rw-r--r--src/status_counter.h4
-rw-r--r--src/stream.c7
-rw-r--r--src/version.h4
104 files changed, 2350 insertions, 1599 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index cb5543c..328931b 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -13,14 +13,14 @@ lighttpd_angel_SOURCES=lighttpd-angel.c
versionstamp:
@test -f versionstamp.h || touch versionstamp.h; \
REVISION=""; \
- if test -x "`which svnversion`"; then \
- REVISION="$$(LANG=C svnversion "$(top_srcdir)" 2>/dev/null || echo exported)"; \
+ if test -d "$(top_srcdir)/.svn" -a -x "`which svnversion`"; then \
+ REVISION="$$(LANG= LC_ALL=C svnversion "$(top_srcdir)" 2>/dev/null || echo exported)"; \
if test "$$REVISION" = "exported"; then \
REVISION=""; \
fi; \
fi; \
if test -z "$$REVISION" -a -x "`which git`"; then \
- REVISION="$$(cd "$(top_srcdir)"; LANG=C git describe --always 2>/dev/null || echo)"; \
+ REVISION="$$(cd "$(top_srcdir)"; LANG= LC_ALL=C git describe --always 2>/dev/null || echo)"; \
fi; \
if test -n "$$REVISION"; then \
echo "#define REPO_VERSION \"-devel-$$REVISION\"" > versionstamp.h.tmp; \
diff --git a/src/Makefile.in b/src/Makefile.in
index 701e76e..baccc52 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -1,8 +1,9 @@
-# Makefile.in generated by automake 1.10.2 from Makefile.am.
+# Makefile.in generated by automake 1.11 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
+# Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -18,8 +19,9 @@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
@@ -47,20 +49,38 @@ subdir = src
DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/configure.ac
+am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
+ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
-am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+ if (++n[$$2] == $(am__install_max)) \
+ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+ END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(sbindir)"
-libLTLIBRARIES_INSTALL = $(INSTALL)
LTLIBRARIES = $(lib_LTLIBRARIES)
am__DEPENDENCIES_1 =
@NO_RDYNAMIC_TRUE@liblightcomp_la_DEPENDENCIES = \
@@ -319,7 +339,6 @@ mod_webdav_la_OBJECTS = $(am_mod_webdav_la_OBJECTS)
mod_webdav_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(mod_webdav_la_CFLAGS) \
$(CFLAGS) $(mod_webdav_la_LDFLAGS) $(LDFLAGS) -o $@
-sbinPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
PROGRAMS = $(noinst_PROGRAMS) $(sbin_PROGRAMS)
am_lemon_OBJECTS = lemon.$(OBJEXT)
lemon_OBJECTS = $(am_lemon_OBJECTS)
@@ -380,6 +399,7 @@ proc_open_LDADD = $(LDADD)
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
+am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
@@ -495,6 +515,7 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PCRECONFIG = @PCRECONFIG@
@@ -769,9 +790,9 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
exit 1;; \
esac; \
done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \
- cd $(top_srcdir) && \
- $(AUTOMAKE) --gnu src/Makefile
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign src/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
@@ -789,23 +810,28 @@ $(top_srcdir)/configure: $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
install-libLTLIBRARIES: $(lib_LTLIBRARIES)
@$(NORMAL_INSTALL)
test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)"
- @list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+ @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
+ list2=; for p in $$list; do \
if test -f $$p; then \
- f=$(am__strip_dir) \
- echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \
- $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \
+ list2="$$list2 $$p"; \
else :; fi; \
- done
+ done; \
+ test -z "$$list2" || { \
+ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \
+ }
uninstall-libLTLIBRARIES:
@$(NORMAL_UNINSTALL)
- @list='$(lib_LTLIBRARIES)'; for p in $$list; do \
- p=$(am__strip_dir) \
- echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \
- $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \
+ @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
+ for p in $$list; do \
+ $(am__strip_dir) \
+ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \
done
clean-libLTLIBRARIES:
@@ -884,39 +910,56 @@ mod_webdav.la: $(mod_webdav_la_OBJECTS) $(mod_webdav_la_DEPENDENCIES)
$(mod_webdav_la_LINK) -rpath $(libdir) $(mod_webdav_la_OBJECTS) $(mod_webdav_la_LIBADD) $(LIBS)
clean-noinstPROGRAMS:
- @list='$(noinst_PROGRAMS)'; for p in $$list; do \
- f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
- echo " rm -f $$p $$f"; \
- rm -f $$p $$f ; \
- done
+ @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \
+ echo " rm -f" $$list; \
+ rm -f $$list || exit $$?; \
+ test -n "$(EXEEXT)" || exit 0; \
+ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f" $$list; \
+ rm -f $$list
install-sbinPROGRAMS: $(sbin_PROGRAMS)
@$(NORMAL_INSTALL)
test -z "$(sbindir)" || $(MKDIR_P) "$(DESTDIR)$(sbindir)"
- @list='$(sbin_PROGRAMS)'; for p in $$list; do \
- p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
- if test -f $$p \
- || test -f $$p1 \
- ; then \
- f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
- echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(sbinPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(sbindir)/$$f'"; \
- $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(sbinPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(sbindir)/$$f" || exit 1; \
- else :; fi; \
- done
+ @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed 's/$(EXEEXT)$$//' | \
+ while read p p1; do if test -f $$p || test -f $$p1; \
+ then echo "$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
+ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+ sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) files[d] = files[d] " " $$1; \
+ else { print "f", $$3 "/" $$4, $$1; } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(sbindir)$$dir'"; \
+ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \
+ } \
+ ; done
uninstall-sbinPROGRAMS:
@$(NORMAL_UNINSTALL)
- @list='$(sbin_PROGRAMS)'; for p in $$list; do \
- f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
- echo " rm -f '$(DESTDIR)$(sbindir)/$$f'"; \
- rm -f "$(DESTDIR)$(sbindir)/$$f"; \
- done
+ @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+ -e 's/$$/$(EXEEXT)/' `; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(sbindir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(sbindir)" && rm -f $$files
clean-sbinPROGRAMS:
- @list='$(sbin_PROGRAMS)'; for p in $$list; do \
- f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
- echo " rm -f $$p $$f"; \
- rm -f $$p $$f ; \
- done
+ @list='$(sbin_PROGRAMS)'; test -n "$$list" || exit 0; \
+ echo " rm -f" $$list; \
+ rm -f $$list || exit $$?; \
+ test -n "$(EXEEXT)" || exit 0; \
+ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f" $$list; \
+ rm -f $$list
lemon$(EXEEXT): $(lemon_OBJECTS) $(lemon_DEPENDENCIES)
@rm -f lemon$(EXEEXT)
$(LINK) $(lemon_OBJECTS) $(lemon_LDADD) $(LIBS)
@@ -1068,371 +1111,371 @@ distclean-compile:
.c.o:
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c $<
.c.obj:
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
.c.lo:
@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
liblightcomp_la-buffer.lo: buffer.c
-@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-buffer.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-buffer.Tpo -c -o liblightcomp_la-buffer.lo `test -f 'buffer.c' || echo '$(srcdir)/'`buffer.c
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/liblightcomp_la-buffer.Tpo $(DEPDIR)/liblightcomp_la-buffer.Plo
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-buffer.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-buffer.Tpo -c -o liblightcomp_la-buffer.lo `test -f 'buffer.c' || echo '$(srcdir)/'`buffer.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblightcomp_la-buffer.Tpo $(DEPDIR)/liblightcomp_la-buffer.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='buffer.c' object='liblightcomp_la-buffer.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-buffer.lo `test -f 'buffer.c' || echo '$(srcdir)/'`buffer.c
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-buffer.lo `test -f 'buffer.c' || echo '$(srcdir)/'`buffer.c
liblightcomp_la-log.lo: log.c
-@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-log.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-log.Tpo -c -o liblightcomp_la-log.lo `test -f 'log.c' || echo '$(srcdir)/'`log.c
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/liblightcomp_la-log.Tpo $(DEPDIR)/liblightcomp_la-log.Plo
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-log.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-log.Tpo -c -o liblightcomp_la-log.lo `test -f 'log.c' || echo '$(srcdir)/'`log.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblightcomp_la-log.Tpo $(DEPDIR)/liblightcomp_la-log.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='log.c' object='liblightcomp_la-log.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-log.lo `test -f 'log.c' || echo '$(srcdir)/'`log.c
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-log.lo `test -f 'log.c' || echo '$(srcdir)/'`log.c
liblightcomp_la-keyvalue.lo: keyvalue.c
-@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-keyvalue.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-keyvalue.Tpo -c -o liblightcomp_la-keyvalue.lo `test -f 'keyvalue.c' || echo '$(srcdir)/'`keyvalue.c
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/liblightcomp_la-keyvalue.Tpo $(DEPDIR)/liblightcomp_la-keyvalue.Plo
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-keyvalue.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-keyvalue.Tpo -c -o liblightcomp_la-keyvalue.lo `test -f 'keyvalue.c' || echo '$(srcdir)/'`keyvalue.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblightcomp_la-keyvalue.Tpo $(DEPDIR)/liblightcomp_la-keyvalue.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='keyvalue.c' object='liblightcomp_la-keyvalue.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-keyvalue.lo `test -f 'keyvalue.c' || echo '$(srcdir)/'`keyvalue.c
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-keyvalue.lo `test -f 'keyvalue.c' || echo '$(srcdir)/'`keyvalue.c
liblightcomp_la-chunk.lo: chunk.c
-@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-chunk.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-chunk.Tpo -c -o liblightcomp_la-chunk.lo `test -f 'chunk.c' || echo '$(srcdir)/'`chunk.c
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/liblightcomp_la-chunk.Tpo $(DEPDIR)/liblightcomp_la-chunk.Plo
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-chunk.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-chunk.Tpo -c -o liblightcomp_la-chunk.lo `test -f 'chunk.c' || echo '$(srcdir)/'`chunk.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblightcomp_la-chunk.Tpo $(DEPDIR)/liblightcomp_la-chunk.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='chunk.c' object='liblightcomp_la-chunk.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-chunk.lo `test -f 'chunk.c' || echo '$(srcdir)/'`chunk.c
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-chunk.lo `test -f 'chunk.c' || echo '$(srcdir)/'`chunk.c
liblightcomp_la-http_chunk.lo: http_chunk.c
-@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-http_chunk.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-http_chunk.Tpo -c -o liblightcomp_la-http_chunk.lo `test -f 'http_chunk.c' || echo '$(srcdir)/'`http_chunk.c
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/liblightcomp_la-http_chunk.Tpo $(DEPDIR)/liblightcomp_la-http_chunk.Plo
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-http_chunk.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-http_chunk.Tpo -c -o liblightcomp_la-http_chunk.lo `test -f 'http_chunk.c' || echo '$(srcdir)/'`http_chunk.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblightcomp_la-http_chunk.Tpo $(DEPDIR)/liblightcomp_la-http_chunk.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='http_chunk.c' object='liblightcomp_la-http_chunk.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-http_chunk.lo `test -f 'http_chunk.c' || echo '$(srcdir)/'`http_chunk.c
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-http_chunk.lo `test -f 'http_chunk.c' || echo '$(srcdir)/'`http_chunk.c
liblightcomp_la-stream.lo: stream.c
-@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-stream.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-stream.Tpo -c -o liblightcomp_la-stream.lo `test -f 'stream.c' || echo '$(srcdir)/'`stream.c
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/liblightcomp_la-stream.Tpo $(DEPDIR)/liblightcomp_la-stream.Plo
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-stream.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-stream.Tpo -c -o liblightcomp_la-stream.lo `test -f 'stream.c' || echo '$(srcdir)/'`stream.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblightcomp_la-stream.Tpo $(DEPDIR)/liblightcomp_la-stream.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='stream.c' object='liblightcomp_la-stream.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-stream.lo `test -f 'stream.c' || echo '$(srcdir)/'`stream.c
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-stream.lo `test -f 'stream.c' || echo '$(srcdir)/'`stream.c
liblightcomp_la-fdevent.lo: fdevent.c
-@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-fdevent.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-fdevent.Tpo -c -o liblightcomp_la-fdevent.lo `test -f 'fdevent.c' || echo '$(srcdir)/'`fdevent.c
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/liblightcomp_la-fdevent.Tpo $(DEPDIR)/liblightcomp_la-fdevent.Plo
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-fdevent.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-fdevent.Tpo -c -o liblightcomp_la-fdevent.lo `test -f 'fdevent.c' || echo '$(srcdir)/'`fdevent.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblightcomp_la-fdevent.Tpo $(DEPDIR)/liblightcomp_la-fdevent.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='fdevent.c' object='liblightcomp_la-fdevent.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-fdevent.lo `test -f 'fdevent.c' || echo '$(srcdir)/'`fdevent.c
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-fdevent.lo `test -f 'fdevent.c' || echo '$(srcdir)/'`fdevent.c
liblightcomp_la-stat_cache.lo: stat_cache.c
-@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-stat_cache.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-stat_cache.Tpo -c -o liblightcomp_la-stat_cache.lo `test -f 'stat_cache.c' || echo '$(srcdir)/'`stat_cache.c
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/liblightcomp_la-stat_cache.Tpo $(DEPDIR)/liblightcomp_la-stat_cache.Plo
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-stat_cache.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-stat_cache.Tpo -c -o liblightcomp_la-stat_cache.lo `test -f 'stat_cache.c' || echo '$(srcdir)/'`stat_cache.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblightcomp_la-stat_cache.Tpo $(DEPDIR)/liblightcomp_la-stat_cache.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='stat_cache.c' object='liblightcomp_la-stat_cache.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-stat_cache.lo `test -f 'stat_cache.c' || echo '$(srcdir)/'`stat_cache.c
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-stat_cache.lo `test -f 'stat_cache.c' || echo '$(srcdir)/'`stat_cache.c
liblightcomp_la-plugin.lo: plugin.c
-@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-plugin.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-plugin.Tpo -c -o liblightcomp_la-plugin.lo `test -f 'plugin.c' || echo '$(srcdir)/'`plugin.c
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/liblightcomp_la-plugin.Tpo $(DEPDIR)/liblightcomp_la-plugin.Plo
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-plugin.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-plugin.Tpo -c -o liblightcomp_la-plugin.lo `test -f 'plugin.c' || echo '$(srcdir)/'`plugin.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblightcomp_la-plugin.Tpo $(DEPDIR)/liblightcomp_la-plugin.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='plugin.c' object='liblightcomp_la-plugin.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-plugin.lo `test -f 'plugin.c' || echo '$(srcdir)/'`plugin.c
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-plugin.lo `test -f 'plugin.c' || echo '$(srcdir)/'`plugin.c
liblightcomp_la-joblist.lo: joblist.c
-@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-joblist.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-joblist.Tpo -c -o liblightcomp_la-joblist.lo `test -f 'joblist.c' || echo '$(srcdir)/'`joblist.c
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/liblightcomp_la-joblist.Tpo $(DEPDIR)/liblightcomp_la-joblist.Plo
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-joblist.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-joblist.Tpo -c -o liblightcomp_la-joblist.lo `test -f 'joblist.c' || echo '$(srcdir)/'`joblist.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblightcomp_la-joblist.Tpo $(DEPDIR)/liblightcomp_la-joblist.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='joblist.c' object='liblightcomp_la-joblist.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-joblist.lo `test -f 'joblist.c' || echo '$(srcdir)/'`joblist.c
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-joblist.lo `test -f 'joblist.c' || echo '$(srcdir)/'`joblist.c
liblightcomp_la-etag.lo: etag.c
-@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-etag.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-etag.Tpo -c -o liblightcomp_la-etag.lo `test -f 'etag.c' || echo '$(srcdir)/'`etag.c
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/liblightcomp_la-etag.Tpo $(DEPDIR)/liblightcomp_la-etag.Plo
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-etag.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-etag.Tpo -c -o liblightcomp_la-etag.lo `test -f 'etag.c' || echo '$(srcdir)/'`etag.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblightcomp_la-etag.Tpo $(DEPDIR)/liblightcomp_la-etag.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='etag.c' object='liblightcomp_la-etag.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-etag.lo `test -f 'etag.c' || echo '$(srcdir)/'`etag.c
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-etag.lo `test -f 'etag.c' || echo '$(srcdir)/'`etag.c
liblightcomp_la-array.lo: array.c
-@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-array.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-array.Tpo -c -o liblightcomp_la-array.lo `test -f 'array.c' || echo '$(srcdir)/'`array.c
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/liblightcomp_la-array.Tpo $(DEPDIR)/liblightcomp_la-array.Plo
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-array.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-array.Tpo -c -o liblightcomp_la-array.lo `test -f 'array.c' || echo '$(srcdir)/'`array.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblightcomp_la-array.Tpo $(DEPDIR)/liblightcomp_la-array.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='array.c' object='liblightcomp_la-array.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-array.lo `test -f 'array.c' || echo '$(srcdir)/'`array.c
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-array.lo `test -f 'array.c' || echo '$(srcdir)/'`array.c
liblightcomp_la-data_string.lo: data_string.c
-@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-data_string.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-data_string.Tpo -c -o liblightcomp_la-data_string.lo `test -f 'data_string.c' || echo '$(srcdir)/'`data_string.c
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/liblightcomp_la-data_string.Tpo $(DEPDIR)/liblightcomp_la-data_string.Plo
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-data_string.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-data_string.Tpo -c -o liblightcomp_la-data_string.lo `test -f 'data_string.c' || echo '$(srcdir)/'`data_string.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblightcomp_la-data_string.Tpo $(DEPDIR)/liblightcomp_la-data_string.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='data_string.c' object='liblightcomp_la-data_string.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-data_string.lo `test -f 'data_string.c' || echo '$(srcdir)/'`data_string.c
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-data_string.lo `test -f 'data_string.c' || echo '$(srcdir)/'`data_string.c
liblightcomp_la-data_count.lo: data_count.c
-@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-data_count.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-data_count.Tpo -c -o liblightcomp_la-data_count.lo `test -f 'data_count.c' || echo '$(srcdir)/'`data_count.c
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/liblightcomp_la-data_count.Tpo $(DEPDIR)/liblightcomp_la-data_count.Plo
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-data_count.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-data_count.Tpo -c -o liblightcomp_la-data_count.lo `test -f 'data_count.c' || echo '$(srcdir)/'`data_count.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblightcomp_la-data_count.Tpo $(DEPDIR)/liblightcomp_la-data_count.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='data_count.c' object='liblightcomp_la-data_count.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-data_count.lo `test -f 'data_count.c' || echo '$(srcdir)/'`data_count.c
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-data_count.lo `test -f 'data_count.c' || echo '$(srcdir)/'`data_count.c
liblightcomp_la-data_array.lo: data_array.c
-@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-data_array.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-data_array.Tpo -c -o liblightcomp_la-data_array.lo `test -f 'data_array.c' || echo '$(srcdir)/'`data_array.c
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/liblightcomp_la-data_array.Tpo $(DEPDIR)/liblightcomp_la-data_array.Plo
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-data_array.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-data_array.Tpo -c -o liblightcomp_la-data_array.lo `test -f 'data_array.c' || echo '$(srcdir)/'`data_array.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblightcomp_la-data_array.Tpo $(DEPDIR)/liblightcomp_la-data_array.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='data_array.c' object='liblightcomp_la-data_array.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-data_array.lo `test -f 'data_array.c' || echo '$(srcdir)/'`data_array.c
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-data_array.lo `test -f 'data_array.c' || echo '$(srcdir)/'`data_array.c
liblightcomp_la-data_integer.lo: data_integer.c
-@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-data_integer.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-data_integer.Tpo -c -o liblightcomp_la-data_integer.lo `test -f 'data_integer.c' || echo '$(srcdir)/'`data_integer.c
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/liblightcomp_la-data_integer.Tpo $(DEPDIR)/liblightcomp_la-data_integer.Plo
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-data_integer.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-data_integer.Tpo -c -o liblightcomp_la-data_integer.lo `test -f 'data_integer.c' || echo '$(srcdir)/'`data_integer.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblightcomp_la-data_integer.Tpo $(DEPDIR)/liblightcomp_la-data_integer.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='data_integer.c' object='liblightcomp_la-data_integer.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-data_integer.lo `test -f 'data_integer.c' || echo '$(srcdir)/'`data_integer.c
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-data_integer.lo `test -f 'data_integer.c' || echo '$(srcdir)/'`data_integer.c
liblightcomp_la-md5.lo: md5.c
-@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-md5.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-md5.Tpo -c -o liblightcomp_la-md5.lo `test -f 'md5.c' || echo '$(srcdir)/'`md5.c
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/liblightcomp_la-md5.Tpo $(DEPDIR)/liblightcomp_la-md5.Plo
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-md5.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-md5.Tpo -c -o liblightcomp_la-md5.lo `test -f 'md5.c' || echo '$(srcdir)/'`md5.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblightcomp_la-md5.Tpo $(DEPDIR)/liblightcomp_la-md5.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='md5.c' object='liblightcomp_la-md5.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-md5.lo `test -f 'md5.c' || echo '$(srcdir)/'`md5.c
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-md5.lo `test -f 'md5.c' || echo '$(srcdir)/'`md5.c
liblightcomp_la-data_fastcgi.lo: data_fastcgi.c
-@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-data_fastcgi.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-data_fastcgi.Tpo -c -o liblightcomp_la-data_fastcgi.lo `test -f 'data_fastcgi.c' || echo '$(srcdir)/'`data_fastcgi.c
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/liblightcomp_la-data_fastcgi.Tpo $(DEPDIR)/liblightcomp_la-data_fastcgi.Plo
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-data_fastcgi.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-data_fastcgi.Tpo -c -o liblightcomp_la-data_fastcgi.lo `test -f 'data_fastcgi.c' || echo '$(srcdir)/'`data_fastcgi.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblightcomp_la-data_fastcgi.Tpo $(DEPDIR)/liblightcomp_la-data_fastcgi.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='data_fastcgi.c' object='liblightcomp_la-data_fastcgi.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-data_fastcgi.lo `test -f 'data_fastcgi.c' || echo '$(srcdir)/'`data_fastcgi.c
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-data_fastcgi.lo `test -f 'data_fastcgi.c' || echo '$(srcdir)/'`data_fastcgi.c
liblightcomp_la-fdevent_select.lo: fdevent_select.c
-@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-fdevent_select.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-fdevent_select.Tpo -c -o liblightcomp_la-fdevent_select.lo `test -f 'fdevent_select.c' || echo '$(srcdir)/'`fdevent_select.c
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/liblightcomp_la-fdevent_select.Tpo $(DEPDIR)/liblightcomp_la-fdevent_select.Plo
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-fdevent_select.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-fdevent_select.Tpo -c -o liblightcomp_la-fdevent_select.lo `test -f 'fdevent_select.c' || echo '$(srcdir)/'`fdevent_select.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblightcomp_la-fdevent_select.Tpo $(DEPDIR)/liblightcomp_la-fdevent_select.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='fdevent_select.c' object='liblightcomp_la-fdevent_select.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-fdevent_select.lo `test -f 'fdevent_select.c' || echo '$(srcdir)/'`fdevent_select.c
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-fdevent_select.lo `test -f 'fdevent_select.c' || echo '$(srcdir)/'`fdevent_select.c
liblightcomp_la-fdevent_linux_rtsig.lo: fdevent_linux_rtsig.c
-@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-fdevent_linux_rtsig.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-fdevent_linux_rtsig.Tpo -c -o liblightcomp_la-fdevent_linux_rtsig.lo `test -f 'fdevent_linux_rtsig.c' || echo '$(srcdir)/'`fdevent_linux_rtsig.c
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/liblightcomp_la-fdevent_linux_rtsig.Tpo $(DEPDIR)/liblightcomp_la-fdevent_linux_rtsig.Plo
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-fdevent_linux_rtsig.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-fdevent_linux_rtsig.Tpo -c -o liblightcomp_la-fdevent_linux_rtsig.lo `test -f 'fdevent_linux_rtsig.c' || echo '$(srcdir)/'`fdevent_linux_rtsig.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblightcomp_la-fdevent_linux_rtsig.Tpo $(DEPDIR)/liblightcomp_la-fdevent_linux_rtsig.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='fdevent_linux_rtsig.c' object='liblightcomp_la-fdevent_linux_rtsig.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-fdevent_linux_rtsig.lo `test -f 'fdevent_linux_rtsig.c' || echo '$(srcdir)/'`fdevent_linux_rtsig.c
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-fdevent_linux_rtsig.lo `test -f 'fdevent_linux_rtsig.c' || echo '$(srcdir)/'`fdevent_linux_rtsig.c
liblightcomp_la-fdevent_poll.lo: fdevent_poll.c
-@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-fdevent_poll.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-fdevent_poll.Tpo -c -o liblightcomp_la-fdevent_poll.lo `test -f 'fdevent_poll.c' || echo '$(srcdir)/'`fdevent_poll.c
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/liblightcomp_la-fdevent_poll.Tpo $(DEPDIR)/liblightcomp_la-fdevent_poll.Plo
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-fdevent_poll.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-fdevent_poll.Tpo -c -o liblightcomp_la-fdevent_poll.lo `test -f 'fdevent_poll.c' || echo '$(srcdir)/'`fdevent_poll.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblightcomp_la-fdevent_poll.Tpo $(DEPDIR)/liblightcomp_la-fdevent_poll.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='fdevent_poll.c' object='liblightcomp_la-fdevent_poll.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-fdevent_poll.lo `test -f 'fdevent_poll.c' || echo '$(srcdir)/'`fdevent_poll.c
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-fdevent_poll.lo `test -f 'fdevent_poll.c' || echo '$(srcdir)/'`fdevent_poll.c
liblightcomp_la-fdevent_linux_sysepoll.lo: fdevent_linux_sysepoll.c
-@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-fdevent_linux_sysepoll.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-fdevent_linux_sysepoll.Tpo -c -o liblightcomp_la-fdevent_linux_sysepoll.lo `test -f 'fdevent_linux_sysepoll.c' || echo '$(srcdir)/'`fdevent_linux_sysepoll.c
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/liblightcomp_la-fdevent_linux_sysepoll.Tpo $(DEPDIR)/liblightcomp_la-fdevent_linux_sysepoll.Plo
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-fdevent_linux_sysepoll.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-fdevent_linux_sysepoll.Tpo -c -o liblightcomp_la-fdevent_linux_sysepoll.lo `test -f 'fdevent_linux_sysepoll.c' || echo '$(srcdir)/'`fdevent_linux_sysepoll.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblightcomp_la-fdevent_linux_sysepoll.Tpo $(DEPDIR)/liblightcomp_la-fdevent_linux_sysepoll.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='fdevent_linux_sysepoll.c' object='liblightcomp_la-fdevent_linux_sysepoll.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-fdevent_linux_sysepoll.lo `test -f 'fdevent_linux_sysepoll.c' || echo '$(srcdir)/'`fdevent_linux_sysepoll.c
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-fdevent_linux_sysepoll.lo `test -f 'fdevent_linux_sysepoll.c' || echo '$(srcdir)/'`fdevent_linux_sysepoll.c
liblightcomp_la-fdevent_solaris_devpoll.lo: fdevent_solaris_devpoll.c
-@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-fdevent_solaris_devpoll.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-fdevent_solaris_devpoll.Tpo -c -o liblightcomp_la-fdevent_solaris_devpoll.lo `test -f 'fdevent_solaris_devpoll.c' || echo '$(srcdir)/'`fdevent_solaris_devpoll.c
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/liblightcomp_la-fdevent_solaris_devpoll.Tpo $(DEPDIR)/liblightcomp_la-fdevent_solaris_devpoll.Plo
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-fdevent_solaris_devpoll.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-fdevent_solaris_devpoll.Tpo -c -o liblightcomp_la-fdevent_solaris_devpoll.lo `test -f 'fdevent_solaris_devpoll.c' || echo '$(srcdir)/'`fdevent_solaris_devpoll.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblightcomp_la-fdevent_solaris_devpoll.Tpo $(DEPDIR)/liblightcomp_la-fdevent_solaris_devpoll.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='fdevent_solaris_devpoll.c' object='liblightcomp_la-fdevent_solaris_devpoll.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-fdevent_solaris_devpoll.lo `test -f 'fdevent_solaris_devpoll.c' || echo '$(srcdir)/'`fdevent_solaris_devpoll.c
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-fdevent_solaris_devpoll.lo `test -f 'fdevent_solaris_devpoll.c' || echo '$(srcdir)/'`fdevent_solaris_devpoll.c
liblightcomp_la-fdevent_freebsd_kqueue.lo: fdevent_freebsd_kqueue.c
-@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-fdevent_freebsd_kqueue.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-fdevent_freebsd_kqueue.Tpo -c -o liblightcomp_la-fdevent_freebsd_kqueue.lo `test -f 'fdevent_freebsd_kqueue.c' || echo '$(srcdir)/'`fdevent_freebsd_kqueue.c
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/liblightcomp_la-fdevent_freebsd_kqueue.Tpo $(DEPDIR)/liblightcomp_la-fdevent_freebsd_kqueue.Plo
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-fdevent_freebsd_kqueue.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-fdevent_freebsd_kqueue.Tpo -c -o liblightcomp_la-fdevent_freebsd_kqueue.lo `test -f 'fdevent_freebsd_kqueue.c' || echo '$(srcdir)/'`fdevent_freebsd_kqueue.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblightcomp_la-fdevent_freebsd_kqueue.Tpo $(DEPDIR)/liblightcomp_la-fdevent_freebsd_kqueue.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='fdevent_freebsd_kqueue.c' object='liblightcomp_la-fdevent_freebsd_kqueue.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-fdevent_freebsd_kqueue.lo `test -f 'fdevent_freebsd_kqueue.c' || echo '$(srcdir)/'`fdevent_freebsd_kqueue.c
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-fdevent_freebsd_kqueue.lo `test -f 'fdevent_freebsd_kqueue.c' || echo '$(srcdir)/'`fdevent_freebsd_kqueue.c
liblightcomp_la-data_config.lo: data_config.c
-@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-data_config.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-data_config.Tpo -c -o liblightcomp_la-data_config.lo `test -f 'data_config.c' || echo '$(srcdir)/'`data_config.c
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/liblightcomp_la-data_config.Tpo $(DEPDIR)/liblightcomp_la-data_config.Plo
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-data_config.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-data_config.Tpo -c -o liblightcomp_la-data_config.lo `test -f 'data_config.c' || echo '$(srcdir)/'`data_config.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblightcomp_la-data_config.Tpo $(DEPDIR)/liblightcomp_la-data_config.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='data_config.c' object='liblightcomp_la-data_config.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-data_config.lo `test -f 'data_config.c' || echo '$(srcdir)/'`data_config.c
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-data_config.lo `test -f 'data_config.c' || echo '$(srcdir)/'`data_config.c
liblightcomp_la-bitset.lo: bitset.c
-@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-bitset.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-bitset.Tpo -c -o liblightcomp_la-bitset.lo `test -f 'bitset.c' || echo '$(srcdir)/'`bitset.c
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/liblightcomp_la-bitset.Tpo $(DEPDIR)/liblightcomp_la-bitset.Plo
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-bitset.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-bitset.Tpo -c -o liblightcomp_la-bitset.lo `test -f 'bitset.c' || echo '$(srcdir)/'`bitset.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblightcomp_la-bitset.Tpo $(DEPDIR)/liblightcomp_la-bitset.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='bitset.c' object='liblightcomp_la-bitset.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-bitset.lo `test -f 'bitset.c' || echo '$(srcdir)/'`bitset.c
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-bitset.lo `test -f 'bitset.c' || echo '$(srcdir)/'`bitset.c
liblightcomp_la-inet_ntop_cache.lo: inet_ntop_cache.c
-@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-inet_ntop_cache.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-inet_ntop_cache.Tpo -c -o liblightcomp_la-inet_ntop_cache.lo `test -f 'inet_ntop_cache.c' || echo '$(srcdir)/'`inet_ntop_cache.c
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/liblightcomp_la-inet_ntop_cache.Tpo $(DEPDIR)/liblightcomp_la-inet_ntop_cache.Plo
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-inet_ntop_cache.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-inet_ntop_cache.Tpo -c -o liblightcomp_la-inet_ntop_cache.lo `test -f 'inet_ntop_cache.c' || echo '$(srcdir)/'`inet_ntop_cache.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblightcomp_la-inet_ntop_cache.Tpo $(DEPDIR)/liblightcomp_la-inet_ntop_cache.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='inet_ntop_cache.c' object='liblightcomp_la-inet_ntop_cache.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-inet_ntop_cache.lo `test -f 'inet_ntop_cache.c' || echo '$(srcdir)/'`inet_ntop_cache.c
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-inet_ntop_cache.lo `test -f 'inet_ntop_cache.c' || echo '$(srcdir)/'`inet_ntop_cache.c
liblightcomp_la-crc32.lo: crc32.c
-@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-crc32.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-crc32.Tpo -c -o liblightcomp_la-crc32.lo `test -f 'crc32.c' || echo '$(srcdir)/'`crc32.c
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/liblightcomp_la-crc32.Tpo $(DEPDIR)/liblightcomp_la-crc32.Plo
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-crc32.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-crc32.Tpo -c -o liblightcomp_la-crc32.lo `test -f 'crc32.c' || echo '$(srcdir)/'`crc32.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblightcomp_la-crc32.Tpo $(DEPDIR)/liblightcomp_la-crc32.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='crc32.c' object='liblightcomp_la-crc32.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-crc32.lo `test -f 'crc32.c' || echo '$(srcdir)/'`crc32.c
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-crc32.lo `test -f 'crc32.c' || echo '$(srcdir)/'`crc32.c
liblightcomp_la-connections-glue.lo: connections-glue.c
-@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-connections-glue.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-connections-glue.Tpo -c -o liblightcomp_la-connections-glue.lo `test -f 'connections-glue.c' || echo '$(srcdir)/'`connections-glue.c
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/liblightcomp_la-connections-glue.Tpo $(DEPDIR)/liblightcomp_la-connections-glue.Plo
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-connections-glue.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-connections-glue.Tpo -c -o liblightcomp_la-connections-glue.lo `test -f 'connections-glue.c' || echo '$(srcdir)/'`connections-glue.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblightcomp_la-connections-glue.Tpo $(DEPDIR)/liblightcomp_la-connections-glue.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='connections-glue.c' object='liblightcomp_la-connections-glue.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-connections-glue.lo `test -f 'connections-glue.c' || echo '$(srcdir)/'`connections-glue.c
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-connections-glue.lo `test -f 'connections-glue.c' || echo '$(srcdir)/'`connections-glue.c
liblightcomp_la-configfile-glue.lo: configfile-glue.c
-@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-configfile-glue.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-configfile-glue.Tpo -c -o liblightcomp_la-configfile-glue.lo `test -f 'configfile-glue.c' || echo '$(srcdir)/'`configfile-glue.c
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/liblightcomp_la-configfile-glue.Tpo $(DEPDIR)/liblightcomp_la-configfile-glue.Plo
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-configfile-glue.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-configfile-glue.Tpo -c -o liblightcomp_la-configfile-glue.lo `test -f 'configfile-glue.c' || echo '$(srcdir)/'`configfile-glue.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblightcomp_la-configfile-glue.Tpo $(DEPDIR)/liblightcomp_la-configfile-glue.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='configfile-glue.c' object='liblightcomp_la-configfile-glue.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-configfile-glue.lo `test -f 'configfile-glue.c' || echo '$(srcdir)/'`configfile-glue.c
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-configfile-glue.lo `test -f 'configfile-glue.c' || echo '$(srcdir)/'`configfile-glue.c
liblightcomp_la-http-header-glue.lo: http-header-glue.c
-@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-http-header-glue.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-http-header-glue.Tpo -c -o liblightcomp_la-http-header-glue.lo `test -f 'http-header-glue.c' || echo '$(srcdir)/'`http-header-glue.c
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/liblightcomp_la-http-header-glue.Tpo $(DEPDIR)/liblightcomp_la-http-header-glue.Plo
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-http-header-glue.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-http-header-glue.Tpo -c -o liblightcomp_la-http-header-glue.lo `test -f 'http-header-glue.c' || echo '$(srcdir)/'`http-header-glue.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblightcomp_la-http-header-glue.Tpo $(DEPDIR)/liblightcomp_la-http-header-glue.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='http-header-glue.c' object='liblightcomp_la-http-header-glue.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-http-header-glue.lo `test -f 'http-header-glue.c' || echo '$(srcdir)/'`http-header-glue.c
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-http-header-glue.lo `test -f 'http-header-glue.c' || echo '$(srcdir)/'`http-header-glue.c
liblightcomp_la-network_write.lo: network_write.c
-@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-network_write.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-network_write.Tpo -c -o liblightcomp_la-network_write.lo `test -f 'network_write.c' || echo '$(srcdir)/'`network_write.c
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/liblightcomp_la-network_write.Tpo $(DEPDIR)/liblightcomp_la-network_write.Plo
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-network_write.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-network_write.Tpo -c -o liblightcomp_la-network_write.lo `test -f 'network_write.c' || echo '$(srcdir)/'`network_write.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblightcomp_la-network_write.Tpo $(DEPDIR)/liblightcomp_la-network_write.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='network_write.c' object='liblightcomp_la-network_write.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-network_write.lo `test -f 'network_write.c' || echo '$(srcdir)/'`network_write.c
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-network_write.lo `test -f 'network_write.c' || echo '$(srcdir)/'`network_write.c
liblightcomp_la-network_linux_sendfile.lo: network_linux_sendfile.c
-@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-network_linux_sendfile.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-network_linux_sendfile.Tpo -c -o liblightcomp_la-network_linux_sendfile.lo `test -f 'network_linux_sendfile.c' || echo '$(srcdir)/'`network_linux_sendfile.c
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/liblightcomp_la-network_linux_sendfile.Tpo $(DEPDIR)/liblightcomp_la-network_linux_sendfile.Plo
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-network_linux_sendfile.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-network_linux_sendfile.Tpo -c -o liblightcomp_la-network_linux_sendfile.lo `test -f 'network_linux_sendfile.c' || echo '$(srcdir)/'`network_linux_sendfile.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblightcomp_la-network_linux_sendfile.Tpo $(DEPDIR)/liblightcomp_la-network_linux_sendfile.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='network_linux_sendfile.c' object='liblightcomp_la-network_linux_sendfile.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-network_linux_sendfile.lo `test -f 'network_linux_sendfile.c' || echo '$(srcdir)/'`network_linux_sendfile.c
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-network_linux_sendfile.lo `test -f 'network_linux_sendfile.c' || echo '$(srcdir)/'`network_linux_sendfile.c
liblightcomp_la-network_freebsd_sendfile.lo: network_freebsd_sendfile.c
-@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-network_freebsd_sendfile.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-network_freebsd_sendfile.Tpo -c -o liblightcomp_la-network_freebsd_sendfile.lo `test -f 'network_freebsd_sendfile.c' || echo '$(srcdir)/'`network_freebsd_sendfile.c
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/liblightcomp_la-network_freebsd_sendfile.Tpo $(DEPDIR)/liblightcomp_la-network_freebsd_sendfile.Plo
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-network_freebsd_sendfile.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-network_freebsd_sendfile.Tpo -c -o liblightcomp_la-network_freebsd_sendfile.lo `test -f 'network_freebsd_sendfile.c' || echo '$(srcdir)/'`network_freebsd_sendfile.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblightcomp_la-network_freebsd_sendfile.Tpo $(DEPDIR)/liblightcomp_la-network_freebsd_sendfile.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='network_freebsd_sendfile.c' object='liblightcomp_la-network_freebsd_sendfile.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-network_freebsd_sendfile.lo `test -f 'network_freebsd_sendfile.c' || echo '$(srcdir)/'`network_freebsd_sendfile.c
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-network_freebsd_sendfile.lo `test -f 'network_freebsd_sendfile.c' || echo '$(srcdir)/'`network_freebsd_sendfile.c
liblightcomp_la-network_writev.lo: network_writev.c
-@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-network_writev.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-network_writev.Tpo -c -o liblightcomp_la-network_writev.lo `test -f 'network_writev.c' || echo '$(srcdir)/'`network_writev.c
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/liblightcomp_la-network_writev.Tpo $(DEPDIR)/liblightcomp_la-network_writev.Plo
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-network_writev.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-network_writev.Tpo -c -o liblightcomp_la-network_writev.lo `test -f 'network_writev.c' || echo '$(srcdir)/'`network_writev.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblightcomp_la-network_writev.Tpo $(DEPDIR)/liblightcomp_la-network_writev.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='network_writev.c' object='liblightcomp_la-network_writev.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-network_writev.lo `test -f 'network_writev.c' || echo '$(srcdir)/'`network_writev.c
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-network_writev.lo `test -f 'network_writev.c' || echo '$(srcdir)/'`network_writev.c
liblightcomp_la-network_solaris_sendfilev.lo: network_solaris_sendfilev.c
-@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-network_solaris_sendfilev.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-network_solaris_sendfilev.Tpo -c -o liblightcomp_la-network_solaris_sendfilev.lo `test -f 'network_solaris_sendfilev.c' || echo '$(srcdir)/'`network_solaris_sendfilev.c
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/liblightcomp_la-network_solaris_sendfilev.Tpo $(DEPDIR)/liblightcomp_la-network_solaris_sendfilev.Plo
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-network_solaris_sendfilev.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-network_solaris_sendfilev.Tpo -c -o liblightcomp_la-network_solaris_sendfilev.lo `test -f 'network_solaris_sendfilev.c' || echo '$(srcdir)/'`network_solaris_sendfilev.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblightcomp_la-network_solaris_sendfilev.Tpo $(DEPDIR)/liblightcomp_la-network_solaris_sendfilev.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='network_solaris_sendfilev.c' object='liblightcomp_la-network_solaris_sendfilev.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-network_solaris_sendfilev.lo `test -f 'network_solaris_sendfilev.c' || echo '$(srcdir)/'`network_solaris_sendfilev.c
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-network_solaris_sendfilev.lo `test -f 'network_solaris_sendfilev.c' || echo '$(srcdir)/'`network_solaris_sendfilev.c
liblightcomp_la-network_openssl.lo: network_openssl.c
-@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-network_openssl.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-network_openssl.Tpo -c -o liblightcomp_la-network_openssl.lo `test -f 'network_openssl.c' || echo '$(srcdir)/'`network_openssl.c
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/liblightcomp_la-network_openssl.Tpo $(DEPDIR)/liblightcomp_la-network_openssl.Plo
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-network_openssl.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-network_openssl.Tpo -c -o liblightcomp_la-network_openssl.lo `test -f 'network_openssl.c' || echo '$(srcdir)/'`network_openssl.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblightcomp_la-network_openssl.Tpo $(DEPDIR)/liblightcomp_la-network_openssl.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='network_openssl.c' object='liblightcomp_la-network_openssl.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-network_openssl.lo `test -f 'network_openssl.c' || echo '$(srcdir)/'`network_openssl.c
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-network_openssl.lo `test -f 'network_openssl.c' || echo '$(srcdir)/'`network_openssl.c
liblightcomp_la-splaytree.lo: splaytree.c
-@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-splaytree.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-splaytree.Tpo -c -o liblightcomp_la-splaytree.lo `test -f 'splaytree.c' || echo '$(srcdir)/'`splaytree.c
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/liblightcomp_la-splaytree.Tpo $(DEPDIR)/liblightcomp_la-splaytree.Plo
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-splaytree.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-splaytree.Tpo -c -o liblightcomp_la-splaytree.lo `test -f 'splaytree.c' || echo '$(srcdir)/'`splaytree.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblightcomp_la-splaytree.Tpo $(DEPDIR)/liblightcomp_la-splaytree.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='splaytree.c' object='liblightcomp_la-splaytree.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-splaytree.lo `test -f 'splaytree.c' || echo '$(srcdir)/'`splaytree.c
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-splaytree.lo `test -f 'splaytree.c' || echo '$(srcdir)/'`splaytree.c
liblightcomp_la-status_counter.lo: status_counter.c
-@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-status_counter.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-status_counter.Tpo -c -o liblightcomp_la-status_counter.lo `test -f 'status_counter.c' || echo '$(srcdir)/'`status_counter.c
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/liblightcomp_la-status_counter.Tpo $(DEPDIR)/liblightcomp_la-status_counter.Plo
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -MT liblightcomp_la-status_counter.lo -MD -MP -MF $(DEPDIR)/liblightcomp_la-status_counter.Tpo -c -o liblightcomp_la-status_counter.lo `test -f 'status_counter.c' || echo '$(srcdir)/'`status_counter.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/liblightcomp_la-status_counter.Tpo $(DEPDIR)/liblightcomp_la-status_counter.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='status_counter.c' object='liblightcomp_la-status_counter.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-status_counter.lo `test -f 'status_counter.c' || echo '$(srcdir)/'`status_counter.c
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblightcomp_la_CFLAGS) $(CFLAGS) -c -o liblightcomp_la-status_counter.lo `test -f 'status_counter.c' || echo '$(srcdir)/'`status_counter.c
mod_cml_la-mod_cml.lo: mod_cml.c
-@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mod_cml_la_CFLAGS) $(CFLAGS) -MT mod_cml_la-mod_cml.lo -MD -MP -MF $(DEPDIR)/mod_cml_la-mod_cml.Tpo -c -o mod_cml_la-mod_cml.lo `test -f 'mod_cml.c' || echo '$(srcdir)/'`mod_cml.c
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/mod_cml_la-mod_cml.Tpo $(DEPDIR)/mod_cml_la-mod_cml.Plo
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mod_cml_la_CFLAGS) $(CFLAGS) -MT mod_cml_la-mod_cml.lo -MD -MP -MF $(DEPDIR)/mod_cml_la-mod_cml.Tpo -c -o mod_cml_la-mod_cml.lo `test -f 'mod_cml.c' || echo '$(srcdir)/'`mod_cml.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/mod_cml_la-mod_cml.Tpo $(DEPDIR)/mod_cml_la-mod_cml.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='mod_cml.c' object='mod_cml_la-mod_cml.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mod_cml_la_CFLAGS) $(CFLAGS) -c -o mod_cml_la-mod_cml.lo `test -f 'mod_cml.c' || echo '$(srcdir)/'`mod_cml.c
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mod_cml_la_CFLAGS) $(CFLAGS) -c -o mod_cml_la-mod_cml.lo `test -f 'mod_cml.c' || echo '$(srcdir)/'`mod_cml.c
mod_cml_la-mod_cml_lua.lo: mod_cml_lua.c
-@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mod_cml_la_CFLAGS) $(CFLAGS) -MT mod_cml_la-mod_cml_lua.lo -MD -MP -MF $(DEPDIR)/mod_cml_la-mod_cml_lua.Tpo -c -o mod_cml_la-mod_cml_lua.lo `test -f 'mod_cml_lua.c' || echo '$(srcdir)/'`mod_cml_lua.c
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/mod_cml_la-mod_cml_lua.Tpo $(DEPDIR)/mod_cml_la-mod_cml_lua.Plo
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mod_cml_la_CFLAGS) $(CFLAGS) -MT mod_cml_la-mod_cml_lua.lo -MD -MP -MF $(DEPDIR)/mod_cml_la-mod_cml_lua.Tpo -c -o mod_cml_la-mod_cml_lua.lo `test -f 'mod_cml_lua.c' || echo '$(srcdir)/'`mod_cml_lua.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/mod_cml_la-mod_cml_lua.Tpo $(DEPDIR)/mod_cml_la-mod_cml_lua.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='mod_cml_lua.c' object='mod_cml_la-mod_cml_lua.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mod_cml_la_CFLAGS) $(CFLAGS) -c -o mod_cml_la-mod_cml_lua.lo `test -f 'mod_cml_lua.c' || echo '$(srcdir)/'`mod_cml_lua.c
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mod_cml_la_CFLAGS) $(CFLAGS) -c -o mod_cml_la-mod_cml_lua.lo `test -f 'mod_cml_lua.c' || echo '$(srcdir)/'`mod_cml_lua.c
mod_cml_la-mod_cml_funcs.lo: mod_cml_funcs.c
-@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mod_cml_la_CFLAGS) $(CFLAGS) -MT mod_cml_la-mod_cml_funcs.lo -MD -MP -MF $(DEPDIR)/mod_cml_la-mod_cml_funcs.Tpo -c -o mod_cml_la-mod_cml_funcs.lo `test -f 'mod_cml_funcs.c' || echo '$(srcdir)/'`mod_cml_funcs.c
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/mod_cml_la-mod_cml_funcs.Tpo $(DEPDIR)/mod_cml_la-mod_cml_funcs.Plo
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mod_cml_la_CFLAGS) $(CFLAGS) -MT mod_cml_la-mod_cml_funcs.lo -MD -MP -MF $(DEPDIR)/mod_cml_la-mod_cml_funcs.Tpo -c -o mod_cml_la-mod_cml_funcs.lo `test -f 'mod_cml_funcs.c' || echo '$(srcdir)/'`mod_cml_funcs.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/mod_cml_la-mod_cml_funcs.Tpo $(DEPDIR)/mod_cml_la-mod_cml_funcs.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='mod_cml_funcs.c' object='mod_cml_la-mod_cml_funcs.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mod_cml_la_CFLAGS) $(CFLAGS) -c -o mod_cml_la-mod_cml_funcs.lo `test -f 'mod_cml_funcs.c' || echo '$(srcdir)/'`mod_cml_funcs.c
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mod_cml_la_CFLAGS) $(CFLAGS) -c -o mod_cml_la-mod_cml_funcs.lo `test -f 'mod_cml_funcs.c' || echo '$(srcdir)/'`mod_cml_funcs.c
mod_magnet_la-mod_magnet.lo: mod_magnet.c
-@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mod_magnet_la_CFLAGS) $(CFLAGS) -MT mod_magnet_la-mod_magnet.lo -MD -MP -MF $(DEPDIR)/mod_magnet_la-mod_magnet.Tpo -c -o mod_magnet_la-mod_magnet.lo `test -f 'mod_magnet.c' || echo '$(srcdir)/'`mod_magnet.c
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/mod_magnet_la-mod_magnet.Tpo $(DEPDIR)/mod_magnet_la-mod_magnet.Plo
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mod_magnet_la_CFLAGS) $(CFLAGS) -MT mod_magnet_la-mod_magnet.lo -MD -MP -MF $(DEPDIR)/mod_magnet_la-mod_magnet.Tpo -c -o mod_magnet_la-mod_magnet.lo `test -f 'mod_magnet.c' || echo '$(srcdir)/'`mod_magnet.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/mod_magnet_la-mod_magnet.Tpo $(DEPDIR)/mod_magnet_la-mod_magnet.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='mod_magnet.c' object='mod_magnet_la-mod_magnet.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mod_magnet_la_CFLAGS) $(CFLAGS) -c -o mod_magnet_la-mod_magnet.lo `test -f 'mod_magnet.c' || echo '$(srcdir)/'`mod_magnet.c
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mod_magnet_la_CFLAGS) $(CFLAGS) -c -o mod_magnet_la-mod_magnet.lo `test -f 'mod_magnet.c' || echo '$(srcdir)/'`mod_magnet.c
mod_magnet_la-mod_magnet_cache.lo: mod_magnet_cache.c
-@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mod_magnet_la_CFLAGS) $(CFLAGS) -MT mod_magnet_la-mod_magnet_cache.lo -MD -MP -MF $(DEPDIR)/mod_magnet_la-mod_magnet_cache.Tpo -c -o mod_magnet_la-mod_magnet_cache.lo `test -f 'mod_magnet_cache.c' || echo '$(srcdir)/'`mod_magnet_cache.c
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/mod_magnet_la-mod_magnet_cache.Tpo $(DEPDIR)/mod_magnet_la-mod_magnet_cache.Plo
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mod_magnet_la_CFLAGS) $(CFLAGS) -MT mod_magnet_la-mod_magnet_cache.lo -MD -MP -MF $(DEPDIR)/mod_magnet_la-mod_magnet_cache.Tpo -c -o mod_magnet_la-mod_magnet_cache.lo `test -f 'mod_magnet_cache.c' || echo '$(srcdir)/'`mod_magnet_cache.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/mod_magnet_la-mod_magnet_cache.Tpo $(DEPDIR)/mod_magnet_la-mod_magnet_cache.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='mod_magnet_cache.c' object='mod_magnet_la-mod_magnet_cache.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mod_magnet_la_CFLAGS) $(CFLAGS) -c -o mod_magnet_la-mod_magnet_cache.lo `test -f 'mod_magnet_cache.c' || echo '$(srcdir)/'`mod_magnet_cache.c
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mod_magnet_la_CFLAGS) $(CFLAGS) -c -o mod_magnet_la-mod_magnet_cache.lo `test -f 'mod_magnet_cache.c' || echo '$(srcdir)/'`mod_magnet_cache.c
mod_mysql_vhost_la-mod_mysql_vhost.lo: mod_mysql_vhost.c
-@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mod_mysql_vhost_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mod_mysql_vhost_la-mod_mysql_vhost.lo -MD -MP -MF $(DEPDIR)/mod_mysql_vhost_la-mod_mysql_vhost.Tpo -c -o mod_mysql_vhost_la-mod_mysql_vhost.lo `test -f 'mod_mysql_vhost.c' || echo '$(srcdir)/'`mod_mysql_vhost.c
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/mod_mysql_vhost_la-mod_mysql_vhost.Tpo $(DEPDIR)/mod_mysql_vhost_la-mod_mysql_vhost.Plo
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mod_mysql_vhost_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mod_mysql_vhost_la-mod_mysql_vhost.lo -MD -MP -MF $(DEPDIR)/mod_mysql_vhost_la-mod_mysql_vhost.Tpo -c -o mod_mysql_vhost_la-mod_mysql_vhost.lo `test -f 'mod_mysql_vhost.c' || echo '$(srcdir)/'`mod_mysql_vhost.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/mod_mysql_vhost_la-mod_mysql_vhost.Tpo $(DEPDIR)/mod_mysql_vhost_la-mod_mysql_vhost.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='mod_mysql_vhost.c' object='mod_mysql_vhost_la-mod_mysql_vhost.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mod_mysql_vhost_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mod_mysql_vhost_la-mod_mysql_vhost.lo `test -f 'mod_mysql_vhost.c' || echo '$(srcdir)/'`mod_mysql_vhost.c
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mod_mysql_vhost_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mod_mysql_vhost_la-mod_mysql_vhost.lo `test -f 'mod_mysql_vhost.c' || echo '$(srcdir)/'`mod_mysql_vhost.c
mod_webdav_la-mod_webdav.lo: mod_webdav.c
-@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mod_webdav_la_CFLAGS) $(CFLAGS) -MT mod_webdav_la-mod_webdav.lo -MD -MP -MF $(DEPDIR)/mod_webdav_la-mod_webdav.Tpo -c -o mod_webdav_la-mod_webdav.lo `test -f 'mod_webdav.c' || echo '$(srcdir)/'`mod_webdav.c
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/mod_webdav_la-mod_webdav.Tpo $(DEPDIR)/mod_webdav_la-mod_webdav.Plo
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mod_webdav_la_CFLAGS) $(CFLAGS) -MT mod_webdav_la-mod_webdav.lo -MD -MP -MF $(DEPDIR)/mod_webdav_la-mod_webdav.Tpo -c -o mod_webdav_la-mod_webdav.lo `test -f 'mod_webdav.c' || echo '$(srcdir)/'`mod_webdav.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/mod_webdav_la-mod_webdav.Tpo $(DEPDIR)/mod_webdav_la-mod_webdav.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='mod_webdav.c' object='mod_webdav_la-mod_webdav.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mod_webdav_la_CFLAGS) $(CFLAGS) -c -o mod_webdav_la-mod_webdav.lo `test -f 'mod_webdav.c' || echo '$(srcdir)/'`mod_webdav.c
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mod_webdav_la_CFLAGS) $(CFLAGS) -c -o mod_webdav_la-mod_webdav.lo `test -f 'mod_webdav.c' || echo '$(srcdir)/'`mod_webdav.c
proc_open-proc_open.o: proc_open.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(proc_open_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT proc_open-proc_open.o -MD -MP -MF $(DEPDIR)/proc_open-proc_open.Tpo -c -o proc_open-proc_open.o `test -f 'proc_open.c' || echo '$(srcdir)/'`proc_open.c
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/proc_open-proc_open.Tpo $(DEPDIR)/proc_open-proc_open.Po
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/proc_open-proc_open.Tpo $(DEPDIR)/proc_open-proc_open.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='proc_open.c' object='proc_open-proc_open.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(proc_open_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o proc_open-proc_open.o `test -f 'proc_open.c' || echo '$(srcdir)/'`proc_open.c
proc_open-proc_open.obj: proc_open.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(proc_open_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT proc_open-proc_open.obj -MD -MP -MF $(DEPDIR)/proc_open-proc_open.Tpo -c -o proc_open-proc_open.obj `if test -f 'proc_open.c'; then $(CYGPATH_W) 'proc_open.c'; else $(CYGPATH_W) '$(srcdir)/proc_open.c'; fi`
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/proc_open-proc_open.Tpo $(DEPDIR)/proc_open-proc_open.Po
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/proc_open-proc_open.Tpo $(DEPDIR)/proc_open-proc_open.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='proc_open.c' object='proc_open-proc_open.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(proc_open_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o proc_open-proc_open.obj `if test -f 'proc_open.c'; then $(CYGPATH_W) 'proc_open.c'; else $(CYGPATH_W) '$(srcdir)/proc_open.c'; fi`
proc_open-buffer.o: buffer.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(proc_open_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT proc_open-buffer.o -MD -MP -MF $(DEPDIR)/proc_open-buffer.Tpo -c -o proc_open-buffer.o `test -f 'buffer.c' || echo '$(srcdir)/'`buffer.c
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/proc_open-buffer.Tpo $(DEPDIR)/proc_open-buffer.Po
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/proc_open-buffer.Tpo $(DEPDIR)/proc_open-buffer.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='buffer.c' object='proc_open-buffer.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(proc_open_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o proc_open-buffer.o `test -f 'buffer.c' || echo '$(srcdir)/'`buffer.c
proc_open-buffer.obj: buffer.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(proc_open_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT proc_open-buffer.obj -MD -MP -MF $(DEPDIR)/proc_open-buffer.Tpo -c -o proc_open-buffer.obj `if test -f 'buffer.c'; then $(CYGPATH_W) 'buffer.c'; else $(CYGPATH_W) '$(srcdir)/buffer.c'; fi`
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/proc_open-buffer.Tpo $(DEPDIR)/proc_open-buffer.Po
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/proc_open-buffer.Tpo $(DEPDIR)/proc_open-buffer.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='buffer.c' object='proc_open-buffer.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(proc_open_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o proc_open-buffer.obj `if test -f 'buffer.c'; then $(CYGPATH_W) 'buffer.c'; else $(CYGPATH_W) '$(srcdir)/buffer.c'; fi`
@@ -1455,7 +1498,7 @@ tags: TAGS
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
- tags=; \
+ set x; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
@@ -1463,29 +1506,34 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
- if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- $$tags $$unique; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
fi
ctags: CTAGS
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
- tags=; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
- test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
- $$tags $$unique
+ $$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
- && cd $(top_srcdir) \
- && gtags -i $(GTAGS_ARGS) $$here
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
@@ -1506,13 +1554,17 @@ distdir: $(DISTFILES)
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
- cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
- test -f $(distdir)/$$file \
- || cp -p $$d/$$file $(distdir)/$$file \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
@@ -1546,6 +1598,7 @@ clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@@ -1569,6 +1622,8 @@ dvi-am:
html: html-am
+html-am:
+
info: info-am
info-am:
@@ -1577,18 +1632,28 @@ install-data-am:
install-dvi: install-dvi-am
+install-dvi-am:
+
install-exec-am: install-libLTLIBRARIES install-sbinPROGRAMS
install-html: install-html-am
+install-html-am:
+
install-info: install-info-am
+install-info-am:
+
install-man:
install-pdf: install-pdf-am
+install-pdf-am:
+
install-ps: install-ps-am
+install-ps-am:
+
installcheck-am:
maintainer-clean: maintainer-clean-am
@@ -1611,7 +1676,7 @@ ps-am:
uninstall-am: uninstall-libLTLIBRARIES uninstall-sbinPROGRAMS
-.MAKE: install-am install-strip
+.MAKE: all check install install-am install-strip
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
clean-libLTLIBRARIES clean-libtool clean-noinstPROGRAMS \
@@ -1635,14 +1700,14 @@ uninstall-am: uninstall-libLTLIBRARIES uninstall-sbinPROGRAMS
versionstamp:
@test -f versionstamp.h || touch versionstamp.h; \
REVISION=""; \
- if test -x "`which svnversion`"; then \
- REVISION="$$(LANG=C svnversion "$(top_srcdir)" 2>/dev/null || echo exported)"; \
+ if test -d "$(top_srcdir)/.svn" -a -x "`which svnversion`"; then \
+ REVISION="$$(LANG= LC_ALL=C svnversion "$(top_srcdir)" 2>/dev/null || echo exported)"; \
if test "$$REVISION" = "exported"; then \
REVISION=""; \
fi; \
fi; \
if test -z "$$REVISION" -a -x "`which git`"; then \
- REVISION="$$(cd "$(top_srcdir)"; LANG=C git describe --always 2>/dev/null || echo)"; \
+ REVISION="$$(cd "$(top_srcdir)"; LANG= LC_ALL=C git describe --always 2>/dev/null || echo)"; \
fi; \
if test -n "$$REVISION"; then \
echo "#define REPO_VERSION \"-devel-$$REVISION\"" > versionstamp.h.tmp; \
@@ -1670,6 +1735,7 @@ versionstamp:
@CROSS_COMPILING_FALSE@ $(LEMON) -q $(srcdir)/mod_ssi_exprparser.y $(srcdir)/lempar.c
@CROSS_COMPILING_FALSE@parsers: configparser.c mod_ssi_exprparser.c
+
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
diff --git a/src/array.c b/src/array.c
index ddcb578..e93906b 100644
--- a/src/array.c
+++ b/src/array.c
@@ -1,3 +1,6 @@
+#include "array.h"
+#include "buffer.h"
+
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
@@ -6,9 +9,6 @@
#include <errno.h>
#include <assert.h>
-#include "array.h"
-#include "buffer.h"
-
array *array_init(void) {
array *a;
diff --git a/src/array.h b/src/array.h
index 9b23699..84245c7 100644
--- a/src/array.h
+++ b/src/array.h
@@ -1,15 +1,18 @@
#ifndef ARRAY_H
#define ARRAY_H
-#include <stdlib.h>
#ifdef HAVE_CONFIG_H
-#include "config.h"
+# include "config.h"
#endif
+
#ifdef HAVE_PCRE_H
# include <pcre.h>
#endif
+
#include "buffer.h"
+#include <stdlib.h>
+
#define DATA_IS_STRING(x) (x->type == TYPE_STRING)
typedef enum { TYPE_UNSET, TYPE_STRING, TYPE_COUNT, TYPE_ARRAY, TYPE_INTEGER, TYPE_FASTCGI, TYPE_CONFIG } data_type_t;
diff --git a/src/base.h b/src/base.h
index bcb2325..d38026d 100644
--- a/src/base.h
+++ b/src/base.h
@@ -1,18 +1,21 @@
#ifndef _BASE_H_
#define _BASE_H_
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+#include "settings.h"
+
#include <sys/types.h>
#include <sys/time.h>
#include <sys/stat.h>
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
#include <limits.h>
+
#ifdef HAVE_STDINT_H
# include <stdint.h>
#endif
+
#ifdef HAVE_INTTYPES_H
# include <inttypes.h>
#endif
@@ -21,7 +24,6 @@
#include "array.h"
#include "chunk.h"
#include "keyvalue.h"
-#include "settings.h"
#include "fdevent.h"
#include "sys-socket.h"
#include "splaytree.h"
@@ -31,6 +33,9 @@
#if defined HAVE_LIBSSL && defined HAVE_OPENSSL_SSL_H
# define USE_OPENSSL
# include <openssl/ssl.h>
+# if ! defined OPENSSL_NO_TLSEXT && ! defined SSL_CTRL_SET_TLSEXT_HOSTNAME
+# define OPENSSL_NO_TLSEXT
+# endif
#endif
#ifdef HAVE_FAM_H
@@ -79,11 +84,10 @@ typedef int socklen_t;
# define SHUT_WR 1
#endif
-#include "settings.h"
-
typedef enum { T_CONFIG_UNSET,
T_CONFIG_STRING,
T_CONFIG_SHORT,
+ T_CONFIG_INT,
T_CONFIG_BOOLEAN,
T_CONFIG_ARRAY,
T_CONFIG_LOCAL,
@@ -272,6 +276,10 @@ typedef struct {
buffer *ssl_ca_file;
buffer *ssl_cipher_list;
unsigned short ssl_use_sslv2;
+ unsigned short ssl_verifyclient;
+ unsigned short ssl_verifyclient_enforce;
+ unsigned short ssl_verifyclient_depth;
+ buffer *ssl_verifyclient_username;
unsigned short use_ipv6;
unsigned short defer_accept;
@@ -281,7 +289,7 @@ typedef struct {
unsigned short etag_use_mtime;
unsigned short etag_use_size;
unsigned short force_lowercase_filenames; /* if the FS is case-insensitive, force all files to lower-case */
- unsigned short max_request_size;
+ unsigned int max_request_size;
unsigned short kbytes_per_second; /* connection kb/s limit */
@@ -363,7 +371,8 @@ typedef struct {
int is_readable;
int is_writable;
- int keep_alive; /* only request.c can enable it, all other just disable */
+ int keep_alive; /* only request.c can enable it, all other just disable */
+ int keep_alive_idle; /* remember max_keep_alive_idle from config */
int file_started;
int file_finished;
@@ -422,6 +431,9 @@ typedef struct {
#ifdef USE_OPENSSL
SSL *ssl;
buffer *ssl_error_want_reuse_buffer;
+# ifndef OPENSSL_NO_TLSEXT
+ buffer *tlsext_server_name;
+# endif
#endif
/* etag handling */
etag_flags_t etag_flags;
@@ -472,6 +484,7 @@ typedef struct {
buffer *errorlog_file;
unsigned short errorlog_use_syslog;
+ buffer *breakagelog_file;
unsigned short dont_daemonize;
buffer *changeroot;
@@ -490,7 +503,7 @@ typedef struct {
unsigned short max_worker;
unsigned short max_fds;
unsigned short max_conns;
- unsigned short max_request_size;
+ unsigned int max_request_size;
unsigned short log_request_header_on_error;
unsigned short log_state_handling;
@@ -538,7 +551,7 @@ typedef struct server {
/* the errorlog */
int errorlog_fd;
- enum { ERRORLOG_STDERR, ERRORLOG_FILE, ERRORLOG_SYSLOG, ERRORLOG_PIPE } errorlog_mode;
+ enum { ERRORLOG_FILE, ERRORLOG_FD, ERRORLOG_SYSLOG, ERRORLOG_PIPE } errorlog_mode;
buffer *errorlog_buf;
fdevents *ev, *ev_ins;
diff --git a/src/bitset.c b/src/bitset.c
index 7fe5662..555f244 100644
--- a/src/bitset.c
+++ b/src/bitset.c
@@ -1,12 +1,12 @@
+#include "buffer.h"
+#include "bitset.h"
+
#include <limits.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <assert.h>
-#include "bitset.h"
-#include "buffer.h"
-
#define BITSET_BITS \
( CHAR_BIT * sizeof(size_t) )
diff --git a/src/buffer.c b/src/buffer.c
index 7300d7f..7520b1d 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -1,3 +1,5 @@
+#include "buffer.h"
+
#include <stdlib.h>
#include <string.h>
@@ -5,8 +7,6 @@
#include <assert.h>
#include <ctype.h>
-#include "buffer.h"
-
static const char hex_chars[] = "0123456789abcdef";
diff --git a/src/buffer.h b/src/buffer.h
index 571506e..67a47ab 100644
--- a/src/buffer.h
+++ b/src/buffer.h
@@ -1,15 +1,15 @@
#ifndef _BUFFER_H_
#define _BUFFER_H_
-#include <stdlib.h>
-#include <sys/types.h>
-
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include "settings.h"
+#include <stdlib.h>
+#include <sys/types.h>
+
typedef struct {
char *ptr;
diff --git a/src/chunk.c b/src/chunk.c
index 6eb45c3..0cc26da 100644
--- a/src/chunk.c
+++ b/src/chunk.c
@@ -4,6 +4,8 @@
*
*/
+#include "chunk.h"
+
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/mman.h>
@@ -16,8 +18,6 @@
#include <errno.h>
#include <string.h>
-#include "chunk.h"
-
chunkqueue *chunkqueue_init(void) {
chunkqueue *cq;
diff --git a/src/configfile-glue.c b/src/configfile-glue.c
index 0fa665c..782eb81 100644
--- a/src/configfile-glue.c
+++ b/src/configfile-glue.c
@@ -1,6 +1,3 @@
-#include <string.h>
-#include <stdlib.h>
-
#include "base.h"
#include "buffer.h"
#include "array.h"
@@ -9,6 +6,9 @@
#include "configfile.h"
+#include <string.h>
+#include <stdlib.h>
+
/**
* like all glue code this file contains functions which
* are the external interface of lighttpd. The functions
@@ -103,7 +103,6 @@ int config_insert_values_internal(server *srv, array *ca, const config_values_t
if (e != ds->value->ptr && !*e && l >=0 && l <= 65535) {
*((unsigned short *)(cv[i].destination)) = l;
break;
-
}
}
@@ -112,7 +111,37 @@ int config_insert_values_internal(server *srv, array *ca, const config_values_t
return -1;
}
default:
- log_error_write(srv, __FILE__, __LINE__, "ssds", "unexpected type for key:", cv[i].key, du->type, "expected a integer, range 0 ... 65535");
+ log_error_write(srv, __FILE__, __LINE__, "ssds", "unexpected type for key:", cv[i].key, du->type, "expected a short integer, range 0 ... 65535");
+ return -1;
+ }
+ break;
+ case T_CONFIG_INT:
+ switch(du->type) {
+ case TYPE_INTEGER: {
+ data_integer *di = (data_integer *)du;
+
+ *((unsigned int *)(cv[i].destination)) = di->value;
+ break;
+ }
+ case TYPE_STRING: {
+ data_string *ds = (data_string *)du;
+
+ if (ds->value->ptr && *ds->value->ptr) {
+ char *e;
+ long l = strtol(ds->value->ptr, &e, 10);
+ if (e != ds->value->ptr && !*e && l >= 0) {
+ *((unsigned int *)(cv[i].destination)) = l;
+ break;
+ }
+ }
+
+
+ log_error_write(srv, __FILE__, __LINE__, "ssb", "got a string but expected an integer:", cv[i].key, ds->value);
+
+ return -1;
+ }
+ default:
+ log_error_write(srv, __FILE__, __LINE__, "ssds", "unexpected type for key:", cv[i].key, du->type, "expected an integer, range 0 ... 4294967295");
return -1;
}
break;
@@ -289,6 +318,10 @@ static cond_result_t config_check_cond_nocache(server *srv, connection *con, dat
default:
break;
}
+#if defined USE_OPENSSL && ! defined OPENSSL_NO_TLSEXT
+ } else if (!buffer_is_empty(con->tlsext_server_name)) {
+ l = con->tlsext_server_name;
+#endif
} else {
l = srv->empty_string;
}
diff --git a/src/configfile.c b/src/configfile.c
index 11117e7..01213e7 100644
--- a/src/configfile.c
+++ b/src/configfile.c
@@ -1,3 +1,12 @@
+#include "server.h"
+#include "log.h"
+#include "stream.h"
+#include "plugin.h"
+
+#include "configparser.h"
+#include "configfile.h"
+#include "proc_open.h"
+
#include <sys/stat.h>
#include <stdlib.h>
@@ -10,18 +19,6 @@
#include <limits.h>
#include <assert.h>
-#include "server.h"
-#include "log.h"
-#include "stream.h"
-#include "plugin.h"
-#ifdef USE_LICENSE
-#include "license.h"
-#endif
-
-#include "configparser.h"
-#include "configfile.h"
-#include "proc_open.h"
-
static int config_insert(server *srv) {
size_t i;
@@ -42,12 +39,12 @@ static int config_insert(server *srv) {
{ "server.event-handler", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_SERVER }, /* 10 */
{ "server.pid-file", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_SERVER }, /* 11 */
- { "server.max-request-size", NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION }, /* 12 */
+ { "server.max-request-size", NULL, T_CONFIG_INT, T_CONFIG_SCOPE_CONNECTION }, /* 12 */
{ "server.max-worker", NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_SERVER }, /* 13 */
{ "server.document-root", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 14 */
- { "server.force-lowercase-filenames", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_SERVER }, /* 15 */
+ { "server.force-lowercase-filenames", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_SERVER },/* 15 */
{ "debug.log-condition-handling", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_SERVER }, /* 16 */
- { "server.max-keep-alive-requests", NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION }, /* 17 */
+ { "server.max-keep-alive-requests", NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION },/* 17 */
{ "server.name", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 18 */
{ "server.max-keep-alive-idle", NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION }, /* 19 */
@@ -91,12 +88,17 @@ static int config_insert(server *srv) {
{ "server.core-files", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION }, /* 46 */
{ "ssl.cipher-list", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_SERVER }, /* 47 */
{ "ssl.use-sslv2", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION }, /* 48 */
- { "etag.use-inode", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_SERVER }, /* 49 */
- { "etag.use-mtime", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_SERVER }, /* 50 */
- { "etag.use-size", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_SERVER }, /* 51 */
+ { "etag.use-inode", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_SERVER }, /* 49 */
+ { "etag.use-mtime", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_SERVER }, /* 50 */
+ { "etag.use-size", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_SERVER }, /* 51 */
{ "server.reject-expect-100-with-417", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_SERVER }, /* 52 */
{ "debug.log-timeouts", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION }, /* 53 */
- { "server.defer-accept", NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION }, /* 54 */
+ { "server.defer-accept", NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION }, /* 54 */
+ { "server.breakagelog", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_SERVER }, /* 55 */
+ { "ssl.verifyclient.activate", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_SERVER }, /* 56 */
+ { "ssl.verifyclient.enforce", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_SERVER }, /* 57 */
+ { "ssl.verifyclient.depth", NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_SERVER }, /* 58 */
+ { "ssl.verifyclient.username", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_SERVER }, /* 59 */
{ "server.host", "use server.bind instead", T_CONFIG_DEPRECATED, T_CONFIG_SCOPE_UNSET },
{ "server.docroot", "use server.document-root instead", T_CONFIG_DEPRECATED, T_CONFIG_SCOPE_UNSET },
{ "server.virtual-root", "load mod_simple_vhost and use simple-vhost.server-root instead", T_CONFIG_DEPRECATED, T_CONFIG_SCOPE_UNSET },
@@ -139,6 +141,8 @@ static int config_insert(server *srv) {
cv[43].destination = &(srv->srvconf.max_conns);
cv[12].destination = &(srv->srvconf.max_request_size);
cv[52].destination = &(srv->srvconf.reject_expect_100_with_417);
+ cv[55].destination = srv->srvconf.breakagelog_file;
+
srv->config_storage = calloc(1, srv->config_context->used * sizeof(specific_config *));
assert(srv->config_storage);
@@ -179,6 +183,10 @@ static int config_insert(server *srv) {
s->global_kbytes_per_second = 0;
s->global_bytes_per_second_cnt = 0;
s->global_bytes_per_second_cnt_ptr = &s->global_bytes_per_second_cnt;
+ s->ssl_verifyclient = 0;
+ s->ssl_verifyclient_enforce = 1;
+ s->ssl_verifyclient_username = buffer_init();
+ s->ssl_verifyclient_depth = 9;
cv[2].destination = s->errorfile_prefix;
@@ -225,6 +233,12 @@ static int config_insert(server *srv) {
cv[50].destination = &(s->etag_use_mtime);
cv[51].destination = &(s->etag_use_size);
+ /* ssl.verify */
+ cv[56].destination = &(s->ssl_verifyclient);
+ cv[57].destination = &(s->ssl_verifyclient_enforce);
+ cv[58].destination = &(s->ssl_verifyclient_depth);
+ cv[59].destination = s->ssl_verifyclient_username;
+
srv->config_storage[i] = s;
if (0 != (ret = config_insert_values_global(srv, ((data_config *)srv->config_context->data[i])->value, cv))) {
@@ -290,19 +304,28 @@ int config_setup_connection(server *srv, connection *con) {
PATCH(log_condition_handling);
PATCH(log_file_not_found);
PATCH(log_ssl_noise);
+ PATCH(log_timeouts);
PATCH(range_requests);
PATCH(force_lowercase_filenames);
PATCH(is_ssl);
PATCH(ssl_pemfile);
+#ifdef USE_OPENSSL
+ PATCH(ssl_ctx);
+#endif
PATCH(ssl_ca_file);
PATCH(ssl_cipher_list);
PATCH(ssl_use_sslv2);
PATCH(etag_use_inode);
PATCH(etag_use_mtime);
PATCH(etag_use_size);
-
+
+ PATCH(ssl_verifyclient);
+ PATCH(ssl_verifyclient_enforce);
+ PATCH(ssl_verifyclient_depth);
+ PATCH(ssl_verifyclient_username);
+
return 0;
}
@@ -351,6 +374,9 @@ int config_patch_connection(server *srv, connection *con, comp_key_t comp) {
PATCH(etag_use_size);
} else if (buffer_is_equal_string(du->key, CONST_STR_LEN("ssl.pemfile"))) {
PATCH(ssl_pemfile);
+#ifdef USE_OPENSSL
+ PATCH(ssl_ctx);
+#endif
} else if (buffer_is_equal_string(du->key, CONST_STR_LEN("ssl.ca-file"))) {
PATCH(ssl_ca_file);
} else if (buffer_is_equal_string(du->key, CONST_STR_LEN("ssl.use-sslv2"))) {
@@ -391,6 +417,14 @@ int config_patch_connection(server *srv, connection *con, comp_key_t comp) {
PATCH(global_kbytes_per_second);
PATCH(global_bytes_per_second_cnt);
con->conf.global_bytes_per_second_cnt_ptr = &s->global_bytes_per_second_cnt;
+ } else if (buffer_is_equal_string(du->key, CONST_STR_LEN("ssl.verifyclient.activate"))) {
+ PATCH(ssl_verifyclient);
+ } else if (buffer_is_equal_string(du->key, CONST_STR_LEN("ssl.verifyclient.enforce"))) {
+ PATCH(ssl_verifyclient_enforce);
+ } else if (buffer_is_equal_string(du->key, CONST_STR_LEN("ssl.verifyclient.depth"))) {
+ PATCH(ssl_verifyclient_depth);
+ } else if (buffer_is_equal_string(du->key, CONST_STR_LEN("ssl.verifyclient.username"))) {
+ PATCH(ssl_verifyclient_username);
}
}
}
@@ -1135,15 +1169,15 @@ int config_set_defaults(server *srv) {
* - select works everywhere
* - linux-* are experimental
*/
+#ifdef USE_LINUX_EPOLL
+ { FDEVENT_HANDLER_LINUX_SYSEPOLL, "linux-sysepoll" },
+#endif
#ifdef USE_POLL
{ FDEVENT_HANDLER_POLL, "poll" },
#endif
#ifdef USE_SELECT
{ FDEVENT_HANDLER_SELECT, "select" },
#endif
-#ifdef USE_LINUX_EPOLL
- { FDEVENT_HANDLER_LINUX_SYSEPOLL, "linux-sysepoll" },
-#endif
#ifdef USE_LINUX_SIGIO
{ FDEVENT_HANDLER_LINUX_RTSIG, "linux-rtsig" },
#endif
diff --git a/src/configparser.c b/src/configparser.c
index 5dd2739..24e973b 100644
--- a/src/configparser.c
+++ b/src/configparser.c
@@ -6,16 +6,14 @@
#include <stdio.h>
#line 5 "../../src/configparser.y"
-#include <assert.h>
-#include <stdio.h>
-#include <string.h>
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
#include "configfile.h"
#include "buffer.h"
#include "array.h"
+#include <assert.h>
+#include <stdio.h>
+#include <string.h>
+
static void configparser_push(config_t *ctx, data_config *dc, int isnew) {
if (isnew) {
dc->context_ndx = ctx->all_configs->used;
@@ -75,7 +73,7 @@ data_unset *configparser_merge_data(data_unset *op1, const data_unset *op2) {
op1->free(op1);
return (data_unset *)ds;
} else {
- fprintf(stderr, "data type mismatch, cannot be merge\n");
+ fprintf(stderr, "data type mismatch, cannot merge\n");
return NULL;
}
}
@@ -109,7 +107,7 @@ data_unset *configparser_merge_data(data_unset *op1, const data_unset *op2) {
}
-#line 113 "configparser.c"
+#line 111 "configparser.c"
/* Next is all token values, in a form suitable for use by makeheaders.
** This section will be null unless lemon is run with the -m switch.
*/
@@ -520,44 +518,44 @@ static void yy_destructor(YYCODETYPE yymajor, YYMINORTYPE *yypminor){
case 23:
case 24:
case 25:
-#line 146 "../../src/configparser.y"
+#line 144 "../../src/configparser.y"
{ buffer_free((yypminor->yy0)); }
-#line 525 "configparser.c"
+#line 523 "configparser.c"
break;
case 35:
-#line 137 "../../src/configparser.y"
+#line 135 "../../src/configparser.y"
{ (yypminor->yy41)->free((yypminor->yy41)); }
-#line 530 "configparser.c"
+#line 528 "configparser.c"
break;
case 36:
-#line 138 "../../src/configparser.y"
+#line 136 "../../src/configparser.y"
{ (yypminor->yy41)->free((yypminor->yy41)); }
-#line 535 "configparser.c"
+#line 533 "configparser.c"
break;
case 37:
-#line 139 "../../src/configparser.y"
+#line 137 "../../src/configparser.y"
{ (yypminor->yy41)->free((yypminor->yy41)); }
-#line 540 "configparser.c"
+#line 538 "configparser.c"
break;
case 39:
-#line 140 "../../src/configparser.y"
+#line 138 "../../src/configparser.y"
{ array_free((yypminor->yy40)); }
-#line 545 "configparser.c"
+#line 543 "configparser.c"
break;
case 40:
-#line 141 "../../src/configparser.y"
+#line 139 "../../src/configparser.y"
{ array_free((yypminor->yy40)); }
-#line 550 "configparser.c"
+#line 548 "configparser.c"
break;
case 41:
-#line 142 "../../src/configparser.y"
+#line 140 "../../src/configparser.y"
{ buffer_free((yypminor->yy43)); }
-#line 555 "configparser.c"
+#line 553 "configparser.c"
break;
case 42:
-#line 143 "../../src/configparser.y"
+#line 141 "../../src/configparser.y"
{ buffer_free((yypminor->yy43)); }
-#line 560 "configparser.c"
+#line 558 "configparser.c"
break;
default: break; /* If no destructor action specified: do nothing */
}
@@ -825,9 +823,9 @@ static void yy_reduce(
/* No destructor defined for global */
break;
case 5:
-#line 119 "../../src/configparser.y"
+#line 117 "../../src/configparser.y"
{ yymsp[-1].minor.yy78 = NULL; }
-#line 830 "configparser.c"
+#line 828 "configparser.c"
yy_destructor(1,&yymsp[0].minor);
break;
case 6:
@@ -840,7 +838,7 @@ static void yy_reduce(
yy_destructor(1,&yymsp[0].minor);
break;
case 9:
-#line 148 "../../src/configparser.y"
+#line 146 "../../src/configparser.y"
{
if (ctx->ok) {
buffer_copy_string_buffer(yymsp[0].minor.yy41->key, yymsp[-2].minor.yy43);
@@ -864,11 +862,11 @@ static void yy_reduce(
buffer_free(yymsp[-2].minor.yy43);
yymsp[-2].minor.yy43 = NULL;
}
-#line 867 "configparser.c"
+#line 865 "configparser.c"
yy_destructor(2,&yymsp[-1].minor);
break;
case 10:
-#line 172 "../../src/configparser.y"
+#line 170 "../../src/configparser.y"
{
array *vars = ctx->current->value;
data_unset *du;
@@ -893,7 +891,6 @@ static void yy_reduce(
du = configparser_merge_data(du, yymsp[0].minor.yy41);
if (NULL == du) {
ctx->ok = 0;
- du->free(du);
}
else {
buffer_copy_string_buffer(du->key, yymsp[-2].minor.yy43);
@@ -908,11 +905,11 @@ static void yy_reduce(
yymsp[-2].minor.yy43 = NULL;
yymsp[0].minor.yy41 = NULL;
}
-#line 911 "configparser.c"
+#line 908 "configparser.c"
yy_destructor(3,&yymsp[-1].minor);
break;
case 11:
-#line 212 "../../src/configparser.y"
+#line 209 "../../src/configparser.y"
{
if (strchr(yymsp[0].minor.yy0->ptr, '.') == NULL) {
yygotominor.yy43 = buffer_init_string("var.");
@@ -924,10 +921,10 @@ static void yy_reduce(
yymsp[0].minor.yy0 = NULL;
}
}
-#line 927 "configparser.c"
+#line 924 "configparser.c"
break;
case 12:
-#line 224 "../../src/configparser.y"
+#line 221 "../../src/configparser.y"
{
yygotominor.yy41 = configparser_merge_data(yymsp[-2].minor.yy41, yymsp[0].minor.yy41);
if (NULL == yygotominor.yy41) {
@@ -937,19 +934,19 @@ static void yy_reduce(
yymsp[0].minor.yy41->free(yymsp[0].minor.yy41);
yymsp[0].minor.yy41 = NULL;
}
-#line 940 "configparser.c"
+#line 937 "configparser.c"
yy_destructor(5,&yymsp[-1].minor);
break;
case 13:
-#line 234 "../../src/configparser.y"
+#line 231 "../../src/configparser.y"
{
yygotominor.yy41 = yymsp[0].minor.yy41;
yymsp[0].minor.yy41 = NULL;
}
-#line 949 "configparser.c"
+#line 946 "configparser.c"
break;
case 14:
-#line 239 "../../src/configparser.y"
+#line 236 "../../src/configparser.y"
{
yygotominor.yy41 = NULL;
if (strncmp(yymsp[0].minor.yy43->ptr, "env.", sizeof("env.") - 1) == 0) {
@@ -976,59 +973,59 @@ static void yy_reduce(
buffer_free(yymsp[0].minor.yy43);
yymsp[0].minor.yy43 = NULL;
}
-#line 979 "configparser.c"
+#line 976 "configparser.c"
break;
case 15:
-#line 266 "../../src/configparser.y"
+#line 263 "../../src/configparser.y"
{
yygotominor.yy41 = (data_unset *)data_string_init();
buffer_copy_string_buffer(((data_string *)(yygotominor.yy41))->value, yymsp[0].minor.yy0);
buffer_free(yymsp[0].minor.yy0);
yymsp[0].minor.yy0 = NULL;
}
-#line 989 "configparser.c"
+#line 986 "configparser.c"
break;
case 16:
-#line 273 "../../src/configparser.y"
+#line 270 "../../src/configparser.y"
{
yygotominor.yy41 = (data_unset *)data_integer_init();
((data_integer *)(yygotominor.yy41))->value = strtol(yymsp[0].minor.yy0->ptr, NULL, 10);
buffer_free(yymsp[0].minor.yy0);
yymsp[0].minor.yy0 = NULL;
}
-#line 999 "configparser.c"
+#line 996 "configparser.c"
break;
case 17:
-#line 279 "../../src/configparser.y"
+#line 276 "../../src/configparser.y"
{
yygotominor.yy41 = (data_unset *)data_array_init();
array_free(((data_array *)(yygotominor.yy41))->value);
((data_array *)(yygotominor.yy41))->value = yymsp[0].minor.yy40;
yymsp[0].minor.yy40 = NULL;
}
-#line 1009 "configparser.c"
+#line 1006 "configparser.c"
break;
case 18:
-#line 285 "../../src/configparser.y"
+#line 282 "../../src/configparser.y"
{
yygotominor.yy40 = array_init();
}
-#line 1016 "configparser.c"
+#line 1013 "configparser.c"
yy_destructor(8,&yymsp[-1].minor);
yy_destructor(9,&yymsp[0].minor);
break;
case 19:
-#line 288 "../../src/configparser.y"
+#line 285 "../../src/configparser.y"
{
yygotominor.yy40 = yymsp[-1].minor.yy40;
yymsp[-1].minor.yy40 = NULL;
}
-#line 1026 "configparser.c"
+#line 1023 "configparser.c"
yy_destructor(8,&yymsp[-2].minor);
yy_destructor(9,&yymsp[0].minor);
break;
case 20:
-#line 293 "../../src/configparser.y"
+#line 290 "../../src/configparser.y"
{
if (buffer_is_empty(yymsp[0].minor.yy41->key) ||
NULL == array_get_element(yymsp[-2].minor.yy40, yymsp[0].minor.yy41->key->ptr)) {
@@ -1045,37 +1042,37 @@ static void yy_reduce(
yygotominor.yy40 = yymsp[-2].minor.yy40;
yymsp[-2].minor.yy40 = NULL;
}
-#line 1048 "configparser.c"
+#line 1045 "configparser.c"
yy_destructor(10,&yymsp[-1].minor);
break;
case 21:
-#line 310 "../../src/configparser.y"
+#line 307 "../../src/configparser.y"
{
yygotominor.yy40 = yymsp[-1].minor.yy40;
yymsp[-1].minor.yy40 = NULL;
}
-#line 1057 "configparser.c"
+#line 1054 "configparser.c"
yy_destructor(10,&yymsp[0].minor);
break;
case 22:
-#line 315 "../../src/configparser.y"
+#line 312 "../../src/configparser.y"
{
yygotominor.yy40 = array_init();
array_insert_unique(yygotominor.yy40, yymsp[0].minor.yy41);
yymsp[0].minor.yy41 = NULL;
}
-#line 1067 "configparser.c"
+#line 1064 "configparser.c"
break;
case 23:
-#line 321 "../../src/configparser.y"
+#line 318 "../../src/configparser.y"
{
yygotominor.yy41 = yymsp[0].minor.yy41;
yymsp[0].minor.yy41 = NULL;
}
-#line 1075 "configparser.c"
+#line 1072 "configparser.c"
break;
case 24:
-#line 325 "../../src/configparser.y"
+#line 322 "../../src/configparser.y"
{
buffer_copy_string_buffer(yymsp[0].minor.yy41->key, yymsp[-2].minor.yy43);
buffer_free(yymsp[-2].minor.yy43);
@@ -1084,7 +1081,7 @@ static void yy_reduce(
yygotominor.yy41 = yymsp[0].minor.yy41;
yymsp[0].minor.yy41 = NULL;
}
-#line 1087 "configparser.c"
+#line 1084 "configparser.c"
yy_destructor(11,&yymsp[-1].minor);
break;
case 25:
@@ -1093,18 +1090,18 @@ static void yy_reduce(
case 26:
break;
case 27:
-#line 337 "../../src/configparser.y"
+#line 334 "../../src/configparser.y"
{
data_config *dc;
dc = (data_config *)array_get_element(ctx->srv->config_context, "global");
assert(dc);
configparser_push(ctx, dc, 0);
}
-#line 1103 "configparser.c"
+#line 1100 "configparser.c"
yy_destructor(12,&yymsp[0].minor);
break;
case 28:
-#line 344 "../../src/configparser.y"
+#line 341 "../../src/configparser.y"
{
data_config *cur;
@@ -1115,16 +1112,19 @@ static void yy_reduce(
yygotominor.yy78 = cur;
}
-#line 1118 "configparser.c"
+#line 1115 "configparser.c"
/* No destructor defined for globalstart */
yy_destructor(13,&yymsp[-2].minor);
/* No destructor defined for metalines */
yy_destructor(14,&yymsp[0].minor);
break;
case 29:
-#line 355 "../../src/configparser.y"
+#line 352 "../../src/configparser.y"
{
- assert(yymsp[-3].minor.yy78->context_ndx < yymsp[0].minor.yy78->context_ndx);
+ if (yymsp[-3].minor.yy78->context_ndx >= yymsp[0].minor.yy78->context_ndx) {
+ fprintf(stderr, "unreachable else condition\n");
+ ctx->ok = 0;
+ }
yymsp[0].minor.yy78->prev = yymsp[-3].minor.yy78;
yymsp[-3].minor.yy78->next = yymsp[0].minor.yy78;
yygotominor.yy78 = yymsp[0].minor.yy78;
@@ -1256,7 +1256,7 @@ static void yy_reduce(
case CONFIG_COND_MATCH: {
#ifdef HAVE_PCRE_H
const char *errptr;
- int erroff;
+ int erroff, captures;
if (NULL == (dc->regex =
pcre_compile(rvalue->ptr, 0, &errptr, &erroff, NULL))) {
@@ -1273,6 +1273,14 @@ static void yy_reduce(
fprintf(stderr, "studying regex failed: %s -> %s\n",
rvalue->ptr, errptr);
ctx->ok = 0;
+ } else if (0 != (pcre_fullinfo(dc->regex, dc->regex_study, PCRE_INFO_CAPTURECOUNT, &captures))) {
+ fprintf(stderr, "getting capture count for regex failed: %s\n",
+ rvalue->ptr);
+ ctx->ok = 0;
+ } else if (captures > 9) {
+ fprintf(stderr, "Too many captures in regex, use (?:...) instead of (...): %s\n",
+ rvalue->ptr);
+ ctx->ok = 0;
} else {
dc->string = buffer_init_buffer(rvalue);
}
@@ -1304,45 +1312,45 @@ static void yy_reduce(
yymsp[0].minor.yy41->free(yymsp[0].minor.yy41);
yymsp[0].minor.yy41 = NULL;
}
-#line 1307 "configparser.c"
+#line 1315 "configparser.c"
yy_destructor(16,&yymsp[-6].minor);
yy_destructor(18,&yymsp[-4].minor);
yy_destructor(19,&yymsp[-2].minor);
break;
case 33:
-#line 521 "../../src/configparser.y"
+#line 529 "../../src/configparser.y"
{
yygotominor.yy27 = CONFIG_COND_EQ;
}
-#line 1317 "configparser.c"
+#line 1325 "configparser.c"
yy_destructor(20,&yymsp[0].minor);
break;
case 34:
-#line 524 "../../src/configparser.y"
+#line 532 "../../src/configparser.y"
{
yygotominor.yy27 = CONFIG_COND_MATCH;
}
-#line 1325 "configparser.c"
+#line 1333 "configparser.c"
yy_destructor(21,&yymsp[0].minor);
break;
case 35:
-#line 527 "../../src/configparser.y"
+#line 535 "../../src/configparser.y"
{
yygotominor.yy27 = CONFIG_COND_NE;
}
-#line 1333 "configparser.c"
+#line 1341 "configparser.c"
yy_destructor(22,&yymsp[0].minor);
break;
case 36:
-#line 530 "../../src/configparser.y"
+#line 538 "../../src/configparser.y"
{
yygotominor.yy27 = CONFIG_COND_NOMATCH;
}
-#line 1341 "configparser.c"
+#line 1349 "configparser.c"
yy_destructor(23,&yymsp[0].minor);
break;
case 37:
-#line 534 "../../src/configparser.y"
+#line 542 "../../src/configparser.y"
{
yygotominor.yy43 = NULL;
if (ctx->ok) {
@@ -1359,10 +1367,10 @@ static void yy_reduce(
yymsp[0].minor.yy41->free(yymsp[0].minor.yy41);
yymsp[0].minor.yy41 = NULL;
}
-#line 1362 "configparser.c"
+#line 1370 "configparser.c"
break;
case 38:
-#line 551 "../../src/configparser.y"
+#line 559 "../../src/configparser.y"
{
if (ctx->ok) {
if (0 != config_parse_file(ctx->srv, ctx, yymsp[0].minor.yy43->ptr)) {
@@ -1372,11 +1380,11 @@ static void yy_reduce(
yymsp[0].minor.yy43 = NULL;
}
}
-#line 1375 "configparser.c"
+#line 1383 "configparser.c"
yy_destructor(24,&yymsp[-1].minor);
break;
case 39:
-#line 561 "../../src/configparser.y"
+#line 569 "../../src/configparser.y"
{
if (ctx->ok) {
if (0 != config_parse_cmd(ctx->srv, ctx, yymsp[0].minor.yy43->ptr)) {
@@ -1386,7 +1394,7 @@ static void yy_reduce(
yymsp[0].minor.yy43 = NULL;
}
}
-#line 1389 "configparser.c"
+#line 1397 "configparser.c"
yy_destructor(25,&yymsp[-1].minor);
break;
};
@@ -1416,11 +1424,11 @@ static void yy_parse_failed(
while( yypParser->yyidx>=0 ) yy_pop_parser_stack(yypParser);
/* Here code is inserted which will be executed whenever the
** parser fails */
-#line 110 "../../src/configparser.y"
+#line 108 "../../src/configparser.y"
ctx->ok = 0;
-#line 1423 "configparser.c"
+#line 1431 "configparser.c"
configparserARG_STORE; /* Suppress warning about unused %extra_argument variable */
}
diff --git a/src/configparser.y b/src/configparser.y
index d6c33a9..aa6fe98 100644
--- a/src/configparser.y
+++ b/src/configparser.y
@@ -3,16 +3,14 @@
%name configparser
%include {
-#include <assert.h>
-#include <stdio.h>
-#include <string.h>
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
#include "configfile.h"
#include "buffer.h"
#include "array.h"
+#include <assert.h>
+#include <stdio.h>
+#include <string.h>
+
static void configparser_push(config_t *ctx, data_config *dc, int isnew) {
if (isnew) {
dc->context_ndx = ctx->all_configs->used;
@@ -72,7 +70,7 @@ data_unset *configparser_merge_data(data_unset *op1, const data_unset *op2) {
op1->free(op1);
return (data_unset *)ds;
} else {
- fprintf(stderr, "data type mismatch, cannot be merge\n");
+ fprintf(stderr, "data type mismatch, cannot merge\n");
return NULL;
}
}
@@ -193,7 +191,6 @@ varline ::= key(A) APPEND expression(B). {
du = configparser_merge_data(du, B);
if (NULL == du) {
ctx->ok = 0;
- du->free(du);
}
else {
buffer_copy_string_buffer(du->key, A);
@@ -353,7 +350,10 @@ global(A) ::= globalstart LCURLY metalines RCURLY. {
}
condlines(A) ::= condlines(B) eols ELSE condline(C). {
- assert(B->context_ndx < C->context_ndx);
+ if (B->context_ndx >= C->context_ndx) {
+ fprintf(stderr, "unreachable else condition\n");
+ ctx->ok = 0;
+ }
C->prev = B;
B->next = C;
A = C;
@@ -470,7 +470,7 @@ context ::= DOLLAR SRVVARNAME(B) LBRACKET stringop(C) RBRACKET cond(E) expressio
case CONFIG_COND_MATCH: {
#ifdef HAVE_PCRE_H
const char *errptr;
- int erroff;
+ int erroff, captures;
if (NULL == (dc->regex =
pcre_compile(rvalue->ptr, 0, &errptr, &erroff, NULL))) {
@@ -487,6 +487,14 @@ context ::= DOLLAR SRVVARNAME(B) LBRACKET stringop(C) RBRACKET cond(E) expressio
fprintf(stderr, "studying regex failed: %s -> %s\n",
rvalue->ptr, errptr);
ctx->ok = 0;
+ } else if (0 != (pcre_fullinfo(dc->regex, dc->regex_study, PCRE_INFO_CAPTURECOUNT, &captures))) {
+ fprintf(stderr, "getting capture count for regex failed: %s\n",
+ rvalue->ptr);
+ ctx->ok = 0;
+ } else if (captures > 9) {
+ fprintf(stderr, "Too many captures in regex, use (?:...) instead of (...): %s\n",
+ rvalue->ptr);
+ ctx->ok = 0;
} else {
dc->string = buffer_init_buffer(rvalue);
}
diff --git a/src/connections.c b/src/connections.c
index bddb914..daec12a 100644
--- a/src/connections.c
+++ b/src/connections.c
@@ -1,13 +1,3 @@
-#include <sys/stat.h>
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <unistd.h>
-#include <errno.h>
-#include <string.h>
-#include <fcntl.h>
-#include <assert.h>
-
#include "buffer.h"
#include "server.h"
#include "log.h"
@@ -25,6 +15,16 @@
#include "inet_ntop_cache.h"
+#include <sys/stat.h>
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <errno.h>
+#include <string.h>
+#include <fcntl.h>
+#include <assert.h>
+
#ifdef USE_OPENSSL
# include <openssl/ssl.h>
# include <openssl/err.h>
@@ -667,6 +667,9 @@ connection *connection_init(server *srv) {
CLEAN(server_name);
CLEAN(error_handler);
CLEAN(dst_addr_buf);
+#if defined USE_OPENSSL && ! defined OPENSSL_NO_TLSEXT
+ CLEAN(tlsext_server_name);
+#endif
#undef CLEAN
con->write_queue = chunkqueue_init();
@@ -731,6 +734,9 @@ void connections_free(server *srv) {
CLEAN(server_name);
CLEAN(error_handler);
CLEAN(dst_addr_buf);
+#if defined USE_OPENSSL && ! defined OPENSSL_NO_TLSEXT
+ CLEAN(tlsext_server_name);
+#endif
#undef CLEAN
free(con->plugin_ctx);
free(con->cond_cache);
@@ -782,13 +788,13 @@ int connection_reset(server *srv, connection *con) {
CLEAN(request.pathinfo);
CLEAN(request.request);
- CLEAN(request.orig_uri);
+ /* CLEAN(request.orig_uri); */
CLEAN(uri.scheme);
- CLEAN(uri.authority);
- CLEAN(uri.path);
+ /* CLEAN(uri.authority); */
+ /* CLEAN(uri.path); */
CLEAN(uri.path_raw);
- CLEAN(uri.query);
+ /* CLEAN(uri.query); */
CLEAN(physical.doc_root);
CLEAN(physical.path);
@@ -1183,7 +1189,7 @@ static handler_t connection_handle_fdevent(void *s, void *context, int revents)
/* FIXME: revents = 0x19 still means that we should read from the queue */
if (revents & FDEVENT_HUP) {
if (con->state == CON_STATE_CLOSE) {
- con->close_timeout_ts = srv->cur_ts - 2;
+ con->close_timeout_ts = srv->cur_ts - (HTTP_LINGER_TIMEOUT+1);
} else {
/* sigio reports the wrong event here
*
@@ -1250,9 +1256,11 @@ static handler_t connection_handle_fdevent(void *s, void *context, int revents)
/* */
read(con->fd, buf, sizeof(buf));
} else {
- /* nothing to read */
-
- con->close_timeout_ts = srv->cur_ts - 2;
+ /* 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.
+ */
}
}
@@ -1341,6 +1349,9 @@ connection *connection_accept(server *srv, server_socket *srv_socket) {
return NULL;
}
+#ifndef OPENSSL_NO_TLSEXT
+ SSL_set_app_data(con->ssl, con);
+#endif
SSL_set_accept_state(con->ssl);
con->conf.is_ssl=1;
@@ -1401,6 +1412,11 @@ int connection_state_machine(server *srv, connection *con) {
"state for fd", con->fd, connection_get_state(con->state));
}
+ buffer_reset(con->uri.authority);
+ buffer_reset(con->uri.path);
+ buffer_reset(con->uri.query);
+ buffer_reset(con->request.orig_uri);
+
if (http_request_parse(srv, con)) {
/* we have to read some data from the POST request */
@@ -1564,7 +1580,12 @@ int connection_state_machine(server *srv, connection *con) {
}
}
#endif
- connection_close(srv, con);
+ if ((0 == shutdown(con->fd, SHUT_WR))) {
+ con->close_timeout_ts = srv->cur_ts;
+ connection_set_state(srv, con, CON_STATE_CLOSE);
+ } else {
+ connection_close(srv, con);
+ }
srv->con_closed++;
}
@@ -1589,28 +1610,31 @@ int connection_state_machine(server *srv, connection *con) {
"state for fd", con->fd, connection_get_state(con->state));
}
- if (con->keep_alive) {
- if (ioctl(con->fd, FIONREAD, &b)) {
- log_error_write(srv, __FILE__, __LINE__, "ss",
- "ioctl() failed", strerror(errno));
- }
- if (b > 0) {
- char buf[1024];
- log_error_write(srv, __FILE__, __LINE__, "sdd",
- "CLOSE-read()", con->fd, b);
-
- /* */
- read(con->fd, buf, sizeof(buf));
- } else {
- /* nothing to read */
+ /* we have to do the linger_on_close stuff regardless
+ * of con->keep_alive; even non-keepalive sockets may
+ * 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) {
+ char buf[1024];
+ log_error_write(srv, __FILE__, __LINE__, "sdd",
+ "CLOSE-read()", con->fd, b);
- con->close_timeout_ts = srv->cur_ts - 2;
- }
+ /* */
+ read(con->fd, buf, sizeof(buf));
} else {
- con->close_timeout_ts = srv->cur_ts - 2;
+ /* 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.
+ */
}
- if (srv->cur_ts - con->close_timeout_ts > 1) {
+ if (srv->cur_ts - con->close_timeout_ts > HTTP_LINGER_TIMEOUT) {
connection_close(srv, con);
if (srv->srvconf.log_state_handling) {
@@ -1725,7 +1749,7 @@ int connection_state_machine(server *srv, connection *con) {
case HANDLER_FINISHED:
break;
default:
- log_error_write(srv, __FILE__, __LINE__, "");
+ log_error_write(srv, __FILE__, __LINE__, "sd", "unhandling return value", r);
break;
}
break;
@@ -1734,8 +1758,7 @@ int connection_state_machine(server *srv, connection *con) {
connection_reset(srv, con);
/* close the connection */
- if ((con->keep_alive == 1) &&
- (0 == shutdown(con->fd, SHUT_WR))) {
+ if ((0 == shutdown(con->fd, SHUT_WR))) {
con->close_timeout_ts = srv->cur_ts;
connection_set_state(srv, con, CON_STATE_CLOSE);
diff --git a/src/crc32.h b/src/crc32.h
index d671c53..c5b4245 100644
--- a/src/crc32.h
+++ b/src/crc32.h
@@ -2,15 +2,15 @@
#define __crc32cr_table_h__
#ifdef HAVE_CONFIG_H
-#include "config.h"
+# include "config.h"
#endif
#include <sys/types.h>
#if defined HAVE_STDINT_H
-#include <stdint.h>
+# include <stdint.h>
#elif defined HAVE_INTTYPES_H
-#include <inttypes.h>
+# include <inttypes.h>
#endif
uint32_t generate_crc32c(char *string, size_t length);
diff --git a/src/data_array.c b/src/data_array.c
index c07effb..094d8c0 100644
--- a/src/data_array.c
+++ b/src/data_array.c
@@ -1,9 +1,9 @@
+#include "array.h"
+
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
-#include "array.h"
-
static data_unset *data_array_copy(const data_unset *s) {
data_array *src = (data_array *)s;
data_array *ds = data_array_init();
diff --git a/src/data_config.c b/src/data_config.c
index a3b8cff..80e38de 100644
--- a/src/data_config.c
+++ b/src/data_config.c
@@ -1,9 +1,9 @@
+#include "array.h"
+
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
-#include "array.h"
-
static data_unset *data_config_copy(const data_unset *s) {
data_config *src = (data_config *)s;
data_config *ds = data_config_init();
diff --git a/src/data_count.c b/src/data_count.c
index 5c5a5f0..8d36c8b 100644
--- a/src/data_count.c
+++ b/src/data_count.c
@@ -1,9 +1,9 @@
+#include "array.h"
+
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
-#include "array.h"
-
static data_unset *data_count_copy(const data_unset *s) {
data_count *src = (data_count *)s;
data_count *ds = data_count_init();
diff --git a/src/data_fastcgi.c b/src/data_fastcgi.c
index 83e9266..e13a470 100644
--- a/src/data_fastcgi.c
+++ b/src/data_fastcgi.c
@@ -1,10 +1,10 @@
+#include "array.h"
+#include "fastcgi.h"
+
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
-#include "array.h"
-#include "fastcgi.h"
-
static data_unset *data_fastcgi_copy(const data_unset *s) {
data_fastcgi *src = (data_fastcgi *)s;
data_fastcgi *ds = data_fastcgi_init();
diff --git a/src/data_integer.c b/src/data_integer.c
index 5423407..63cbb10 100644
--- a/src/data_integer.c
+++ b/src/data_integer.c
@@ -1,9 +1,9 @@
+#include "array.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include "array.h"
-
static data_unset *data_integer_copy(const data_unset *s) {
data_integer *src = (data_integer *)s;
data_integer *ds = data_integer_init();
diff --git a/src/data_string.c b/src/data_string.c
index 5b2678d..919550b 100644
--- a/src/data_string.c
+++ b/src/data_string.c
@@ -1,10 +1,10 @@
+#include "array.h"
+
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
-#include "array.h"
-
static data_unset *data_string_copy(const data_unset *s) {
data_string *src = (data_string *)s;
data_string *ds = data_string_init();
diff --git a/src/etag.c b/src/etag.c
index c44278b..9ff585f 100644
--- a/src/etag.c
+++ b/src/etag.c
@@ -1,17 +1,13 @@
-#include <string.h>
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
+#include "buffer.h"
+#include "etag.h"
#if defined HAVE_STDINT_H
-#include <stdint.h>
+# include <stdint.h>
#elif defined HAVE_INTTYPES_H
-#include <inttypes.h>
+# include <inttypes.h>
#endif
-#include "buffer.h"
-#include "etag.h"
+#include <string.h>
int etag_is_equal(buffer *etag, const char *matches) {
if (etag && !buffer_is_empty(etag) && 0 == strcmp(etag->ptr, matches)) return 1;
diff --git a/src/etag.h b/src/etag.h
index 5fefe0f..97cb063 100644
--- a/src/etag.h
+++ b/src/etag.h
@@ -1,12 +1,12 @@
#ifndef ETAG_H
#define ETAG_H
+#include "buffer.h"
+
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
-#include "buffer.h"
-
typedef enum { ETAG_USE_INODE = 1, ETAG_USE_MTIME = 2, ETAG_USE_SIZE = 4 } etag_flags_t;
int etag_is_equal(buffer *etag, const char *matches);
diff --git a/src/fdevent.c b/src/fdevent.c
index 92ff0e9..de9ee91 100644
--- a/src/fdevent.c
+++ b/src/fdevent.c
@@ -1,6 +1,7 @@
-#include <sys/types.h>
+#include "fdevent.h"
+#include "buffer.h"
-#include "settings.h"
+#include <sys/types.h>
#include <unistd.h>
#include <stdlib.h>
@@ -9,8 +10,6 @@
#include <stdio.h>
#include <fcntl.h>
-#include "fdevent.h"
-#include "buffer.h"
fdevents *fdevent_init(size_t maxfds, fdevent_handler_t type) {
fdevents *ev;
diff --git a/src/fdevent.h b/src/fdevent.h
index 5629e9c..601acf1 100644
--- a/src/fdevent.h
+++ b/src/fdevent.h
@@ -2,17 +2,23 @@
#define _FDEVENT_H_
#ifdef HAVE_CONFIG_H
-#include "config.h"
+# include "config.h"
#endif
+
#include "settings.h"
#include "bitset.h"
+#if defined HAVE_STDINT_H
+# include <stdint.h>
+#elif defined HAVE_INTTYPES_H
+# include <inttypes.h>
+#endif
+
+#include <sys/types.h>
+
/* select event-system */
#if defined(HAVE_EPOLL_CTL) && defined(HAVE_SYS_EPOLL_H)
-# if defined HAVE_STDINT_H
-# include <stdint.h>
-# endif
# define USE_LINUX_EPOLL
# include <sys/epoll.h>
#endif
diff --git a/src/fdevent_freebsd_kqueue.c b/src/fdevent_freebsd_kqueue.c
index e21d6fd..948d52c 100644
--- a/src/fdevent_freebsd_kqueue.c
+++ b/src/fdevent_freebsd_kqueue.c
@@ -1,3 +1,7 @@
+#include "fdevent.h"
+#include "buffer.h"
+#include "server.h"
+
#include <sys/types.h>
#include <unistd.h>
@@ -8,11 +12,6 @@
#include <signal.h>
#include <fcntl.h>
-#include "fdevent.h"
-#include "settings.h"
-#include "buffer.h"
-#include "server.h"
-
#ifdef USE_FREEBSD_KQUEUE
#include <sys/event.h>
#include <sys/time.h>
diff --git a/src/fdevent_linux_rtsig.c b/src/fdevent_linux_rtsig.c
index 924e4c7..624c980 100644
--- a/src/fdevent_linux_rtsig.c
+++ b/src/fdevent_linux_rtsig.c
@@ -1,3 +1,6 @@
+#include "fdevent.h"
+#include "buffer.h"
+
#include <sys/types.h>
#include <unistd.h>
@@ -8,13 +11,8 @@
#include <signal.h>
#include <limits.h>
-#define __USE_GNU
#include <fcntl.h>
-#include "fdevent.h"
-#include "settings.h"
-#include "buffer.h"
-
#ifdef USE_LINUX_SIGIO
static void fdevent_linux_rtsig_free(fdevents *ev) {
free(ev->pollfds);
diff --git a/src/fdevent_linux_sysepoll.c b/src/fdevent_linux_sysepoll.c
index eb3ce11..a00fdd3 100644
--- a/src/fdevent_linux_sysepoll.c
+++ b/src/fdevent_linux_sysepoll.c
@@ -1,3 +1,6 @@
+#include "fdevent.h"
+#include "buffer.h"
+
#include <sys/types.h>
#include <unistd.h>
@@ -8,10 +11,6 @@
#include <signal.h>
#include <fcntl.h>
-#include "fdevent.h"
-#include "settings.h"
-#include "buffer.h"
-
#ifdef USE_LINUX_EPOLL
static void fdevent_linux_sysepoll_free(fdevents *ev) {
close(ev->epoll_fd);
diff --git a/src/fdevent_poll.c b/src/fdevent_poll.c
index 11d2c5e..6e63bd0 100644
--- a/src/fdevent_poll.c
+++ b/src/fdevent_poll.c
@@ -1,3 +1,6 @@
+#include "fdevent.h"
+#include "buffer.h"
+
#include <sys/types.h>
#include <unistd.h>
@@ -8,10 +11,6 @@
#include <signal.h>
#include <fcntl.h>
-#include "fdevent.h"
-#include "settings.h"
-#include "buffer.h"
-
#ifdef USE_POLL
static void fdevent_poll_free(fdevents *ev) {
free(ev->pollfds);
@@ -132,7 +131,7 @@ static int fdevent_poll_event_get_revent(fdevents *ev, size_t ndx) {
if (poll_r & POLLNVAL) r |= FDEVENT_NVAL;
if (poll_r & POLLPRI) r |= FDEVENT_PRI;
- return ev->pollfds[ndx].revents;
+ return r;
}
static int fdevent_poll_event_get_fd(fdevents *ev, size_t ndx) {
diff --git a/src/fdevent_select.c b/src/fdevent_select.c
index 4dcb754..4a32420 100644
--- a/src/fdevent_select.c
+++ b/src/fdevent_select.c
@@ -1,3 +1,6 @@
+#include "fdevent.h"
+#include "buffer.h"
+
#include <sys/time.h>
#include <sys/types.h>
@@ -9,10 +12,6 @@
#include <fcntl.h>
#include <assert.h>
-#include "fdevent.h"
-#include "settings.h"
-#include "buffer.h"
-
#ifdef USE_SELECT
static int fdevent_select_reset(fdevents *ev) {
@@ -38,7 +37,7 @@ static int fdevent_select_event_add(fdevents *ev, int fde_ndx, int fd, int event
UNUSED(fde_ndx);
/* we should be protected by max-fds, but you never know */
- assert(fd < FD_SETSIZE);
+ assert(fd < ((int)FD_SETSIZE));
if (events & FDEVENT_IN) {
FD_SET(fd, &(ev->select_set_read));
diff --git a/src/fdevent_solaris_devpoll.c b/src/fdevent_solaris_devpoll.c
index 76414a4..c099b12 100644
--- a/src/fdevent_solaris_devpoll.c
+++ b/src/fdevent_solaris_devpoll.c
@@ -1,3 +1,6 @@
+#include "fdevent.h"
+#include "buffer.h"
+
#include <sys/types.h>
#include <unistd.h>
@@ -8,10 +11,6 @@
#include <signal.h>
#include <fcntl.h>
-#include "fdevent.h"
-#include "settings.h"
-#include "buffer.h"
-
#ifdef USE_SOLARIS_DEVPOLL
static void fdevent_solaris_devpoll_free(fdevents *ev) {
diff --git a/src/http-header-glue.c b/src/http-header-glue.c
index 5aa6a23..a33ed3b 100644
--- a/src/http-header-glue.c
+++ b/src/http-header-glue.c
@@ -1,9 +1,3 @@
-#define _GNU_SOURCE
-
-#include <string.h>
-#include <errno.h>
-#include <time.h>
-
#include "base.h"
#include "array.h"
#include "buffer.h"
@@ -11,6 +5,11 @@
#include "etag.h"
#include "response.h"
+#include <string.h>
+#include <errno.h>
+
+#include <time.h>
+
/*
* This was 'borrowed' from tcpdump.
*
@@ -104,6 +103,21 @@ int response_header_overwrite(server *srv, connection *con, const char *key, siz
return response_header_insert(srv, con, key, keylen, value, vallen);
}
+int response_header_append(server *srv, connection *con, const char *key, size_t keylen, const char *value, size_t vallen) {
+ data_string *ds;
+
+ UNUSED(srv);
+
+ /* if there already is a key by this name append the value */
+ if (NULL != (ds = (data_string *)array_get_element(con->response.headers, key))) {
+ buffer_append_string_len(ds->value, CONST_STR_LEN(", "));
+ buffer_append_string_len(ds->value, value, vallen);
+ return 0;
+ }
+
+ return response_header_insert(srv, con, key, keylen, value, vallen);
+}
+
int http_response_redirect_to_directory(server *srv, connection *con) {
buffer *o;
@@ -259,7 +273,7 @@ int http_response_handle_cachable(server *srv, connection *con, buffer *mtime) {
}
if (0 == strncmp(con->request.http_if_modified_since, mtime->ptr, used_len)) {
- con->http_status = 304;
+ if ('\0' == mtime->ptr[used_len]) con->http_status = 304;
return HANDLER_FINISHED;
} else {
char buf[sizeof("Sat, 23 Jul 2005 21:20:01 GMT")];
@@ -281,15 +295,16 @@ int http_response_handle_cachable(server *srv, connection *con, buffer *mtime) {
strncpy(buf, con->request.http_if_modified_since, used_len);
buf[used_len] = '\0';
- tm.tm_isdst = 0;
if (NULL == strptime(buf, "%a, %d %b %Y %H:%M:%S GMT", &tm)) {
con->http_status = 412;
con->mode = DIRECT;
return HANDLER_FINISHED;
}
+ tm.tm_isdst = 0;
t_header = mktime(&tm);
strptime(mtime->ptr, "%a, %d %b %Y %H:%M:%S GMT", &tm);
+ tm.tm_isdst = 0;
t_file = mktime(&tm);
if (t_file > t_header) return HANDLER_GO_ON;
@@ -318,7 +333,7 @@ int http_response_handle_cachable(server *srv, connection *con, buffer *mtime) {
}
if (0 == strncmp(con->request.http_if_modified_since, mtime->ptr, used_len)) {
- con->http_status = 304;
+ if ('\0' == mtime->ptr[used_len]) con->http_status = 304;
return HANDLER_FINISHED;
} else {
char buf[sizeof("Sat, 23 Jul 2005 21:20:01 GMT")];
@@ -331,18 +346,17 @@ int http_response_handle_cachable(server *srv, connection *con, buffer *mtime) {
strncpy(buf, con->request.http_if_modified_since, used_len);
buf[used_len] = '\0';
- tm.tm_isdst = 0;
if (NULL == strptime(buf, "%a, %d %b %Y %H:%M:%S GMT", &tm)) {
/**
* parsing failed, let's get out of here
*/
- log_error_write(srv, __FILE__, __LINE__, "ss",
- "strptime() failed on", buf);
return HANDLER_GO_ON;
}
+ tm.tm_isdst = 0;
t_header = mktime(&tm);
strptime(mtime->ptr, "%a, %d %b %Y %H:%M:%S GMT", &tm);
+ tm.tm_isdst = 0;
t_file = mktime(&tm);
if (t_file > t_header) return HANDLER_GO_ON;
diff --git a/src/http_auth.c b/src/http_auth.c
index ba65713..0c0c4a5 100644
--- a/src/http_auth.c
+++ b/src/http_auth.c
@@ -1,6 +1,9 @@
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
+#include "server.h"
+#include "log.h"
+#include "http_auth.h"
+#include "http_auth_digest.h"
+#include "inet_ntop_cache.h"
+#include "stream.h"
#ifdef HAVE_CRYPT_H
# include <crypt.h>
@@ -25,13 +28,6 @@
#include <unistd.h>
#include <ctype.h>
-#include "server.h"
-#include "log.h"
-#include "http_auth.h"
-#include "http_auth_digest.h"
-#include "inet_ntop_cache.h"
-#include "stream.h"
-
#ifdef USE_OPENSSL
# include <openssl/md5.h>
#else
@@ -918,15 +914,15 @@ int http_auth_digest_check(server *srv, connection *con, mod_auth_plugin_data *p
char a1[256];
char a2[256];
- char *username;
- char *realm;
- char *nonce;
- char *uri;
- char *algorithm;
- char *qop;
- char *cnonce;
- char *nc;
- char *respons;
+ char *username = NULL;
+ char *realm = NULL;
+ char *nonce = NULL;
+ char *uri = NULL;
+ char *algorithm = NULL;
+ char *qop = NULL;
+ char *cnonce = NULL;
+ char *nc = NULL;
+ char *respons = NULL;
char *e, *c;
const char *m = NULL;
@@ -967,15 +963,9 @@ int http_auth_digest_check(server *srv, connection *con, mod_auth_plugin_data *p
dkv[6].ptr = &cnonce;
dkv[7].ptr = &nc;
dkv[8].ptr = &respons;
- dkv[9].ptr = NULL;
UNUSED(req);
- for (i = 0; dkv[i].key; i++) {
- *(dkv[i].ptr) = NULL;
- }
-
-
if (p->conf.auth_backend != AUTH_BACKEND_HTDIGEST &&
p->conf.auth_backend != AUTH_BACKEND_PLAIN) {
log_error_write(srv, __FILE__, __LINE__, "s",
diff --git a/src/http_auth_digest.c b/src/http_auth_digest.c
index e440430..e3f46b6 100644
--- a/src/http_auth_digest.c
+++ b/src/http_auth_digest.c
@@ -1,7 +1,8 @@
-#include <string.h>
+#include "buffer.h"
+
#include "http_auth_digest.h"
-#include "buffer.h"
+#include <string.h>
#ifndef USE_OPENSSL
# include "md5.h"
diff --git a/src/http_auth_digest.h b/src/http_auth_digest.h
index 25d95ee..58e8cb5 100644
--- a/src/http_auth_digest.h
+++ b/src/http_auth_digest.h
@@ -2,7 +2,7 @@
#define _DIGCALC_H_
#ifdef HAVE_CONFIG_H
-#include "config.h"
+# include "config.h"
#endif
#define HASHLEN 16
diff --git a/src/http_chunk.c b/src/http_chunk.c
index 37e829d..5557edc 100644
--- a/src/http_chunk.c
+++ b/src/http_chunk.c
@@ -4,6 +4,11 @@
*
*/
+#include "server.h"
+#include "chunk.h"
+#include "http_chunk.h"
+#include "log.h"
+
#include <sys/types.h>
#include <sys/stat.h>
@@ -15,11 +20,6 @@
#include <errno.h>
#include <string.h>
-#include "server.h"
-#include "chunk.h"
-#include "http_chunk.h"
-#include "log.h"
-
static int http_chunk_append_len(server *srv, connection *con, size_t len) {
size_t i, olen = len, j;
buffer *b;
diff --git a/src/inet_ntop_cache.c b/src/inet_ntop_cache.c
index 51755df..eac0681 100644
--- a/src/inet_ntop_cache.c
+++ b/src/inet_ntop_cache.c
@@ -1,12 +1,11 @@
-#include <sys/types.h>
-
-#include <string.h>
-
-
#include "base.h"
#include "inet_ntop_cache.h"
#include "sys-socket.h"
+#include <sys/types.h>
+
+#include <string.h>
+
const char * inet_ntop_cache_get_ip(server *srv, sock_addr *addr) {
#ifdef HAVE_IPV6
size_t ndx = 0, i;
diff --git a/src/joblist.c b/src/joblist.c
index 4ce3842..677a1a5 100644
--- a/src/joblist.c
+++ b/src/joblist.c
@@ -1,10 +1,10 @@
-#include <stdlib.h>
-#include <string.h>
-
#include "base.h"
#include "joblist.h"
#include "log.h"
+#include <stdlib.h>
+#include <string.h>
+
int joblist_append(server *srv, connection *con) {
if (con->in_joblist) return 0;
diff --git a/src/keyvalue.c b/src/keyvalue.c
index ae5df2f..00f6ef6 100644
--- a/src/keyvalue.c
+++ b/src/keyvalue.c
@@ -1,10 +1,10 @@
+#include "server.h"
+#include "keyvalue.h"
+
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
-#include "server.h"
-#include "keyvalue.h"
-
static keyvalue http_versions[] = {
{ HTTP_VERSION_1_1, "HTTP/1.1" },
{ HTTP_VERSION_1_0, "HTTP/1.0" },
diff --git a/src/keyvalue.h b/src/keyvalue.h
index 1f37837..b2b178a 100644
--- a/src/keyvalue.h
+++ b/src/keyvalue.h
@@ -2,7 +2,7 @@
#define _KEY_VALUE_H_
#ifdef HAVE_CONFIG_H
-#include "config.h"
+# include "config.h"
#endif
#ifdef HAVE_PCRE_H
diff --git a/src/lemon.c b/src/lemon.c
index ce83ead..48df45f 100644
--- a/src/lemon.c
+++ b/src/lemon.c
@@ -39,6 +39,12 @@ extern char *getenv();
# endif
#endif
+#if __GNUC__ > 2
+#define NORETURN __attribute__ ((__noreturn__))
+#else
+#define NORETURN
+#endif
+
/* #define PRIVATE static */
#define PRIVATE static
@@ -51,7 +57,7 @@ extern char *getenv();
char *msort();
extern void *malloc();
-extern void memory_error();
+extern void memory_error() NORETURN;
/******** From the file "action.h" *************************************/
struct action *Action_new();
@@ -59,7 +65,7 @@ struct action *Action_sort();
void Action_add();
/********* From the file "assert.h" ************************************/
-void myassert();
+void myassert() NORETURN;
#ifndef NDEBUG
# define assert(X) if(!(X))myassert(__FILE__,__LINE__)
#else
@@ -1333,7 +1339,7 @@ void ErrorMsg(const char *filename, int lineno, const char *format, ...){
/* Report an out-of-memory condition and abort. This function
** is used mostly by the "MemoryCheck" macro in struct.h
*/
-void memory_error(){
+void memory_error() {
fprintf(stderr,"Out of memory. Aborting...\n");
exit(1);
}
@@ -1608,7 +1614,6 @@ int k;
FILE *err;
{
int spcnt, i;
- spcnt = 0;
if( argv[0] ) fprintf(err,"%s",argv[0]);
spcnt = strlen(argv[0]) + 1;
for(i=1; i<n && argv[i]; i++){
@@ -2336,6 +2341,7 @@ struct lemon *gp;
if( filebuf==0 ){
ErrorMsg(ps.filename,0,"Can't allocate %d of memory to hold this file.",
filesize+1);
+ fclose(fp);
gp->errorcnt++;
return;
}
@@ -2343,6 +2349,7 @@ struct lemon *gp;
ErrorMsg(ps.filename,0,"Can't read in all %d bytes of this file.",
filesize);
free(filebuf);
+ fclose(fp);
gp->errorcnt++;
return;
}
@@ -2913,7 +2920,7 @@ int *lineno;
}else if( sp->destructor ){
cp = sp->destructor;
fprintf(out,"#line %d \"%s\"\n{",sp->destructorln,lemp->filename);
- }else if( lemp->vardest ){
+ }else{
cp = lemp->vardest;
if( cp==0 ) return;
fprintf(out,"#line %d \"%s\"\n{",lemp->vardestln,lemp->filename);
@@ -3042,7 +3049,7 @@ struct lemon *lemp; /* The main info structure for this parser */
int *plineno; /* Pointer to the line number */
int mhflag; /* True if generating makeheaders output */
{
- int lineno = *plineno; /* The line number of the output */
+ int lineno; /* The line number of the output */
char **types; /* A hash table of datatypes */
int arraysize; /* Size of the "types" array */
int maxdtlength; /* Maximum length of any ".datatype" field. */
diff --git a/src/log.c b/src/log.c
index e65532d..10db635 100644
--- a/src/log.c
+++ b/src/log.c
@@ -1,4 +1,6 @@
-#define _GNU_SOURCE
+#include "base.h"
+#include "log.h"
+#include "array.h"
#include <sys/types.h>
@@ -12,19 +14,12 @@
#include <stdarg.h>
#include <stdio.h>
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
#ifdef HAVE_SYSLOG_H
-#include <syslog.h>
+# include <syslog.h>
#endif
-#include "log.h"
-#include "array.h"
-
#ifdef HAVE_VALGRIND_VALGRIND_H
-#include <valgrind/valgrind.h>
+# include <valgrind/valgrind.h>
#endif
#ifndef O_LARGEFILE
@@ -62,7 +57,6 @@ int open_logfile_or_pipe(server *srv, const char* logfile) {
/* create write pipe and spawn process */
int to_log_fds[2];
- pid_t pid;
if (pipe(to_log_fds)) {
log_error_write(srv, __FILE__, __LINE__, "ss", "pipe failed: ", strerror(errno));
@@ -70,7 +64,7 @@ int open_logfile_or_pipe(server *srv, const char* logfile) {
}
/* fork, execve */
- switch (pid = fork()) {
+ switch (fork()) {
case 0:
/* child */
close(STDIN_FILENO);
@@ -150,13 +144,13 @@ int open_logfile_or_pipe(server *srv, const char* logfile) {
*/
int log_error_open(server *srv) {
- int close_stderr = 1;
-
#ifdef HAVE_SYSLOG_H
/* perhaps someone wants to use syslog() */
openlog("lighttpd", LOG_CONS | LOG_PID, LOG_DAEMON);
#endif
- srv->errorlog_mode = ERRORLOG_STDERR;
+
+ srv->errorlog_mode = ERRORLOG_FD;
+ srv->errorlog_fd = STDERR_FILENO;
if (srv->srvconf.errorlog_use_syslog) {
srv->errorlog_mode = ERRORLOG_SYSLOG;
@@ -171,20 +165,36 @@ int log_error_open(server *srv) {
log_error_write(srv, __FILE__, __LINE__, "s", "server started");
-#ifdef HAVE_VALGRIND_VALGRIND_H
- /* don't close stderr for debugging purposes if run in valgrind */
- if (RUNNING_ON_VALGRIND) close_stderr = 0;
-#endif
-
- if (srv->errorlog_mode == ERRORLOG_STDERR && srv->srvconf.dont_daemonize) {
+ if (srv->errorlog_mode == ERRORLOG_FD && !srv->srvconf.dont_daemonize) {
/* We can only log to stderr in dont-daemonize mode;
* if we do daemonize and no errorlog file is specified, we log into /dev/null
*/
- close_stderr = 0;
+ srv->errorlog_fd = -1;
}
- /* move stderr to /dev/null */
- if (close_stderr) openDevNull(STDERR_FILENO);
+ if (!buffer_is_empty(srv->srvconf.breakagelog_file)) {
+ int breakage_fd;
+ const char *logfile = srv->srvconf.breakagelog_file->ptr;
+
+ if (srv->errorlog_mode == ERRORLOG_FD) {
+ srv->errorlog_fd = dup(STDERR_FILENO);
+#ifdef FD_CLOEXEC
+ fcntl(srv->errorlog_fd, F_SETFD, FD_CLOEXEC);
+#endif
+ }
+
+ if (-1 == (breakage_fd = open_logfile_or_pipe(srv, logfile))) {
+ return -1;
+ }
+
+ if (STDERR_FILENO != breakage_fd) {
+ dup2(breakage_fd, STDERR_FILENO);
+ close(breakage_fd);
+ }
+ } else if (!srv->srvconf.dont_daemonize) {
+ /* move stderr to /dev/null */
+ openDevNull(STDERR_FILENO);
+ }
return 0;
}
@@ -235,15 +245,19 @@ int log_error_close(server *srv) {
switch(srv->errorlog_mode) {
case ERRORLOG_PIPE:
case ERRORLOG_FILE:
- close(srv->errorlog_fd);
+ case ERRORLOG_FD:
+ if (-1 != srv->errorlog_fd) {
+ /* don't close STDERR */
+ if (STDERR_FILENO != srv->errorlog_fd)
+ close(srv->errorlog_fd);
+ srv->errorlog_fd = -1;
+ }
break;
case ERRORLOG_SYSLOG:
#ifdef HAVE_SYSLOG_H
closelog();
#endif
break;
- case ERRORLOG_STDERR:
- break;
}
return 0;
@@ -255,7 +269,8 @@ int log_error_write(server *srv, const char *filename, unsigned int line, const
switch(srv->errorlog_mode) {
case ERRORLOG_PIPE:
case ERRORLOG_FILE:
- case ERRORLOG_STDERR:
+ case ERRORLOG_FD:
+ if (-1 == srv->errorlog_fd) return 0;
/* cache the generated timestamp */
if (srv->cur_ts != srv->last_generated_debug_ts) {
buffer_prepare_copy(srv->ts_debug_str, 255);
@@ -349,13 +364,10 @@ int log_error_write(server *srv, const char *filename, unsigned int line, const
switch(srv->errorlog_mode) {
case ERRORLOG_PIPE:
case ERRORLOG_FILE:
+ case ERRORLOG_FD:
buffer_append_string_len(srv->errorlog_buf, CONST_STR_LEN("\n"));
write(srv->errorlog_fd, srv->errorlog_buf->ptr, srv->errorlog_buf->used - 1);
break;
- case ERRORLOG_STDERR:
- buffer_append_string_len(srv->errorlog_buf, CONST_STR_LEN("\n"));
- write(STDERR_FILENO, srv->errorlog_buf->ptr, srv->errorlog_buf->used - 1);
- break;
case ERRORLOG_SYSLOG:
syslog(LOG_ERR, "%s", srv->errorlog_buf->ptr);
break;
diff --git a/src/md5.c b/src/md5.c
index 59066bc..34c6ac9 100644
--- a/src/md5.c
+++ b/src/md5.c
@@ -24,7 +24,7 @@ documentation and/or software.
*/
#ifdef HAVE_CONFIG_H
-#include "config.h"
+# include "config.h"
#endif
#ifndef USE_OPENSSL
diff --git a/src/mod_access.c b/src/mod_access.c
index 12b4d97..3902435 100644
--- a/src/mod_access.c
+++ b/src/mod_access.c
@@ -1,13 +1,13 @@
-#include <ctype.h>
-#include <stdlib.h>
-#include <string.h>
-
#include "base.h"
#include "log.h"
#include "buffer.h"
#include "plugin.h"
+#include <ctype.h>
+#include <stdlib.h>
+#include <string.h>
+
typedef struct {
array *access_deny;
} plugin_config;
diff --git a/src/mod_accesslog.c b/src/mod_accesslog.c
index 024f2e9..b6e3814 100644
--- a/src/mod_accesslog.c
+++ b/src/mod_accesslog.c
@@ -1,4 +1,12 @@
-#define _GNU_SOURCE
+#include "base.h"
+#include "log.h"
+#include "buffer.h"
+
+#include "plugin.h"
+
+#include "inet_ntop_cache.h"
+
+#include "sys-socket.h"
#include <sys/types.h>
#include <sys/stat.h>
@@ -13,16 +21,6 @@
#include <stdio.h>
-#include "base.h"
-#include "log.h"
-#include "buffer.h"
-
-#include "plugin.h"
-
-#include "inet_ntop_cache.h"
-
-#include "sys-socket.h"
-
#ifdef HAVE_SYSLOG_H
# include <syslog.h>
#endif
@@ -137,6 +135,8 @@ typedef struct {
buffer *access_logbuffer;
buffer *ts_accesslog_str;
+ buffer *ts_accesslog_fmt_str;
+ unsigned short append_tz_offset;
format_fields *parsed_format;
} plugin_config;
@@ -156,6 +156,52 @@ INIT_FUNC(mod_accesslog_init) {
return p;
}
+static void accesslog_append_escaped(buffer *dest, buffer *str) {
+ /* replaces non-printable chars with \xHH where HH is the hex representation of the byte */
+ /* exceptions: " => \", \ => \\, whitespace chars => \n \t etc. */
+ if (str->used == 0) return;
+ buffer_prepare_append(dest, str->used - 1);
+
+ for (unsigned int i = 0; i < str->used - 1; i++) {
+ if (str->ptr[i] >= ' ' && str->ptr[i] <= '~') {
+ /* printable chars */
+ buffer_append_string_len(dest, &str->ptr[i], 1);
+ } else switch (str->ptr[i]) {
+ case '"':
+ BUFFER_APPEND_STRING_CONST(dest, "\\\"");
+ break;
+ case '\\':
+ BUFFER_APPEND_STRING_CONST(dest, "\\\\");
+ break;
+ case '\b':
+ BUFFER_APPEND_STRING_CONST(dest, "\\b");
+ break;
+ case '\n':
+ BUFFER_APPEND_STRING_CONST(dest, "\\n");
+ break;
+ case '\r':
+ BUFFER_APPEND_STRING_CONST(dest, "\\r");
+ break;
+ case '\t':
+ BUFFER_APPEND_STRING_CONST(dest, "\\t");
+ break;
+ case '\v':
+ BUFFER_APPEND_STRING_CONST(dest, "\\v");
+ break;
+ default: {
+ /* non printable char => \xHH */
+ char hh[5] = {'\\','x',0,0,0};
+ char h = str->ptr[i] / 16;
+ hh[2] = (h > 9) ? (h - 10 + 'A') : (h + '0');
+ h = str->ptr[i] % 16;
+ hh[3] = (h > 9) ? (h - 10 + 'A') : (h + '0');
+ buffer_append_string_len(dest, &hh[0], 4);
+ }
+ break;
+ }
+ }
+}
+
static int accesslog_parse_format(server *srv, format_fields *fields, buffer *format) {
size_t i, j, k = 0, start = 0;
@@ -367,6 +413,7 @@ FREE_FUNC(mod_accesslog_free) {
if (s->log_access_fd != -1) close(s->log_access_fd);
buffer_free(s->ts_accesslog_str);
+ buffer_free(s->ts_accesslog_fmt_str);
buffer_free(s->access_logbuffer);
buffer_free(s->format);
buffer_free(s->access_logfile);
@@ -415,6 +462,7 @@ SETDEFAULTS_FUNC(log_access_open) {
s->format = buffer_init();
s->access_logbuffer = buffer_init();
s->ts_accesslog_str = buffer_init();
+ s->ts_accesslog_fmt_str = buffer_init();
s->log_access_fd = -1;
s->last_generated_accesslog_ts = 0;
s->last_generated_accesslog_ts_ptr = &(s->last_generated_accesslog_ts);
@@ -439,6 +487,8 @@ SETDEFAULTS_FUNC(log_access_open) {
/* parse */
if (s->format->used) {
+ size_t j, count;
+
s->parsed_format = calloc(1, sizeof(*(s->parsed_format)));
if (-1 == accesslog_parse_format(srv, s->parsed_format, s->format)) {
@@ -448,6 +498,29 @@ SETDEFAULTS_FUNC(log_access_open) {
return HANDLER_ERROR;
}
+
+ /* make sure they didn't try to send the timestamp in twice...
+ * also, save the format string in a different variable (this
+ * will save a few conditionals later)
+ */
+ count = 0;
+ for (j = 0; j < s->parsed_format->used; j++) {
+ if (FIELD_FORMAT == s->parsed_format->ptr[j]->type) {
+ if (FORMAT_TIMESTAMP == s->parsed_format->ptr[j]->field) {
+ if (!buffer_is_empty(s->parsed_format->ptr[j]->string)) {
+ buffer_copy_string(s->ts_accesslog_fmt_str, s->parsed_format->ptr[j]->string->ptr);
+ }
+
+ if (++count > 1) {
+ log_error_write(srv, __FILE__, __LINE__, "sb",
+ "you may not use the timestamp twice in the same access log:", s->format);
+
+ return HANDLER_ERROR;
+ }
+ }
+ }
+ }
+
#if 0
/* debugging */
for (j = 0; j < s->parsed_format->used; j++) {
@@ -468,6 +541,16 @@ SETDEFAULTS_FUNC(log_access_open) {
#endif
}
+ s->append_tz_offset = 0;
+ if (buffer_is_empty(s->ts_accesslog_fmt_str)) {
+#if defined(HAVE_STRUCT_TM_GMTOFF)
+ BUFFER_COPY_STRING_CONST(s->ts_accesslog_fmt_str, "[%d/%b/%Y:%H:%M:%S ");
+ s->append_tz_offset = 1;
+#else
+ BUFFER_COPY_STRING_CONST(s->ts_accesslog_fmt_str, "[%d/%b/%Y:%H:%M:%S +0000]");
+#endif
+ }
+
if (s->use_syslog) {
/* ignore the next checks */
continue;
@@ -541,6 +624,8 @@ static int mod_accesslog_patch_connection(server *srv, connection *con, plugin_d
PATCH(last_generated_accesslog_ts_ptr);
PATCH(access_logbuffer);
PATCH(ts_accesslog_str);
+ PATCH(ts_accesslog_fmt_str);
+ PATCH(append_tz_offset);
PATCH(parsed_format);
PATCH(use_syslog);
@@ -559,17 +644,17 @@ static int mod_accesslog_patch_connection(server *srv, connection *con, plugin_d
if (buffer_is_equal_string(du->key, CONST_STR_LEN("accesslog.filename"))) {
PATCH(access_logfile);
PATCH(log_access_fd);
- PATCH(last_generated_accesslog_ts_ptr);
PATCH(access_logbuffer);
- PATCH(ts_accesslog_str);
} else if (buffer_is_equal_string(du->key, CONST_STR_LEN("accesslog.format"))) {
PATCH(format);
PATCH(parsed_format);
+ PATCH(last_generated_accesslog_ts_ptr);
+ PATCH(ts_accesslog_str);
+ PATCH(ts_accesslog_fmt_str);
+ PATCH(append_tz_offset);
} else if (buffer_is_equal_string(du->key, CONST_STR_LEN("accesslog.use-syslog"))) {
PATCH(use_syslog);
- PATCH(last_generated_accesslog_ts_ptr);
PATCH(access_logbuffer);
- PATCH(ts_accesslog_str);
}
}
}
@@ -616,34 +701,36 @@ REQUESTDONE_FUNC(log_access_write) {
#if defined(HAVE_STRUCT_TM_GMTOFF)
# ifdef HAVE_LOCALTIME_R
localtime_r(&(srv->cur_ts), &tm);
- strftime(p->conf.ts_accesslog_str->ptr, p->conf.ts_accesslog_str->size - 1, "[%d/%b/%Y:%H:%M:%S ", &tm);
-# else
- strftime(p->conf.ts_accesslog_str->ptr, p->conf.ts_accesslog_str->size - 1, "[%d/%b/%Y:%H:%M:%S ", localtime(&(srv->cur_ts)));
-# endif
+ strftime(p->conf.ts_accesslog_str->ptr, p->conf.ts_accesslog_str->size - 1, p->conf.ts_accesslog_fmt_str->ptr, &tm);
+# else /* HAVE_LOCALTIME_R */
+ strftime(p->conf.ts_accesslog_str->ptr, p->conf.ts_accesslog_str->size - 1, p->conf.ts_accesslog_fmt_str->ptr, localtime_r(&(srv->cur_ts)));
+# endif /* HAVE_LOCALTIME_R */
p->conf.ts_accesslog_str->used = strlen(p->conf.ts_accesslog_str->ptr) + 1;
- buffer_append_string_len(p->conf.ts_accesslog_str, tm.tm_gmtoff >= 0 ? "+" : "-", 1);
+ if (p->conf.append_tz_offset) {
+ buffer_append_string_len(p->conf.ts_accesslog_str, tm.tm_gmtoff >= 0 ? "+" : "-", 1);
- scd = abs(tm.tm_gmtoff);
- hrs = scd / 3600;
- min = (scd % 3600) / 60;
+ scd = abs(tm.tm_gmtoff);
+ hrs = scd / 3600;
+ min = (scd % 3600) / 60;
- /* hours */
- if (hrs < 10) buffer_append_string_len(p->conf.ts_accesslog_str, CONST_STR_LEN("0"));
- buffer_append_long(p->conf.ts_accesslog_str, hrs);
+ /* hours */
+ if (hrs < 10) buffer_append_string_len(p->conf.ts_accesslog_str, CONST_STR_LEN("0"));
+ buffer_append_long(p->conf.ts_accesslog_str, hrs);
- if (min < 10) buffer_append_string_len(p->conf.ts_accesslog_str, CONST_STR_LEN("0"));
- buffer_append_long(p->conf.ts_accesslog_str, min);
- buffer_append_string_len(p->conf.ts_accesslog_str, CONST_STR_LEN("]"));
-#else
-#ifdef HAVE_GMTIME_R
+ if (min < 10) buffer_append_string_len(p->conf.ts_accesslog_str, CONST_STR_LEN("0"));
+ buffer_append_long(p->conf.ts_accesslog_str, min);
+ buffer_append_string_len(p->conf.ts_accesslog_str, CONST_STR_LEN("]"));
+ }
+#else /* HAVE_STRUCT_TM_GMTOFF */
+# ifdef HAVE_GMTIME_R
gmtime_r(&(srv->cur_ts), &tm);
- strftime(p->conf.ts_accesslog_str->ptr, p->conf.ts_accesslog_str->size - 1, "[%d/%b/%Y:%H:%M:%S +0000]", &tm);
-#else
- strftime(p->conf.ts_accesslog_str->ptr, p->conf.ts_accesslog_str->size - 1, "[%d/%b/%Y:%H:%M:%S +0000]", gmtime(&(srv->cur_ts)));
-#endif
+ strftime(p->conf.ts_accesslog_str->ptr, p->conf.ts_accesslog_str->size - 1, p->conf.ts_accesslog_fmt_str->ptr, &tm);
+# else /* HAVE_GMTIME_R */
+ strftime(p->conf.ts_accesslog_str->ptr, p->conf.ts_accesslog_str->size - 1, p->conf.ts_accesslog_fmt_str->ptr, gmtime(&(srv->cur_ts)));
+# endif /* HAVE_GMTIME_R */
p->conf.ts_accesslog_str->used = strlen(p->conf.ts_accesslog_str->ptr) + 1;
-#endif
+#endif /* HAVE_STRUCT_TM_GMTOFF */
*(p->conf.last_generated_accesslog_ts_ptr) = srv->cur_ts;
newts = 1;
@@ -672,7 +759,7 @@ REQUESTDONE_FUNC(log_access_write) {
break;
case FORMAT_REQUEST_LINE:
if (con->request.request_line->used) {
- buffer_append_string_buffer(b, con->request.request_line);
+ accesslog_append_escaped(b, con->request.request_line);
}
break;
case FORMAT_STATUS:
@@ -689,14 +776,14 @@ REQUESTDONE_FUNC(log_access_write) {
break;
case FORMAT_HEADER:
if (NULL != (ds = (data_string *)array_get_element(con->request.headers, p->conf.parsed_format->ptr[j]->string->ptr))) {
- buffer_append_string_buffer(b, ds->value);
+ accesslog_append_escaped(b, ds->value);
} else {
buffer_append_string_len(b, CONST_STR_LEN("-"));
}
break;
case FORMAT_RESPONSE_HEADER:
if (NULL != (ds = (data_string *)array_get_element(con->response.headers, p->conf.parsed_format->ptr[j]->string->ptr))) {
- buffer_append_string_buffer(b, ds->value);
+ accesslog_append_escaped(b, ds->value);
} else {
buffer_append_string_len(b, CONST_STR_LEN("-"));
}
@@ -734,7 +821,7 @@ REQUESTDONE_FUNC(log_access_write) {
break;
case FORMAT_HTTP_HOST:
if (con->uri.authority->used > 1) {
- buffer_append_string_buffer(b, con->uri.authority);
+ accesslog_append_escaped(b, con->uri.authority);
} else {
buffer_append_string_len(b, CONST_STR_LEN("-"));
}
@@ -760,10 +847,10 @@ REQUESTDONE_FUNC(log_access_write) {
}
break;
case FORMAT_QUERY_STRING:
- buffer_append_string_buffer(b, con->uri.query);
+ accesslog_append_escaped(b, con->uri.query);
break;
case FORMAT_URL:
- buffer_append_string_buffer(b, con->uri.path_raw);
+ accesslog_append_escaped(b, con->uri.path_raw);
break;
case FORMAT_CONNECTION_STATUS:
switch(con->keep_alive) {
diff --git a/src/mod_alias.c b/src/mod_alias.c
index 933338d..5b7b510 100644
--- a/src/mod_alias.c
+++ b/src/mod_alias.c
@@ -1,14 +1,14 @@
-#include <ctype.h>
-#include <stdlib.h>
-#include <string.h>
-#include <stdio.h>
-
#include "base.h"
#include "log.h"
#include "buffer.h"
#include "plugin.h"
+#include <ctype.h>
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+
/* plugin config for all request/connections */
typedef struct {
array *alias;
diff --git a/src/mod_auth.c b/src/mod_auth.c
index e508c00..0abde92 100644
--- a/src/mod_auth.c
+++ b/src/mod_auth.c
@@ -1,3 +1,8 @@
+#include "plugin.h"
+#include "http_auth.h"
+#include "log.h"
+#include "response.h"
+
#include <sys/types.h>
#include <sys/stat.h>
@@ -7,11 +12,6 @@
#include <fcntl.h>
#include <unistd.h>
-#include "plugin.h"
-#include "http_auth.h"
-#include "log.h"
-#include "response.h"
-
handler_t auth_ldap_init(server *srv, mod_auth_plugin_config *s);
@@ -468,7 +468,7 @@ SETDEFAULTS_FUNC(mod_auth_set_defaults) {
if (method == NULL) {
log_error_write(srv, __FILE__, __LINE__, "ss",
- "the require field is missing in:",
+ "the method field is missing in:",
"auth.require = ( \"...\" => ( ..., \"method\" => \"...\" ) )");
return HANDLER_ERROR;
} else {
@@ -483,7 +483,7 @@ SETDEFAULTS_FUNC(mod_auth_set_defaults) {
if (realm == NULL) {
log_error_write(srv, __FILE__, __LINE__, "ss",
- "the require field is missing in:",
+ "the realm field is missing in:",
"auth.require = ( \"...\" => ( ..., \"realm\" => \"...\" ) )");
return HANDLER_ERROR;
}
diff --git a/src/mod_cgi.c b/src/mod_cgi.c
index fa5e111..47bbbbe 100644
--- a/src/mod_cgi.c
+++ b/src/mod_cgi.c
@@ -1,14 +1,23 @@
+#include "server.h"
+#include "stat_cache.h"
+#include "keyvalue.h"
+#include "log.h"
+#include "connections.h"
+#include "joblist.h"
+#include "http_chunk.h"
+
+#include "plugin.h"
+
#include <sys/types.h>
+
#ifdef __WIN32
-#include <winsock2.h>
+# include <winsock2.h>
#else
-#include <sys/socket.h>
-#include <sys/wait.h>
-#include <sys/mman.h>
-
-#include <netinet/in.h>
-
-#include <arpa/inet.h>
+# include <sys/socket.h>
+# include <sys/wait.h>
+# include <sys/mman.h>
+# include <netinet/in.h>
+# include <arpa/inet.h>
#endif
#include <unistd.h>
@@ -23,16 +32,6 @@
#include <stdio.h>
#include <fcntl.h>
-#include "server.h"
-#include "stat_cache.h"
-#include "keyvalue.h"
-#include "log.h"
-#include "connections.h"
-#include "joblist.h"
-#include "http_chunk.h"
-
-#include "plugin.h"
-
#ifdef HAVE_SYS_FILIO_H
# include <sys/filio.h>
#endif
@@ -56,6 +55,7 @@ typedef struct {
typedef struct {
array *cgi;
+ unsigned short execute_x_only;
} plugin_config;
typedef struct {
@@ -151,6 +151,7 @@ SETDEFAULTS_FUNC(mod_fastcgi_set_defaults) {
config_values_t cv[] = {
{ "cgi.assign", NULL, T_CONFIG_ARRAY, T_CONFIG_SCOPE_CONNECTION }, /* 0 */
+ { "cgi.execute-x-only", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION }, /* 1 */
{ NULL, NULL, T_CONFIG_UNSET, T_CONFIG_SCOPE_UNSET}
};
@@ -165,8 +166,10 @@ SETDEFAULTS_FUNC(mod_fastcgi_set_defaults) {
assert(s);
s->cgi = array_init();
+ s->execute_x_only = 0;
cv[0].destination = s->cgi;
+ cv[1].destination = &(s->execute_x_only);
p->config_storage[i] = s;
@@ -580,12 +583,9 @@ static handler_t cgi_connection_close(server *srv, handler_ctx *hctx) {
#if 0
log_error_write(srv, __FILE__, __LINE__, "sd", "(debug) cgi exited fine, pid:", pid);
#endif
- pid = 0;
-
return HANDLER_GO_ON;
} else {
log_error_write(srv, __FILE__, __LINE__, "sd", "cgi died, pid:", pid);
- pid = 0;
return HANDLER_GO_ON;
}
}
@@ -1005,7 +1005,7 @@ static int cgi_create_env(server *srv, connection *con, plugin_data *p, buffer *
args[i++] = cgi_handler->ptr;
}
args[i++] = con->physical.path->ptr;
- args[i++] = NULL;
+ args[i ] = NULL;
/* search for the last / */
if (NULL != (c = strrchr(con->physical.path->ptr, '/'))) {
@@ -1018,8 +1018,6 @@ static int cgi_create_env(server *srv, connection *con, plugin_data *p, buffer *
*c = '/';
}
- openDevNull(STDERR_FILENO);
-
/* we don't need the client socket */
for (i = 3; i < 256; i++) {
if (i != srv->errorlog_fd) close(i);
@@ -1198,6 +1196,8 @@ static int mod_cgi_patch_connection(server *srv, connection *con, plugin_data *p
if (buffer_is_equal_string(du->key, CONST_STR_LEN("cgi.assign"))) {
PATCH(cgi);
+ } else if (buffer_is_equal_string(du->key, CONST_STR_LEN("cgi.execute-x-only"))) {
+ PATCH(execute_x_only);
}
}
}
@@ -1220,6 +1220,7 @@ URIHANDLER_FUNC(cgi_is_handled) {
if (HANDLER_ERROR == stat_cache_get_entry(srv, con, con->physical.path, &sce)) return HANDLER_GO_ON;
if (!S_ISREG(sce->st.st_mode)) return HANDLER_GO_ON;
+ if (p->conf.execute_x_only == 1 && (sce->st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)) == 0) return HANDLER_GO_ON;
s_len = fn->used - 1;
diff --git a/src/mod_cml.c b/src/mod_cml.c
index 03e264c..f83eb80 100644
--- a/src/mod_cml.c
+++ b/src/mod_cml.c
@@ -1,12 +1,3 @@
-#include <sys/stat.h>
-#include <time.h>
-
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-#include <unistd.h>
-#include <stdio.h>
-
#include "buffer.h"
#include "server.h"
#include "log.h"
@@ -17,6 +8,15 @@
#include "mod_cml.h"
+#include <sys/stat.h>
+#include <time.h>
+
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+#include <unistd.h>
+#include <stdio.h>
+
/* init the plugin data */
INIT_FUNC(mod_cml_init) {
plugin_data *p;
diff --git a/src/mod_cml_funcs.c b/src/mod_cml_funcs.c
index 82bca10..b01d4d2 100644
--- a/src/mod_cml_funcs.c
+++ b/src/mod_cml_funcs.c
@@ -1,3 +1,12 @@
+#include "buffer.h"
+#include "server.h"
+#include "log.h"
+#include "plugin.h"
+#include "response.h"
+
+#include "mod_cml.h"
+#include "mod_cml_funcs.h"
+
#include <sys/stat.h>
#include <time.h>
@@ -8,15 +17,6 @@
#include <dirent.h>
#include <stdio.h>
-#include "buffer.h"
-#include "server.h"
-#include "log.h"
-#include "plugin.h"
-#include "response.h"
-
-#include "mod_cml.h"
-#include "mod_cml_funcs.h"
-
#ifdef USE_OPENSSL
# include <openssl/md5.h>
#else
diff --git a/src/mod_cml_funcs.h b/src/mod_cml_funcs.h
index 42e067c..f0695d7 100644
--- a/src/mod_cml_funcs.h
+++ b/src/mod_cml_funcs.h
@@ -2,7 +2,7 @@
#define _MOD_CML_FUNCS_H_
#ifdef HAVE_CONFIG_H
-#include "config.h"
+# include "config.h"
#endif
#ifdef HAVE_LUA_H
diff --git a/src/mod_cml_lua.c b/src/mod_cml_lua.c
index ae25ef1..b3f2cbb 100644
--- a/src/mod_cml_lua.c
+++ b/src/mod_cml_lua.c
@@ -1,8 +1,3 @@
-#include <assert.h>
-#include <stdio.h>
-#include <errno.h>
-#include <time.h>
-
#include "mod_cml.h"
#include "mod_cml_funcs.h"
#include "log.h"
@@ -10,6 +5,12 @@
#include "stat_cache.h"
+#include <assert.h>
+#include <stdio.h>
+#include <errno.h>
+#include <time.h>
+#include <string.h>
+
#ifdef USE_OPENSSL
# include <openssl/md5.h>
#else
diff --git a/src/mod_compress.c b/src/mod_compress.c
index 4b33983..1293950 100644
--- a/src/mod_compress.c
+++ b/src/mod_compress.c
@@ -1,14 +1,3 @@
-#include <sys/types.h>
-#include <sys/stat.h>
-
-#include <fcntl.h>
-#include <unistd.h>
-#include <ctype.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-#include <time.h>
-
#include "base.h"
#include "log.h"
#include "buffer.h"
@@ -20,6 +9,17 @@
#include "crc32.h"
#include "etag.h"
+#include <sys/types.h>
+#include <sys/stat.h>
+
+#include <fcntl.h>
+#include <unistd.h>
+#include <ctype.h>
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+#include <time.h>
+
#if defined HAVE_ZLIB_H && defined HAVE_LIBZ
# define USE_ZLIB
# include <zlib.h>
@@ -42,7 +42,7 @@
#define HTTP_ACCEPT_ENCODING_BZIP2 BV(4)
#ifdef __WIN32
-#define mkdir(x,y) mkdir(x)
+# define mkdir(x,y) mkdir(x)
#endif
typedef struct {
@@ -661,6 +661,7 @@ PHYSICALPATH_FUNC(mod_compress_physical) {
off_t max_fsize;
stat_cache_entry *sce = NULL;
buffer *mtime = NULL;
+ buffer *content_type;
if (con->mode != DIRECT || con->http_status) return HANDLER_GO_ON;
@@ -713,6 +714,15 @@ PHYSICALPATH_FUNC(mod_compress_physical) {
if (sce->st.st_size < 128) return HANDLER_GO_ON;
/* check if mimetype is in compress-config */
+ content_type = 0;
+ if (sce->content_type->ptr) {
+ char *c;
+ if ( (c = strchr(sce->content_type->ptr, ';')) != 0) {
+ content_type = srv->tmp_buf;
+ buffer_copy_string_len(content_type, sce->content_type->ptr, c - sce->content_type->ptr);
+ }
+ }
+
for (m = 0; m < p->conf.compress->used; m++) {
data_string *compress_ds = (data_string *)p->conf.compress->data[m];
@@ -722,7 +732,8 @@ PHYSICALPATH_FUNC(mod_compress_physical) {
return HANDLER_GO_ON;
}
- if (buffer_is_equal(compress_ds->value, sce->content_type)) {
+ if (buffer_is_equal(compress_ds->value, sce->content_type)
+ || (content_type && buffer_is_equal(compress_ds->value, content_type))) {
/* mimetype found */
data_string *ds;
diff --git a/src/mod_dirlisting.c b/src/mod_dirlisting.c
index 71b6df9..4adc879 100644
--- a/src/mod_dirlisting.c
+++ b/src/mod_dirlisting.c
@@ -1,13 +1,3 @@
-#include <ctype.h>
-#include <stdlib.h>
-#include <string.h>
-#include <dirent.h>
-#include <assert.h>
-#include <errno.h>
-#include <stdio.h>
-#include <unistd.h>
-#include <time.h>
-
#include "base.h"
#include "log.h"
#include "buffer.h"
@@ -18,6 +8,16 @@
#include "stat_cache.h"
#include "stream.h"
+#include <ctype.h>
+#include <stdlib.h>
+#include <string.h>
+#include <dirent.h>
+#include <assert.h>
+#include <errno.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <time.h>
+
/**
* this is a dirlisting for a lighttpd plugin
*/
@@ -198,7 +198,7 @@ static int parse_config_entry(server *srv, plugin_config *s, array *ca, const ch
data_unset *du;
if (NULL != (du = array_get_element(ca, option))) {
- data_array *da = (data_array *)du;
+ data_array *da;
size_t j;
if (du->type != TYPE_ARRAY) {
diff --git a/src/mod_evasive.c b/src/mod_evasive.c
index 467bada..2907053 100644
--- a/src/mod_evasive.c
+++ b/src/mod_evasive.c
@@ -1,7 +1,3 @@
-#include <ctype.h>
-#include <stdlib.h>
-#include <string.h>
-
#include "base.h"
#include "log.h"
#include "buffer.h"
@@ -10,6 +6,10 @@
#include "inet_ntop_cache.h"
+#include <ctype.h>
+#include <stdlib.h>
+#include <string.h>
+
/**
* mod_evasive
*
diff --git a/src/mod_evhost.c b/src/mod_evhost.c
index 2cb695b..7aabf6e 100644
--- a/src/mod_evhost.c
+++ b/src/mod_evhost.c
@@ -1,12 +1,12 @@
-#include <string.h>
-#include <errno.h>
-#include <ctype.h>
-
#include "plugin.h"
#include "log.h"
#include "response.h"
#include "stat_cache.h"
+#include <string.h>
+#include <errno.h>
+#include <ctype.h>
+
typedef struct {
/* unparsed pieces */
buffer *path_pieces_raw;
@@ -213,7 +213,7 @@ static int mod_evhost_parse_host(connection *con,array *host) {
if (colon != ptr) {
ds = data_string_init();
buffer_copy_string_len(ds->key,CONST_STR_LEN("%"));
- buffer_append_long(ds->key, i++);
+ buffer_append_long(ds->key, i /* ++ */);
buffer_copy_string_len(ds->value,ptr,colon-ptr);
array_insert_unique(host,(data_unset *)ds);
@@ -294,10 +294,10 @@ static handler_t mod_evhost_uri_handler(server *srv, connection *con, void *p_d)
char *colon = strchr(con->uri.authority->ptr, ':');
if(colon == NULL) {
- buffer_append_string_buffer(p->tmp_buf, con->uri.authority); // adds fqdn
+ buffer_append_string_buffer(p->tmp_buf, con->uri.authority); /* adds fqdn */
} else {
/* strip the port out of the authority-part of the URI scheme */
- buffer_append_string_len(p->tmp_buf, con->uri.authority->ptr, colon - con->uri.authority->ptr); // adds fqdn
+ buffer_append_string_len(p->tmp_buf, con->uri.authority->ptr, colon - con->uri.authority->ptr); /* adds fqdn */
}
} else if (NULL != (ds = (data_string *)array_get_element(parsed_host,p->conf.path_pieces[i]->ptr))) {
if (ds->value->used) {
diff --git a/src/mod_expire.c b/src/mod_expire.c
index 6c0b924..734cb93 100644
--- a/src/mod_expire.c
+++ b/src/mod_expire.c
@@ -1,8 +1,3 @@
-#include <ctype.h>
-#include <stdlib.h>
-#include <string.h>
-#include <time.h>
-
#include "base.h"
#include "log.h"
#include "buffer.h"
@@ -11,6 +6,11 @@
#include "plugin.h"
#include "stat_cache.h"
+#include <ctype.h>
+#include <stdlib.h>
+#include <string.h>
+#include <time.h>
+
/**
* this is a expire module for a lighttpd
*
@@ -342,7 +342,7 @@ URIHANDLER_FUNC(mod_expire_path_handler) {
buffer_copy_string_len(p->expire_tstmp, CONST_STR_LEN("max-age="));
buffer_append_long(p->expire_tstmp, expires - srv->cur_ts); /* as expires >= srv->cur_ts the difference is >= 0 */
- response_header_overwrite(srv, con, CONST_STR_LEN("Cache-Control"), CONST_BUF_LEN(p->expire_tstmp));
+ response_header_append(srv, con, CONST_STR_LEN("Cache-Control"), CONST_BUF_LEN(p->expire_tstmp));
return HANDLER_GO_ON;
}
diff --git a/src/mod_extforward.c b/src/mod_extforward.c
index aabee12..afcc559 100644
--- a/src/mod_extforward.c
+++ b/src/mod_extforward.c
@@ -1,3 +1,12 @@
+#include "base.h"
+#include "log.h"
+#include "buffer.h"
+
+#include "plugin.h"
+
+#include "inet_ntop_cache.h"
+#include "configfile.h"
+
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
@@ -8,15 +17,6 @@
#include <stdio.h>
#include <netinet/in.h>
-#include "base.h"
-#include "log.h"
-#include "buffer.h"
-
-#include "plugin.h"
-
-#include "inet_ntop_cache.h"
-#include "configfile.h"
-
/**
* mod_extforward.c for lighttpd, by comman.kang <at> gmail <dot> com
* extended, modified by Lionel Elie Mamane (LEM), lionel <at> mamane <dot> lu
diff --git a/src/mod_fastcgi.c b/src/mod_fastcgi.c
index 0fbfebf..f756324 100644
--- a/src/mod_fastcgi.c
+++ b/src/mod_fastcgi.c
@@ -1,13 +1,3 @@
-#include <sys/types.h>
-#include <unistd.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <string.h>
-#include <stdlib.h>
-#include <ctype.h>
-#include <assert.h>
-#include <signal.h>
-
#include "buffer.h"
#include "server.h"
#include "keyvalue.h"
@@ -25,15 +15,26 @@
#include "stat_cache.h"
#include "status_counter.h"
+#include <sys/types.h>
+#include <unistd.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <string.h>
+#include <stdlib.h>
+#include <ctype.h>
+#include <assert.h>
+#include <signal.h>
+
#ifdef HAVE_FASTCGI_FASTCGI_H
-#include <fastcgi/fastcgi.h>
-#else
-#ifdef HAVE_FASTCGI_H
-#include <fastcgi.h>
+# include <fastcgi/fastcgi.h>
#else
-#include "fastcgi.h"
-#endif
+# ifdef HAVE_FASTCGI_H
+# include <fastcgi.h>
+# else
+# include "fastcgi.h"
+# endif
#endif /* HAVE_FASTCGI_FASTCGI_H */
+
#include <stdio.h>
#ifdef HAVE_SYS_FILIO_H
@@ -122,22 +123,9 @@ typedef struct {
*
*/
- unsigned short min_procs;
unsigned short max_procs;
size_t num_procs; /* how many procs are started */
- size_t active_procs; /* how many of them are really running */
-
- unsigned short max_load_per_proc;
-
- /*
- * kick the process from the list if it was not
- * used for idle_timeout until min_procs is
- * reached. this helps to get the processlist
- * small again we had a small peak load.
- *
- */
-
- unsigned short idle_timeout;
+ size_t active_procs; /* how many of them are really running, i.e. state = PROC_STATE_RUNNING */
/*
* time after a disabled remote connection is tried to be re-enabled
@@ -384,6 +372,21 @@ typedef struct {
/* ok, we need a prototype */
static handler_t fcgi_handle_fdevent(void *s, void *ctx, int revents);
+static void reset_signals(void) {
+#ifdef SIGTTOU
+ signal(SIGTTOU, SIG_DFL);
+#endif
+#ifdef SIGTTIN
+ signal(SIGTTIN, SIG_DFL);
+#endif
+#ifdef SIGTSTP
+ signal(SIGTSTP, SIG_DFL);
+#endif
+ signal(SIGHUP, SIG_DFL);
+ signal(SIGPIPE, SIG_DFL);
+ signal(SIGUSR1, SIG_DFL);
+}
+
static void fastcgi_status_copy_procname(buffer *b, fcgi_extension_host *host, fcgi_proc *proc) {
buffer_copy_string_len(b, CONST_STR_LEN("fastcgi.backend."));
buffer_append_string_buffer(b, host->id);
@@ -440,6 +443,21 @@ static void fcgi_host_reset(server *srv, handler_ctx *hctx) {
hctx->host = NULL;
}
+static void fcgi_host_disable(server *srv, handler_ctx *hctx) {
+ plugin_data *p = hctx->plugin_data;
+
+ if (hctx->host->disable_time || hctx->proc->is_local) {
+ if (hctx->proc->state == PROC_STATE_RUNNING) hctx->host->active_procs--;
+ hctx->proc->disabled_until = srv->cur_ts + hctx->host->disable_time;
+ hctx->proc->state = hctx->proc->is_local ? PROC_STATE_DIED_WAIT_FOR_PID : PROC_STATE_DIED;
+
+ if (p->conf.debug) {
+ log_error_write(srv, __FILE__, __LINE__, "sds",
+ "backend disabled for", hctx->host->disable_time, "seconds");
+ }
+ }
+}
+
static int fastcgi_status_init(server *srv, buffer *b, fcgi_extension_host *host, fcgi_proc *proc) {
#define CLEAN(x) \
fastcgi_status_copy_procname(b, host, proc); \
@@ -993,8 +1011,6 @@ static int fcgi_spawn_connection(server *srv,
close(fcgi_fd);
}
- openDevNull(STDERR_FILENO);
-
/* we don't need the client socket */
for (i = 3; i < 256; i++) {
close(i);
@@ -1054,6 +1070,7 @@ static int fcgi_spawn_connection(server *srv,
*c = '/';
}
+ reset_signals();
/* exec the cgi */
execve(arg.ptr[0], arg.ptr, env.ptr);
@@ -1235,20 +1252,17 @@ SETDEFAULTS_FUNC(mod_fastcgi_set_defaults) {
{ "check-local", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION }, /* 5 */
{ "port", NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION }, /* 6 */
- { "min-procs-not-working", NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION }, /* 7 this is broken for now */
- { "max-procs", NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION }, /* 8 */
- { "max-load-per-proc", NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION }, /* 9 */
- { "idle-timeout", NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION }, /* 10 */
- { "disable-time", NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION }, /* 11 */
+ { "max-procs", NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION }, /* 7 */
+ { "disable-time", NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION }, /* 8 */
- { "bin-environment", NULL, T_CONFIG_ARRAY, T_CONFIG_SCOPE_CONNECTION }, /* 12 */
- { "bin-copy-environment", NULL, T_CONFIG_ARRAY, T_CONFIG_SCOPE_CONNECTION }, /* 13 */
+ { "bin-environment", NULL, T_CONFIG_ARRAY, T_CONFIG_SCOPE_CONNECTION }, /* 9 */
+ { "bin-copy-environment", NULL, T_CONFIG_ARRAY, T_CONFIG_SCOPE_CONNECTION }, /* 10 */
- { "broken-scriptfilename", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION }, /* 14 */
- { "allow-x-send-file", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION }, /* 15 */
- { "strip-request-uri", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 16 */
- { "kill-signal", NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION }, /* 17 */
- { "fix-root-scriptname", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION }, /* 18 */
+ { "broken-scriptfilename", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION }, /* 11 */
+ { "allow-x-send-file", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION }, /* 12 */
+ { "strip-request-uri", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 13 */
+ { "kill-signal", NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION }, /* 14 */
+ { "fix-root-scriptname", NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION }, /* 15 */
{ NULL, NULL, T_CONFIG_UNSET, T_CONFIG_SCOPE_UNSET }
};
@@ -1267,12 +1281,9 @@ SETDEFAULTS_FUNC(mod_fastcgi_set_defaults) {
buffer_copy_string_buffer(host->id, da_host->key);
host->check_local = 1;
- host->min_procs = 4;
host->max_procs = 4;
- host->max_load_per_proc = 1;
- host->idle_timeout = 60;
host->mode = FCGI_RESPONDER;
- host->disable_time = 60;
+ host->disable_time = 1;
host->break_scriptfilename_for_php = 0;
host->allow_xsendfile = 0; /* handle X-LIGHTTPD-send-file */
host->kill_signal = SIGTERM;
@@ -1286,19 +1297,16 @@ SETDEFAULTS_FUNC(mod_fastcgi_set_defaults) {
fcv[5].destination = &(host->check_local);
fcv[6].destination = &(host->port);
- fcv[7].destination = &(host->min_procs);
- fcv[8].destination = &(host->max_procs);
- fcv[9].destination = &(host->max_load_per_proc);
- fcv[10].destination = &(host->idle_timeout);
- fcv[11].destination = &(host->disable_time);
-
- fcv[12].destination = host->bin_env;
- fcv[13].destination = host->bin_env_copy;
- fcv[14].destination = &(host->break_scriptfilename_for_php);
- fcv[15].destination = &(host->allow_xsendfile);
- fcv[16].destination = host->strip_request_uri;
- fcv[17].destination = &(host->kill_signal);
- fcv[18].destination = &(host->fix_root_path_name);
+ fcv[7].destination = &(host->max_procs);
+ fcv[8].destination = &(host->disable_time);
+
+ fcv[9].destination = host->bin_env;
+ fcv[10].destination = host->bin_env_copy;
+ fcv[11].destination = &(host->break_scriptfilename_for_php);
+ fcv[12].destination = &(host->allow_xsendfile);
+ fcv[13].destination = host->strip_request_uri;
+ fcv[14].destination = &(host->kill_signal);
+ fcv[15].destination = &(host->fix_root_path_name);
if (0 != config_insert_values_internal(srv, da_host->value, fcv)) {
return HANDLER_ERROR;
@@ -1355,23 +1363,16 @@ SETDEFAULTS_FUNC(mod_fastcgi_set_defaults) {
/* a local socket + self spawning */
size_t pno;
- /* HACK: just to make sure the adaptive spawing is disabled */
- host->min_procs = host->max_procs;
-
- if (host->min_procs > host->max_procs) host->max_procs = host->min_procs;
- if (host->max_load_per_proc < 1) host->max_load_per_proc = 0;
-
if (s->debug) {
- log_error_write(srv, __FILE__, __LINE__, "ssbsdsbsdsd",
+ log_error_write(srv, __FILE__, __LINE__, "ssbsdsbsd",
"--- fastcgi spawning local",
"\n\tproc:", host->bin_path,
"\n\tport:", host->port,
"\n\tsocket", host->unixsocket,
- "\n\tmin-procs:", host->min_procs,
"\n\tmax-procs:", host->max_procs);
}
- for (pno = 0; pno < host->min_procs; pno++) {
+ for (pno = 0; pno < host->max_procs; pno++) {
fcgi_proc *proc;
proc = fastcgi_process_init();
@@ -1391,7 +1392,7 @@ SETDEFAULTS_FUNC(mod_fastcgi_set_defaults) {
"--- fastcgi spawning",
"\n\tport:", host->port,
"\n\tsocket", host->unixsocket,
- "\n\tcurrent:", pno, "/", host->min_procs);
+ "\n\tcurrent:", pno, "/", host->max_procs);
}
if (fcgi_spawn_connection(srv, p, host, proc)) {
@@ -1426,7 +1427,6 @@ SETDEFAULTS_FUNC(mod_fastcgi_set_defaults) {
host->first = proc;
- host->min_procs = 1;
host->max_procs = 1;
}
@@ -1637,16 +1637,8 @@ static int fcgi_header(FCGI_Header * header, unsigned char type, size_t request_
return 0;
}
-/**
- *
- * returns
- * -1 error
- * 0 connected
- * 1 not connected yet
- */
typedef enum {
- CONNECTION_UNSET,
CONNECTION_OK,
CONNECTION_DELAYED, /* retry after event, take same host */
CONNECTION_OVERLOADED, /* disable for 1 second, take another backend */
@@ -1686,7 +1678,7 @@ static connection_result_t fcgi_establish_connection(server *srv, handler_ctx *h
buffer_append_string_buffer(proc->connection_name, proc->unixsocket);
}
#else
- return -1;
+ return CONNECTION_DEAD;
#endif
} else {
fcgi_addr_in.sin_family = AF_INET;
@@ -1696,7 +1688,7 @@ static connection_result_t fcgi_establish_connection(server *srv, handler_ctx *h
"converting IP address failed for", host->host,
"\nBe sure to specify an IP address here");
- return -1;
+ return CONNECTION_DEAD;
}
} else {
fcgi_addr_in.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
@@ -2225,6 +2217,8 @@ static int fcgi_response_parse(server *srv, connection *con, plugin_data *p, buf
handler_ctx *hctx = con->plugin_ctx[p->id];
fcgi_extension_host *host= hctx->host;
+ int have_sendfile2 = 0;
+ off_t sendfile2_content_length = 0;
UNUSED(srv);
@@ -2234,7 +2228,7 @@ static int fcgi_response_parse(server *srv, connection *con, plugin_data *p, buf
for (s = p->parse_response->ptr; NULL != (ns = strchr(s, '\n')); s = ns + 1) {
char *key, *value;
int key_len;
- data_string *ds;
+ data_string *ds = NULL;
/* a good day. Someone has read the specs and is sending a \r\n to us */
@@ -2297,6 +2291,79 @@ static int fcgi_response_parse(server *srv, connection *con, plugin_data *p, buf
con->parsed_response |= HTTP_CONNECTION;
}
break;
+ case 11:
+ if (host->allow_xsendfile && 0 == strncasecmp(key, "X-Sendfile2", key_len)&& hctx->send_content_body) {
+ char *pos = value;
+ have_sendfile2 = 1;
+
+ while (*pos) {
+ char *filename, *range;
+ stat_cache_entry *sce;
+ off_t begin_range, end_range, range_len;
+
+ while (' ' == *pos) pos++;
+ if (!*pos) break;
+
+ filename = pos;
+ if (NULL == (range = strchr(pos, ' '))) {
+ /* missing range */
+ return 1;
+ }
+ buffer_copy_string_len(srv->tmp_buf, filename, range - filename);
+
+ /* find end of range */
+ for (pos = ++range; *pos && *pos != ' ' && *pos != ','; pos++) ;
+
+ buffer_urldecode_path(srv->tmp_buf);
+ if (HANDLER_ERROR == stat_cache_get_entry(srv, con, srv->tmp_buf, &sce)) {
+ if (p->conf.debug) {
+ log_error_write(srv, __FILE__, __LINE__, "sb",
+ "send-file error: couldn't get stat_cache entry for X-Sendfile2:",
+ srv->tmp_buf);
+ }
+ return 1;
+ } else if (!S_ISREG(sce->st.st_mode)) {
+ if (p->conf.debug) {
+ log_error_write(srv, __FILE__, __LINE__, "sb",
+ "send-file error: wrong filetype for X-Sendfile2:",
+ srv->tmp_buf);
+ }
+ return 1;
+ }
+ /* found the file */
+
+ /* parse range */
+ begin_range = 0; end_range = sce->st.st_size - 1;
+ {
+ 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 (rpos != pos) {
+ range = rpos;
+ end_range = strtoll(range, &rpos, 10);
+ if (errno != 0 || end_range < 0 || rpos == range) return 1;
+ }
+ if (rpos != pos) return 1;
+ }
+
+ /* no parameters accepted */
+
+ while (*pos == ' ') pos++;
+ if (*pos != '\0' && *pos != ',') return 1;
+
+ range_len = end_range - begin_range + 1;
+ if (range_len < 0) return 1;
+ if (range_len != 0) {
+ http_chunk_append_file(srv, con, srv->tmp_buf, begin_range, range_len);
+ }
+ sendfile2_content_length += range_len;
+
+ if (*pos == ',') pos++;
+ }
+ }
+ break;
case 14:
if (0 == strncasecmp(key, "Content-Length", key_len)) {
con->response.content_length = strtol(value, NULL, 10);
@@ -2310,6 +2377,26 @@ static int fcgi_response_parse(server *srv, connection *con, plugin_data *p, buf
}
}
+ if (have_sendfile2) {
+ data_string *dcls;
+
+ hctx->send_content_body = 0;
+ joblist_append(srv, con);
+
+ /* fix content-length */
+ if (NULL == (dcls = (data_string *)array_get_unused_element(con->response.headers, TYPE_STRING))) {
+ dcls = data_response_init();
+ }
+
+ buffer_copy_string_len(dcls->key, "Content-Length", sizeof("Content-Length")-1);
+ buffer_copy_off_t(dcls->value, sendfile2_content_length);
+ dcls = (data_string*) array_replace(con->response.headers, (data_unset *)dcls);
+ if (dcls) dcls->free((data_unset*)dcls);
+
+ con->parsed_response |= HTTP_CONTENT_LENGTH;
+ con->response.content_length = sendfile2_content_length;
+ }
+
/* CGI/1.1 rev 03 - 7.2.1.2 */
if ((con->parsed_response & HTTP_LOCATION) &&
!(con->parsed_response & HTTP_STATUS)) {
@@ -2537,7 +2624,12 @@ static int fcgi_demux_response(server *srv, handler_ctx *hctx) {
}
/* parse the response header */
- fcgi_response_parse(srv, con, p, hctx->response_header);
+ if (fcgi_response_parse(srv, con, p, hctx->response_header)) {
+ con->http_status = 502;
+ hctx->send_content_body = 0;
+ con->file_started = 1;
+ break;
+ }
con->file_started = 1;
@@ -2548,7 +2640,7 @@ static int fcgi_demux_response(server *srv, handler_ctx *hctx) {
hctx->send_content_body = 0;
}
- if (host->allow_xsendfile &&
+ if (host->allow_xsendfile && hctx->send_content_body &&
(NULL != (ds = (data_string *) array_get_element(con->response.headers, "X-LIGHTTPD-send-file"))
|| NULL != (ds = (data_string *) array_get_element(con->response.headers, "X-Sendfile")))) {
stat_cache_entry *sce;
@@ -2672,53 +2764,55 @@ static int fcgi_restart_dead_procs(server *srv, plugin_data *p, fcgi_extension_h
break;
case PROC_STATE_DIED_WAIT_FOR_PID:
/* non-local procs don't have PIDs to wait for */
- if (!proc->is_local) break;
+ if (!proc->is_local) {
+ proc->state = PROC_STATE_DIED;
+ } else {
+ /* the child should not terminate at all */
- /* the child should not terminate at all */
+ for ( ;; ) {
+ switch(waitpid(proc->pid, &status, WNOHANG)) {
+ case 0:
+ /* child is still alive */
+ if (srv->cur_ts <= proc->disabled_until) break;
- for ( ;; ) {
- switch(waitpid(proc->pid, &status, WNOHANG)) {
- case 0:
- /* child is still alive */
- if (srv->cur_ts <= proc->disabled_until) break;
-
- proc->state = PROC_STATE_RUNNING;
- host->active_procs++;
-
- log_error_write(srv, __FILE__, __LINE__, "sbdb",
+ proc->state = PROC_STATE_RUNNING;
+ host->active_procs++;
+
+ log_error_write(srv, __FILE__, __LINE__, "sbdb",
"fcgi-server re-enabled:",
host->host, host->port,
host->unixsocket);
- break;
- case -1:
- if (errno == EINTR) continue;
+ break;
+ case -1:
+ if (errno == EINTR) continue;
- log_error_write(srv, __FILE__, __LINE__, "sd",
+ log_error_write(srv, __FILE__, __LINE__, "sd",
"child died somehow, waitpid failed:",
errno);
- proc->state = PROC_STATE_DIED;
- break;
- default:
- if (WIFEXITED(status)) {
+ proc->state = PROC_STATE_DIED;
+ break;
+ default:
+ if (WIFEXITED(status)) {
#if 0
- log_error_write(srv, __FILE__, __LINE__, "sdsd",
+ log_error_write(srv, __FILE__, __LINE__, "sdsd",
"child exited, pid:", proc->pid,
"status:", WEXITSTATUS(status));
#endif
- } else if (WIFSIGNALED(status)) {
- log_error_write(srv, __FILE__, __LINE__, "sd",
+ } else if (WIFSIGNALED(status)) {
+ log_error_write(srv, __FILE__, __LINE__, "sd",
"child signaled:",
WTERMSIG(status));
- } else {
- log_error_write(srv, __FILE__, __LINE__, "sd",
+ } else {
+ log_error_write(srv, __FILE__, __LINE__, "sd",
"child died somehow:",
status);
+ }
+
+ proc->state = PROC_STATE_DIED;
+ break;
}
-
- proc->state = PROC_STATE_DIED;
break;
}
- break;
}
/* fall through if we have a dead proc now */
@@ -2728,7 +2822,7 @@ static int fcgi_restart_dead_procs(server *srv, plugin_data *p, fcgi_extension_h
/* local procs get restarted by us,
* remote ones hopefully by the admin */
- if (proc->is_local) {
+ if (!buffer_is_empty(host->bin_path)) {
/* we still have connections bound to this proc,
* let them terminate first */
if (proc->load != 0) break;
@@ -2739,7 +2833,7 @@ static int fcgi_restart_dead_procs(server *srv, plugin_data *p, fcgi_extension_h
log_error_write(srv, __FILE__, __LINE__, "ssbsdsd",
"--- fastcgi spawning",
"\n\tsocket", proc->connection_name,
- "\n\tcurrent:", 1, "/", host->min_procs);
+ "\n\tcurrent:", 1, "/", host->max_procs);
}
if (fcgi_spawn_connection(srv, p, host, proc)) {
@@ -2778,18 +2872,12 @@ static handler_t fcgi_write_request(server *srv, handler_ctx *hctx) {
* - tcp socket (do not check host->host->uses, as it may be not set which means INADDR_LOOPBACK)
* - unix socket
*/
- if (!host ||
- (!host->port && !host->unixsocket->used)) {
- log_error_write(srv, __FILE__, __LINE__, "sxddd",
- "write-req: error",
- host,
- host->host->used,
- host->port,
- host->unixsocket->used);
-
- hctx->proc->disabled_until = srv->cur_ts + 10;
- hctx->proc->state = PROC_STATE_DIED;
-
+ if (!host) {
+ log_error_write(srv, __FILE__, __LINE__, "s", "fatal error: host = NULL");
+ return HANDLER_ERROR;
+ }
+ if ((!host->port && !host->unixsocket->used)) {
+ log_error_write(srv, __FILE__, __LINE__, "s", "fatal error: neither host->port nor host->unixsocket is set");
return HANDLER_ERROR;
}
@@ -2803,8 +2891,7 @@ static handler_t fcgi_write_request(server *srv, handler_ctx *hctx) {
log_error_write(srv, __FILE__, __LINE__, "ss",
"getsockopt failed:", strerror(errno));
- hctx->proc->disabled_until = srv->cur_ts + 10;
- hctx->proc->state = PROC_STATE_DIED;
+ fcgi_host_disable(srv, hctx);
return HANDLER_ERROR;
}
@@ -2817,15 +2904,11 @@ static handler_t fcgi_write_request(server *srv, handler_ctx *hctx) {
"socket:", hctx->proc->connection_name);
}
- hctx->proc->disabled_until = srv->cur_ts + 5;
-
- if (hctx->proc->is_local) {
- hctx->proc->state = PROC_STATE_DIED_WAIT_FOR_PID;
- } else {
- hctx->proc->state = PROC_STATE_DIED;
- }
-
- hctx->proc->state = PROC_STATE_DIED;
+ fcgi_host_disable(srv, hctx);
+ log_error_write(srv, __FILE__, __LINE__, "sdssdsd",
+ "backend is overloaded; we'll disable it for", hctx->host->disable_time, "seconds and send the request to another backend instead:",
+ "reconnects:", hctx->reconnects,
+ "load:", host->load);
fastcgi_status_copy_procname(p->statuskey, hctx->host, hctx->proc);
buffer_append_string_len(p->statuskey, CONST_STR_LEN(".died"));
@@ -2910,14 +2993,16 @@ static handler_t fcgi_write_request(server *srv, handler_ctx *hctx) {
/* cool down the backend, it is overloaded
* -> EAGAIN */
- log_error_write(srv, __FILE__, __LINE__, "ssdsd",
- "backend is overloaded; we'll disable it for 2 seconds and send the request to another backend instead:",
- "reconnects:", hctx->reconnects,
- "load:", host->load);
-
+ if (hctx->host->disable_time) {
+ log_error_write(srv, __FILE__, __LINE__, "sdssdsd",
+ "backend is overloaded; we'll disable it for", hctx->host->disable_time, "seconds and send the request to another backend instead:",
+ "reconnects:", hctx->reconnects,
+ "load:", host->load);
- hctx->proc->disabled_until = srv->cur_ts + 2;
- hctx->proc->state = PROC_STATE_OVERLOADED;
+ hctx->proc->disabled_until = srv->cur_ts + hctx->host->disable_time;
+ if (hctx->proc->state == PROC_STATE_RUNNING) hctx->host->active_procs--;
+ hctx->proc->state = PROC_STATE_OVERLOADED;
+ }
fastcgi_status_copy_procname(p->statuskey, hctx->host, hctx->proc);
buffer_append_string_len(p->statuskey, CONST_STR_LEN(".overloaded"));
@@ -2930,18 +3015,13 @@ static handler_t fcgi_write_request(server *srv, handler_ctx *hctx) {
* - ECONNREFUSED for tcp-ip sockets
* - ENOENT for unix-domain-sockets
*
- * for check if the host is back in 5 seconds
+ * for check if the host is back in hctx->host->disable_time seconds
* */
- hctx->proc->disabled_until = srv->cur_ts + 5;
- if (hctx->proc->is_local) {
- hctx->proc->state = PROC_STATE_DIED_WAIT_FOR_PID;
- } else {
- hctx->proc->state = PROC_STATE_DIED;
- }
+ fcgi_host_disable(srv, hctx);
- log_error_write(srv, __FILE__, __LINE__, "ssdsd",
- "backend died; we'll disable it for 5 seconds and send the request to another backend instead:",
+ log_error_write(srv, __FILE__, __LINE__, "sdssdsd",
+ "backend died; we'll disable it for", hctx->host->disable_time, "seconds and send the request to another backend instead:",
"reconnects:", hctx->reconnects,
"load:", host->load);
@@ -2957,8 +3037,6 @@ static handler_t fcgi_write_request(server *srv, handler_ctx *hctx) {
fcgi_set_state(srv, hctx, FCGI_STATE_PREPARE_WRITE);
break;
- case CONNECTION_UNSET:
- break;
}
case FCGI_STATE_PREPARE_WRITE:
@@ -2977,10 +3055,10 @@ static handler_t fcgi_write_request(server *srv, handler_ctx *hctx) {
if (p->conf.debug) {
log_error_write(srv, __FILE__, __LINE__, "ssdsbsd",
- "got proc:",
- "pid:", hctx->proc->pid,
- "socket:", hctx->proc->connection_name,
- "load:", hctx->proc->load);
+ "got proc:",
+ "pid:", hctx->proc->pid,
+ "socket:", hctx->proc->connection_name,
+ "load:", hctx->proc->load);
}
/* move the proc-list entry down the list */
@@ -3032,11 +3110,6 @@ static handler_t fcgi_write_request(server *srv, handler_ctx *hctx) {
"reconnect attempts:", hctx->reconnects);
return HANDLER_ERROR;
- case EAGAIN:
- case EINTR:
- fdevent_event_add(srv->ev, &(hctx->fde_ndx), hctx->fd, FDEVENT_OUT);
-
- return HANDLER_WAIT_FOR_EVENT;
default:
log_error_write(srv, __FILE__, __LINE__, "ssd",
"write failed:", strerror(errno), errno);
@@ -3149,8 +3222,6 @@ SUBREQUEST_FUNC(mod_fastcgi_handle_subrequest) {
if (hctx->state == FCGI_STATE_INIT ||
hctx->state == FCGI_STATE_CONNECT_DELAYED) {
- if (proc) host->active_procs--;
-
fcgi_restart_dead_procs(srv, p, host);
/* cleanup this request and let the request handler start this request again */
@@ -3164,7 +3235,7 @@ SUBREQUEST_FUNC(mod_fastcgi_handle_subrequest) {
buffer_reset(con->physical.path);
con->mode = DIRECT;
- con->http_status = 500;
+ con->http_status = 503;
joblist_append(srv, con); /* in case we come from the event-handler */
return HANDLER_FINISHED;
@@ -3266,7 +3337,7 @@ static handler_t fcgi_handle_fdevent(void *s, void *ctx, int revents) {
log_error_write(srv, __FILE__, __LINE__, "ssbsdsd",
"--- fastcgi spawning",
"\n\tsocket", proc->connection_name,
- "\n\tcurrent:", 1, "/", host->min_procs);
+ "\n\tcurrent:", 1, "/", host->max_procs);
}
if (fcgi_spawn_connection(srv, p, host, proc)) {
@@ -3288,18 +3359,18 @@ static handler_t fcgi_handle_fdevent(void *s, void *ctx, int revents) {
hctx->reconnects < 5) {
fcgi_reconnect(srv, hctx);
- log_error_write(srv, __FILE__, __LINE__, "ssbsbs",
+ log_error_write(srv, __FILE__, __LINE__, "ssbsBSBs",
"response not received, request not sent",
"on socket:", proc->connection_name,
- "for", con->uri.path, ", reconnecting");
+ "for", con->uri.path, "?", con->uri.query, ", reconnecting");
return HANDLER_WAIT_FOR_FD;
}
- log_error_write(srv, __FILE__, __LINE__, "sosbsbs",
+ log_error_write(srv, __FILE__, __LINE__, "sosbsBSBs",
"response not received, request sent:", hctx->wb->bytes_out,
"on socket:", proc->connection_name,
- "for", con->uri.path, ", closing connection");
+ "for", con->uri.path, "?", con->uri.query, ", closing connection");
fcgi_connection_close(srv, hctx);
@@ -3311,10 +3382,10 @@ static handler_t fcgi_handle_fdevent(void *s, void *ctx, int revents) {
/* response might have been already started, kill the connection */
fcgi_connection_close(srv, hctx);
- log_error_write(srv, __FILE__, __LINE__, "ssbsbs",
+ log_error_write(srv, __FILE__, __LINE__, "ssbsBSBs",
"response already sent out, but backend returned error",
"on socket:", proc->connection_name,
- "for", con->uri.path, ", terminating connection");
+ "for", con->uri.path, "?", con->uri.query, ", terminating connection");
connection_set_state(srv, con, CON_STATE_ERROR);
}
@@ -3364,9 +3435,9 @@ static handler_t fcgi_handle_fdevent(void *s, void *ctx, int revents) {
* even if the FCGI_FIN packet is not received yet
*/
} else {
- log_error_write(srv, __FILE__, __LINE__, "sbsbsd",
+ log_error_write(srv, __FILE__, __LINE__, "sBSbsbsd",
"error: unexpected close of fastcgi connection for",
- con->uri.path,
+ con->uri.path, "?", con->uri.query,
"(no fastcgi process on socket:", proc->connection_name, "?)",
hctx->state);
@@ -3489,25 +3560,27 @@ static handler_t fcgi_check_extension(server *srv, connection *con, void *p_d, i
/* check if extension matches */
for (k = 0; k < p->conf.exts->used; k++) {
size_t ct_len; /* length of the config entry */
+ fcgi_extension *ext = p->conf.exts->exts[k];
- extension = p->conf.exts->exts[k];
+ if (ext->key->used == 0) continue;
- if (extension->key->used == 0) continue;
-
- ct_len = extension->key->used - 1;
+ ct_len = ext->key->used - 1;
/* check _url_ in the form "/fcgi_pattern" */
- if (extension->key->ptr[0] == '/') {
+ if (ext->key->ptr[0] == '/') {
if ((ct_len <= con->uri.path->used -1) &&
- (strncmp(con->uri.path->ptr, extension->key->ptr, ct_len) == 0))
+ (strncmp(con->uri.path->ptr, ext->key->ptr, ct_len) == 0)) {
+ extension = ext;
break;
- } else if ((ct_len <= s_len) && (0 == strncmp(fn->ptr + s_len - ct_len, extension->key->ptr, ct_len))) {
+ }
+ } else if ((ct_len <= s_len) && (0 == strncmp(fn->ptr + s_len - ct_len, ext->key->ptr, ct_len))) {
/* check extension in the form ".fcg" */
+ extension = ext;
break;
}
}
/* extension doesn't match */
- if (k == p->conf.exts->used) {
+ if (NULL == extension) {
return HANDLER_GO_ON;
}
}
@@ -3535,8 +3608,8 @@ static handler_t fcgi_check_extension(server *srv, connection *con, void *p_d, i
if (!extension->note_is_sent) {
extension->note_is_sent = 1;
- log_error_write(srv, __FILE__, __LINE__, "sbsbs",
- "all handlers for ", con->uri.path,
+ log_error_write(srv, __FILE__, __LINE__, "sBSbsbs",
+ "all handlers for", con->uri.path, "?", con->uri.query,
"on", extension->key,
"are down.");
}
@@ -3727,107 +3800,12 @@ TRIGGER_FUNC(mod_fastcgi_handle_trigger) {
for (n = 0; n < ex->used; n++) {
fcgi_proc *proc;
- unsigned long sum_load = 0;
fcgi_extension_host *host;
host = ex->hosts[n];
fcgi_restart_dead_procs(srv, p, host);
- for (proc = host->first; proc; proc = proc->next) {
- sum_load += proc->load;
- }
-
- if (host->num_procs &&
- host->num_procs < host->max_procs &&
- (sum_load / host->num_procs) > host->max_load_per_proc) {
- /* overload, spawn new child */
- if (p->conf.debug) {
- log_error_write(srv, __FILE__, __LINE__, "s",
- "overload detected, spawning a new child");
- }
-
- for (proc = host->unused_procs; proc && proc->pid != 0; proc = proc->next);
-
- if (proc) {
- if (proc == host->unused_procs) host->unused_procs = proc->next;
-
- if (proc->next) proc->next->prev = NULL;
-
- host->max_id++;
- } else {
- proc = fastcgi_process_init();
- proc->id = host->max_id++;
- }
-
- host->num_procs++;
-
- if (buffer_is_empty(host->unixsocket)) {
- proc->port = host->port + proc->id;
- } else {
- buffer_copy_string_buffer(proc->unixsocket, host->unixsocket);
- buffer_append_string_len(proc->unixsocket, CONST_STR_LEN("-"));
- buffer_append_long(proc->unixsocket, proc->id);
- }
-
- if (fcgi_spawn_connection(srv, p, host, proc)) {
- log_error_write(srv, __FILE__, __LINE__, "s",
- "ERROR: spawning fcgi failed.");
- return HANDLER_ERROR;
- }
-
- proc->prev = NULL;
- proc->next = host->first;
- if (host->first) {
- host->first->prev = proc;
- }
- host->first = proc;
- }
-
- for (proc = host->first; proc; proc = proc->next) {
- if (proc->load != 0) break;
- if (host->num_procs <= host->min_procs) break;
- if (proc->pid == 0) continue;
-
- if (srv->cur_ts - proc->last_used > host->idle_timeout) {
- /* a proc is idling for a long time now,
- * terminate it */
-
- if (p->conf.debug) {
- log_error_write(srv, __FILE__, __LINE__, "ssbsd",
- "idle-timeout reached; terminating child:",
- "socket:", proc->connection_name,
- "pid", proc->pid);
- }
-
-
- if (proc->next) proc->next->prev = proc->prev;
- if (proc->prev) proc->prev->next = proc->next;
-
- if (proc->prev == NULL) host->first = proc->next;
-
- proc->prev = NULL;
- proc->next = host->unused_procs;
-
- if (host->unused_procs) host->unused_procs->prev = proc;
- host->unused_procs = proc;
-
- kill(proc->pid, SIGTERM);
-
- proc->state = PROC_STATE_KILLED;
-
- log_error_write(srv, __FILE__, __LINE__, "ssbsd",
- "killed:",
- "socket:", proc->connection_name,
- "pid", proc->pid);
-
- host->num_procs--;
-
- /* proc is now in unused, let the next second handle the next process */
- break;
- }
- }
-
for (proc = host->unused_procs; proc; proc = proc->next) {
int status;
@@ -3873,6 +3851,7 @@ TRIGGER_FUNC(mod_fastcgi_handle_trigger) {
status);
}
proc->pid = 0;
+ if (proc->state == PROC_STATE_RUNNING) host->active_procs--;
proc->state = PROC_STATE_UNSET;
host->max_id--;
}
diff --git a/src/mod_flv_streaming.c b/src/mod_flv_streaming.c
index f8bf999..7a100db 100644
--- a/src/mod_flv_streaming.c
+++ b/src/mod_flv_streaming.c
@@ -1,7 +1,3 @@
-#include <ctype.h>
-#include <stdlib.h>
-#include <string.h>
-
#include "base.h"
#include "log.h"
#include "buffer.h"
@@ -11,9 +7,9 @@
#include "plugin.h"
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
+#include <ctype.h>
+#include <stdlib.h>
+#include <string.h>
/* plugin config for all request/connections */
diff --git a/src/mod_indexfile.c b/src/mod_indexfile.c
index d133474..c01da2f 100644
--- a/src/mod_indexfile.c
+++ b/src/mod_indexfile.c
@@ -1,9 +1,3 @@
-#include <ctype.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-
-
#include "base.h"
#include "log.h"
#include "buffer.h"
@@ -12,6 +6,11 @@
#include "stat_cache.h"
+#include <ctype.h>
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+
/* plugin config for all request/connections */
typedef struct {
diff --git a/src/mod_magnet.c b/src/mod_magnet.c
index b8da992..0f4aefd 100644
--- a/src/mod_magnet.c
+++ b/src/mod_magnet.c
@@ -1,9 +1,3 @@
-#include <ctype.h>
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-#include <setjmp.h>
-
#include "base.h"
#include "log.h"
#include "buffer.h"
@@ -16,6 +10,12 @@
#include "status_counter.h"
#include "etag.h"
+#include <ctype.h>
+#include <stdlib.h>
+#include <string.h>
+#include <assert.h>
+#include <setjmp.h>
+
#ifdef HAVE_LUA_H
#include <lua.h>
#include <lauxlib.h>
@@ -158,6 +158,80 @@ static int mod_magnet_patch_connection(server *srv, connection *con, plugin_data
}
#undef PATCH
+/* See http://lua-users.org/wiki/GeneralizedPairsAndIpairs for implementation details. */
+
+/* Override the default pairs() function to allow us to use a __pairs metakey */
+static int magnet_pairs(lua_State *L) {
+ luaL_checkany(L, 1);
+
+ if (luaL_getmetafield(L, 1, "__pairs")) {
+ lua_insert(L, 1);
+ lua_call(L, lua_gettop(L) - 1, LUA_MULTRET);
+ return lua_gettop(L);
+ } else {
+ lua_pushvalue(L, lua_upvalueindex(1));
+ lua_call(L, lua_gettop(L) - 1, LUA_MULTRET);
+ return lua_gettop(L);
+ }
+}
+
+/* Define a function that will iterate over an array* (in upval 1) using current position (upval 2) */
+static int magnet_array_next(lua_State *L) {
+ data_unset *du;
+ data_string *ds;
+ data_integer *di;
+
+ size_t pos = lua_tointeger(L, lua_upvalueindex(1));
+ array *a = lua_touserdata(L, lua_upvalueindex(2));
+
+ lua_settop(L, 0);
+
+ if (pos >= a->used) return 0;
+ if (NULL != (du = a->data[pos])) {
+ if (du->key->used) {
+ lua_pushlstring(L, du->key->ptr, du->key->used - 1);
+ }
+ else {
+ lua_pushlstring(L, "", 0);
+ }
+ switch (du->type) {
+ case TYPE_STRING:
+ ds = (data_string *)du;
+ if (ds->value && ds->value->used) {
+ lua_pushlstring(L, ds->value->ptr, ds->value->used - 1);
+ } else {
+ lua_pushnil(L);
+ }
+ break;
+ case TYPE_COUNT:
+ case TYPE_INTEGER:
+ di = (data_integer *)du;
+ lua_pushinteger(L, di->value);
+ break;
+ default:
+ lua_pushnil(L);
+ break;
+ }
+
+ /* Update our positional upval to reflect our new current position */
+ pos++;
+ lua_pushinteger(L, pos);
+ lua_replace(L, lua_upvalueindex(1));
+
+ /* Returning 2 items on the stack (key, value) */
+ return 2;
+ }
+ return 0;
+}
+
+/* Create the closure necessary to iterate over the array *a with the above function */
+static int magnet_array_pairs(lua_State *L, array *a) {
+ lua_pushinteger(L, 0); /* Push our current pos (the start) into upval 1 */
+ lua_pushlightuserdata(L, a); /* Push our array *a into upval 2 */
+ lua_pushcclosure(L, magnet_array_next, 2); /* Push our new closure with 2 upvals */
+ return 1;
+}
+
static int magnet_print(lua_State *L) {
const char *s = luaL_checkstring(L, 1);
server *srv;
@@ -283,17 +357,11 @@ static int magnet_atpanic(lua_State *L) {
}
static int magnet_reqhdr_get(lua_State *L) {
- server *srv;
connection *con;
data_string *ds;
const char *key = luaL_checkstring(L, 2);
- lua_pushstring(L, "lighty.srv");
- lua_gettable(L, LUA_REGISTRYINDEX);
- srv = lua_touserdata(L, -1);
- lua_pop(L, 1);
-
lua_pushstring(L, "lighty.con");
lua_gettable(L, LUA_REGISTRYINDEX);
con = lua_touserdata(L, -1);
@@ -311,6 +379,17 @@ static int magnet_reqhdr_get(lua_State *L) {
return 1;
}
+static int magnet_reqhdr_pairs(lua_State *L) {
+ connection *con;
+
+ lua_pushstring(L, "lighty.con");
+ lua_gettable(L, LUA_REGISTRYINDEX);
+ con = lua_touserdata(L, -1);
+ lua_pop(L, 1);
+
+ return magnet_array_pairs(L, con->request.headers);
+}
+
static int magnet_status_get(lua_State *L) {
data_integer *di;
server *srv;
@@ -347,6 +426,17 @@ static int magnet_status_set(lua_State *L) {
return 0;
}
+static int magnet_status_pairs(lua_State *L) {
+ server *srv;
+
+ lua_pushstring(L, "lighty.srv");
+ lua_gettable(L, LUA_REGISTRYINDEX);
+ srv = lua_touserdata(L, -1);
+ lua_pop(L, 1);
+
+ return magnet_array_pairs(L, srv->status);
+}
+
typedef struct {
const char *name;
enum {
@@ -368,33 +458,32 @@ typedef struct {
MAGNET_ENV_REQUEST_PATH_INFO,
MAGNET_ENV_REQUEST_REMOTE_IP,
MAGNET_ENV_REQUEST_PROTOCOL
- } type;
+ } type;
} magnet_env_t;
-static buffer *magnet_env_get_buffer(server *srv, connection *con, const char *key) {
- buffer *dest = NULL;
- size_t i;
+static const magnet_env_t magnet_env[] = {
+ { "physical.path", MAGNET_ENV_PHYICAL_PATH },
+ { "physical.rel-path", MAGNET_ENV_PHYICAL_REL_PATH },
+ { "physical.doc-root", MAGNET_ENV_PHYICAL_DOC_ROOT },
- const magnet_env_t env[] = {
- { "physical.path", MAGNET_ENV_PHYICAL_PATH },
- { "physical.rel-path", MAGNET_ENV_PHYICAL_REL_PATH },
- { "physical.doc-root", MAGNET_ENV_PHYICAL_DOC_ROOT },
-
- { "uri.path", MAGNET_ENV_URI_PATH },
- { "uri.path-raw", MAGNET_ENV_URI_PATH_RAW },
- { "uri.scheme", MAGNET_ENV_URI_SCHEME },
- { "uri.authority", MAGNET_ENV_URI_AUTHORITY },
- { "uri.query", MAGNET_ENV_URI_QUERY },
-
- { "request.method", MAGNET_ENV_REQUEST_METHOD },
- { "request.uri", MAGNET_ENV_REQUEST_URI },
- { "request.orig-uri", MAGNET_ENV_REQUEST_ORIG_URI },
- { "request.path-info", MAGNET_ENV_REQUEST_PATH_INFO },
- { "request.remote-ip", MAGNET_ENV_REQUEST_REMOTE_IP },
- { "request.protocol", MAGNET_ENV_REQUEST_PROTOCOL },
-
- { NULL, MAGNET_ENV_UNSET }
- };
+ { "uri.path", MAGNET_ENV_URI_PATH },
+ { "uri.path-raw", MAGNET_ENV_URI_PATH_RAW },
+ { "uri.scheme", MAGNET_ENV_URI_SCHEME },
+ { "uri.authority", MAGNET_ENV_URI_AUTHORITY },
+ { "uri.query", MAGNET_ENV_URI_QUERY },
+
+ { "request.method", MAGNET_ENV_REQUEST_METHOD },
+ { "request.uri", MAGNET_ENV_REQUEST_URI },
+ { "request.orig-uri", MAGNET_ENV_REQUEST_ORIG_URI },
+ { "request.path-info", MAGNET_ENV_REQUEST_PATH_INFO },
+ { "request.remote-ip", MAGNET_ENV_REQUEST_REMOTE_IP },
+ { "request.protocol", MAGNET_ENV_REQUEST_PROTOCOL },
+
+ { NULL, MAGNET_ENV_UNSET }
+};
+
+static buffer *magnet_env_get_buffer_by_id(server *srv, connection *con, int id) {
+ buffer *dest = NULL;
UNUSED(srv);
@@ -403,11 +492,7 @@ static buffer *magnet_env_get_buffer(server *srv, connection *con, const char *k
*
*/
- for (i = 0; env[i].name; i++) {
- if (0 == strcmp(key, env[i].name)) break;
- }
-
- switch (env[i].type) {
+ switch (id) {
case MAGNET_ENV_PHYICAL_PATH: dest = con->physical.path; break;
case MAGNET_ENV_PHYICAL_REL_PATH: dest = con->physical.rel_path; break;
case MAGNET_ENV_PHYICAL_DOC_ROOT: dest = con->physical.doc_root; break;
@@ -437,6 +522,16 @@ static buffer *magnet_env_get_buffer(server *srv, connection *con, const char *k
return dest;
}
+static buffer *magnet_env_get_buffer(server *srv, connection *con, const char *key) {
+ size_t i;
+
+ for (i = 0; magnet_env[i].name; i++) {
+ if (0 == strcmp(key, magnet_env[i].name)) break;
+ }
+
+ return magnet_env_get_buffer_by_id(srv, con, magnet_env[i].type);
+}
+
static int magnet_env_get(lua_State *L) {
server *srv;
connection *con;
@@ -494,6 +589,50 @@ static int magnet_env_set(lua_State *L) {
return 0;
}
+static int magnet_env_next(lua_State *L) {
+ server *srv;
+ connection *con;
+ int pos = lua_tointeger(L, lua_upvalueindex(1));
+
+ buffer *dest;
+
+ lua_pushstring(L, "lighty.srv");
+ lua_gettable(L, LUA_REGISTRYINDEX);
+ srv = lua_touserdata(L, -1);
+ lua_pop(L, 1);
+
+ lua_pushstring(L, "lighty.con");
+ lua_gettable(L, LUA_REGISTRYINDEX);
+ con = lua_touserdata(L, -1);
+ lua_pop(L, 1);
+
+ lua_settop(L, 0);
+
+ if (NULL == magnet_env[pos].name) return 0; /* end of list */
+
+ lua_pushstring(L, magnet_env[pos].name);
+
+ dest = magnet_env_get_buffer_by_id(srv, con, magnet_env[pos].type);
+ if (dest && dest->used) {
+ lua_pushlstring(L, dest->ptr, dest->used - 1);
+ } else {
+ lua_pushnil(L);
+ }
+
+ /* Update our positional upval to reflect our new current position */
+ pos++;
+ lua_pushinteger(L, pos);
+ lua_replace(L, lua_upvalueindex(1));
+
+ /* Returning 2 items on the stack (key, value) */
+ return 2;
+}
+
+static int magnet_env_pairs(lua_State *L) {
+ lua_pushinteger(L, 0); /* Push our current pos (the start) into upval 1 */
+ lua_pushcclosure(L, magnet_env_next, 1); /* Push our new closure with 1 upvals */
+ return 1;
+}
static int magnet_cgi_get(lua_State *L) {
connection *con;
@@ -530,6 +669,17 @@ static int magnet_cgi_set(lua_State *L) {
return 0;
}
+static int magnet_cgi_pairs(lua_State *L) {
+ connection *con;
+
+ lua_pushstring(L, "lighty.con");
+ lua_gettable(L, LUA_REGISTRYINDEX);
+ con = lua_touserdata(L, -1);
+ lua_pop(L, 1);
+
+ return magnet_array_pairs(L, con->environment);
+}
+
static int magnet_copy_response_header(server *srv, connection *con, plugin_data *p, lua_State *L) {
UNUSED(p);
@@ -739,6 +889,8 @@ static handler_t magnet_attract(server *srv, connection *con, plugin_data *p, bu
lua_newtable(L); /* the meta-table for the request-table (sp += 1) */
lua_pushcfunction(L, magnet_reqhdr_get); /* (sp += 1) */
lua_setfield(L, -2, "__index"); /* (sp -= 1) */
+ lua_pushcfunction(L, magnet_reqhdr_pairs); /* (sp += 1) */
+ lua_setfield(L, -2, "__pairs"); /* (sp -= 1) */
lua_setmetatable(L, -2); /* tie the metatable to request (sp -= 1) */
lua_setfield(L, -2, "request"); /* content = {} (sp -= 1) */
@@ -748,6 +900,8 @@ static handler_t magnet_attract(server *srv, connection *con, plugin_data *p, bu
lua_setfield(L, -2, "__index"); /* (sp -= 1) */
lua_pushcfunction(L, magnet_env_set); /* (sp += 1) */
lua_setfield(L, -2, "__newindex"); /* (sp -= 1) */
+ lua_pushcfunction(L, magnet_env_pairs); /* (sp += 1) */
+ lua_setfield(L, -2, "__pairs"); /* (sp -= 1) */
lua_setmetatable(L, -2); /* tie the metatable to request (sp -= 1) */
lua_setfield(L, -2, "env"); /* content = {} (sp -= 1) */
@@ -757,6 +911,8 @@ static handler_t magnet_attract(server *srv, connection *con, plugin_data *p, bu
lua_setfield(L, -2, "__index"); /* (sp -= 1) */
lua_pushcfunction(L, magnet_cgi_set); /* (sp += 1) */
lua_setfield(L, -2, "__newindex"); /* (sp -= 1) */
+ lua_pushcfunction(L, magnet_cgi_pairs); /* (sp += 1) */
+ lua_setfield(L, -2, "__pairs"); /* (sp -= 1) */
lua_setmetatable(L, -2); /* tie the metatable to req_env (sp -= 1) */
lua_setfield(L, -2, "req_env"); /* content = {} (sp -= 1) */
@@ -766,6 +922,8 @@ static handler_t magnet_attract(server *srv, connection *con, plugin_data *p, bu
lua_setfield(L, -2, "__index"); /* (sp -= 1) */
lua_pushcfunction(L, magnet_status_set); /* (sp += 1) */
lua_setfield(L, -2, "__newindex"); /* (sp -= 1) */
+ lua_pushcfunction(L, magnet_status_pairs); /* (sp += 1) */
+ lua_setfield(L, -2, "__pairs"); /* (sp -= 1) */
lua_setmetatable(L, -2); /* tie the metatable to request (sp -= 1) */
lua_setfield(L, -2, "status"); /* content = {} (sp -= 1) */
@@ -784,6 +942,11 @@ static handler_t magnet_attract(server *srv, connection *con, plugin_data *p, bu
lua_setfield(L, -2, "lighty"); /* lighty.* (sp -= 1) */
+ /* override the default pairs() function to our __pairs capable version */
+ lua_getglobal(L, "pairs"); /* push original pairs() (sp += 1) */
+ lua_pushcclosure(L, magnet_pairs, 1);
+ lua_setfield(L, -2, "pairs"); /* (sp -= 1) */
+
lua_newtable(L); /* the meta-table for the new env (sp += 1) */
lua_pushvalue(L, LUA_GLOBALSINDEX); /* (sp += 1) */
lua_setfield(L, -2, "__index"); /* { __index = _G } (sp -= 1) */
diff --git a/src/mod_magnet_cache.c b/src/mod_magnet_cache.c
index 1e4840f..50326cf 100644
--- a/src/mod_magnet_cache.c
+++ b/src/mod_magnet_cache.c
@@ -1,10 +1,10 @@
+#include "mod_magnet_cache.h"
+#include "stat_cache.h"
+
#include <stdlib.h>
#include <time.h>
#include <assert.h>
-#include "mod_magnet_cache.h"
-#include "stat_cache.h"
-
#ifdef HAVE_LUA_H
#include <lualib.h>
#include <lauxlib.h>
diff --git a/src/mod_mysql_vhost.c b/src/mod_mysql_vhost.c
index 7c81067..df29186 100644
--- a/src/mod_mysql_vhost.c
+++ b/src/mod_mysql_vhost.c
@@ -259,8 +259,14 @@ SERVER_FUNC(mod_mysql_vhost_set_defaults) {
#define FOO(x) (s->x->used ? s->x->ptr : NULL)
+#if MYSQL_VERSION_ID >= 40100
+ /* CLIENT_MULTI_STATEMENTS first appeared in 4.1 */
+ if (!mysql_real_connect(s->mysql, FOO(hostname), FOO(myuser), FOO(mypass),
+ FOO(mydb), s->port, FOO(mysock), CLIENT_MULTI_STATEMENTS)) {
+#else
if (!mysql_real_connect(s->mysql, FOO(hostname), FOO(myuser), FOO(mypass),
FOO(mydb), s->port, FOO(mysock), 0)) {
+#endif
log_error_write(srv, __FILE__, __LINE__, "s", mysql_error(s->mysql));
return HANDLER_ERROR;
@@ -369,6 +375,9 @@ CONNECTION_FUNC(mod_mysql_vhost_handle_docroot) {
if (!row || cols < 1) {
/* no such virtual host */
mysql_free_result(result);
+#if MYSQL_VERSION_ID >= 40100
+ while (mysql_next_result(p->conf.mysql) == 0);
+#endif
return HANDLER_GO_ON;
}
@@ -402,6 +411,9 @@ CONNECTION_FUNC(mod_mysql_vhost_handle_docroot) {
c->fcgi_offset = c->fcgi_arg->used = 0;
}
mysql_free_result(result);
+#if MYSQL_VERSION_ID >= 40100
+ while (mysql_next_result(p->conf.mysql) == 0);
+#endif
/* fix virtual server and docroot */
GO_ON: buffer_copy_string_buffer(con->server_name, c->server_name);
@@ -416,6 +428,9 @@ GO_ON: buffer_copy_string_buffer(con->server_name, c->server_name);
return HANDLER_GO_ON;
ERR500: if (result) mysql_free_result(result);
+#if MYSQL_VERSION_ID >= 40100
+ while (mysql_next_result(p->conf.mysql) == 0);
+#endif
con->http_status = 500; /* Internal Error */
con->mode = DIRECT;
return HANDLER_FINISHED;
@@ -424,15 +439,15 @@ ERR500: if (result) mysql_free_result(result);
/* this function is called at dlopen() time and inits the callbacks */
int mod_mysql_vhost_plugin_init(plugin *p);
int mod_mysql_vhost_plugin_init(plugin *p) {
- p->version = LIGHTTPD_VERSION_ID;
- p->name = buffer_init_string("mysql_vhost");
+ p->version = LIGHTTPD_VERSION_ID;
+ p->name = buffer_init_string("mysql_vhost");
- p->init = mod_mysql_vhost_init;
- p->cleanup = mod_mysql_vhost_cleanup;
- p->handle_request_done = mod_mysql_vhost_handle_connection_close;
+ p->init = mod_mysql_vhost_init;
+ p->cleanup = mod_mysql_vhost_cleanup;
+ p->connection_reset = mod_mysql_vhost_handle_connection_close;
- p->set_defaults = mod_mysql_vhost_set_defaults;
- p->handle_docroot = mod_mysql_vhost_handle_docroot;
+ p->set_defaults = mod_mysql_vhost_set_defaults;
+ p->handle_docroot = mod_mysql_vhost_handle_docroot;
return 0;
}
@@ -441,7 +456,7 @@ int mod_mysql_vhost_plugin_init(plugin *p) {
int mod_mysql_vhost_plugin_init(plugin *p);
int mod_mysql_vhost_plugin_init(plugin *p) {
p->version = LIGHTTPD_VERSION_ID;
- p->name = buffer_init_string("mysql_vhost");
+ p->name = buffer_init_string("mysql_vhost");
return 0;
}
diff --git a/src/mod_proxy.c b/src/mod_proxy.c
index 5f6a7da..33ac1d8 100644
--- a/src/mod_proxy.c
+++ b/src/mod_proxy.c
@@ -1,13 +1,3 @@
-#include <sys/types.h>
-
-#include <unistd.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <string.h>
-#include <stdlib.h>
-#include <ctype.h>
-#include <assert.h>
-
#include "buffer.h"
#include "server.h"
#include "keyvalue.h"
@@ -24,6 +14,16 @@
#include "inet_ntop_cache.h"
#include "crc32.h"
+#include <sys/types.h>
+
+#include <unistd.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <string.h>
+#include <stdlib.h>
+#include <ctype.h>
+#include <assert.h>
+
#include <stdio.h>
#ifdef HAVE_SYS_FILIO_H
@@ -756,12 +756,15 @@ static handler_t proxy_write_request(server *srv, handler_ctx *hctx) {
switch(hctx->state) {
case PROXY_STATE_INIT:
+#if defined(HAVE_IPV6) && defined(HAVE_INET_PTON)
if (strstr(host->host->ptr,":")) {
if (-1 == (hctx->fd = socket(AF_INET6, SOCK_STREAM, 0))) {
log_error_write(srv, __FILE__, __LINE__, "ss", "socket failed: ", strerror(errno));
return HANDLER_ERROR;
}
- } else {
+ } else
+#endif
+ {
if (-1 == (hctx->fd = socket(AF_INET, SOCK_STREAM, 0))) {
log_error_write(srv, __FILE__, __LINE__, "ss", "socket failed: ", strerror(errno));
return HANDLER_ERROR;
@@ -842,17 +845,14 @@ static handler_t proxy_write_request(server *srv, handler_ctx *hctx) {
chunkqueue_remove_finished_chunks(hctx->wb);
- if (-1 == ret) {
- if (errno != EAGAIN &&
- errno != EINTR) {
- log_error_write(srv, __FILE__, __LINE__, "ssd", "write failed:", strerror(errno), errno);
+ if (-1 == ret) { /* error on our side */
+ log_error_write(srv, __FILE__, __LINE__, "ssd", "write failed:", strerror(errno), errno);
- return HANDLER_ERROR;
- } else {
- fdevent_event_add(srv->ev, &(hctx->fde_ndx), hctx->fd, FDEVENT_OUT);
+ return HANDLER_WAIT_FOR_EVENT;
+ } else if (-2 == ret) { /* remote close */
+ log_error_write(srv, __FILE__, __LINE__, "ssd", "write failed, remote connection close:", strerror(errno), errno);
- return HANDLER_WAIT_FOR_EVENT;
- }
+ return HANDLER_WAIT_FOR_EVENT;
}
if (hctx->wb->bytes_out == hctx->wb->bytes_in) {
@@ -1107,19 +1107,20 @@ static handler_t mod_proxy_check_extension(server *srv, connection *con, void *p
/* check if extension matches */
for (k = 0; k < p->conf.extensions->used; k++) {
+ data_array *ext = NULL;
size_t ct_len;
- extension = (data_array *)p->conf.extensions->data[k];
+ ext = (data_array *)p->conf.extensions->data[k];
- if (extension->key->used == 0) continue;
+ if (ext->key->used == 0) continue;
- ct_len = extension->key->used - 1;
+ ct_len = ext->key->used - 1;
if (s_len < ct_len) continue;
/* check extension in the form "/proxy_pattern" */
- if (*(extension->key->ptr) == '/') {
- if (strncmp(fn->ptr, extension->key->ptr, ct_len) == 0) {
+ if (*(ext->key->ptr) == '/') {
+ if (strncmp(fn->ptr, ext->key->ptr, ct_len) == 0) {
if (s_len > ct_len + 1) {
char *pi_offset;
@@ -1127,15 +1128,17 @@ static handler_t mod_proxy_check_extension(server *srv, connection *con, void *p
path_info_offset = pi_offset - fn->ptr;
}
}
+ extension = ext;
break;
}
- } else if (0 == strncmp(fn->ptr + s_len - ct_len, extension->key->ptr, ct_len)) {
+ } else if (0 == strncmp(fn->ptr + s_len - ct_len, ext->key->ptr, ct_len)) {
/* check extension in the form ".fcg" */
+ extension = ext;
break;
}
}
- if (k == p->conf.extensions->used) {
+ if (NULL == extension) {
return HANDLER_GO_ON;
}
diff --git a/src/mod_redirect.c b/src/mod_redirect.c
index 59b129d..7a0f82a 100644
--- a/src/mod_redirect.c
+++ b/src/mod_redirect.c
@@ -1,7 +1,3 @@
-#include <ctype.h>
-#include <stdlib.h>
-#include <string.h>
-
#include "base.h"
#include "log.h"
#include "buffer.h"
@@ -9,9 +5,9 @@
#include "plugin.h"
#include "response.h"
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
+#include <ctype.h>
+#include <stdlib.h>
+#include <string.h>
typedef struct {
pcre_keyvalue_buffer *redirect;
@@ -203,7 +199,7 @@ static handler_t mod_redirect_uri_handler(server *srv, connection *con, void *p_
}
} else {
const char **list;
- size_t start, end;
+ size_t start;
size_t k;
/* it matched */
@@ -213,16 +209,14 @@ static handler_t mod_redirect_uri_handler(server *srv, connection *con, void *p_
buffer_reset(p->location);
- start = 0; end = pattern_len;
+ start = 0;
for (k = 0; k < pattern_len; k++) {
if (pattern[k] == '$' || pattern[k] == '%') {
/* got one */
size_t num = pattern[k + 1] - '0';
- end = k;
-
- buffer_append_string_len(p->location, pattern + start, end - start);
+ buffer_append_string_len(p->location, pattern + start, k - start);
if (!isdigit((unsigned char)pattern[k + 1])) {
/* enable escape: "%%" => "%", "%a" => "%a", "$$" => "$" */
diff --git a/src/mod_rewrite.c b/src/mod_rewrite.c
index 6dc5707..c895a34 100644
--- a/src/mod_rewrite.c
+++ b/src/mod_rewrite.c
@@ -1,16 +1,13 @@
-#include <ctype.h>
-#include <stdlib.h>
-#include <string.h>
-
#include "base.h"
#include "log.h"
#include "buffer.h"
#include "plugin.h"
+#include "stat_cache.h"
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
+#include <ctype.h>
+#include <stdlib.h>
+#include <string.h>
typedef struct {
#ifdef HAVE_PCRE_H
@@ -31,7 +28,8 @@ typedef struct {
typedef struct {
rewrite_rule_buffer *rewrite;
- data_config *context; /* to which apply me */
+ rewrite_rule_buffer *rewrite_NF;
+ data_config *context, *context_NF; /* to which apply me */
} plugin_config;
typedef struct {
@@ -161,6 +159,7 @@ FREE_FUNC(mod_rewrite_free) {
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *s = p->config_storage[i];
rewrite_rule_buffer_free(s->rewrite);
+ rewrite_rule_buffer_free(s->rewrite_NF);
free(s);
}
@@ -172,11 +171,11 @@ FREE_FUNC(mod_rewrite_free) {
return HANDLER_GO_ON;
}
-static int parse_config_entry(server *srv, plugin_config *s, array *ca, const char *option, int once) {
+static int parse_config_entry(server *srv, array *ca, rewrite_rule_buffer *kvb, const char *option, int once) {
data_unset *du;
if (NULL != (du = array_get_element(ca, option))) {
- data_array *da = (data_array *)du;
+ data_array *da;
size_t j;
if (du->type != TYPE_ARRAY) {
@@ -198,7 +197,7 @@ static int parse_config_entry(server *srv, plugin_config *s, array *ca, const ch
return HANDLER_ERROR;
}
- if (0 != rewrite_rule_buffer_append(s->rewrite,
+ if (0 != rewrite_rule_buffer_append(kvb,
((data_string *)(da->value->data[j]))->key,
((data_string *)(da->value->data[j]))->value,
once)) {
@@ -224,14 +223,23 @@ SETDEFAULTS_FUNC(mod_rewrite_set_defaults) {
{ "url.rewrite-repeat", NULL, T_CONFIG_LOCAL, T_CONFIG_SCOPE_CONNECTION }, /* 0 */
{ "url.rewrite-once", NULL, T_CONFIG_LOCAL, T_CONFIG_SCOPE_CONNECTION }, /* 1 */
+ /* these functions only rewrite if the target is not already in the filestore
+ *
+ * url.rewrite-repeat-if-not-file is the equivalent of url.rewrite-repeat
+ * url.rewrite-if-not-file is the equivalent of url.rewrite-once
+ *
+ */
+ { "url.rewrite-repeat-if-not-file", NULL, T_CONFIG_LOCAL, T_CONFIG_SCOPE_CONNECTION }, /* 2 */
+ { "url.rewrite-if-not-file", NULL, T_CONFIG_LOCAL, T_CONFIG_SCOPE_CONNECTION }, /* 3 */
+
/* old names, still supported
*
* url.rewrite remapped to url.rewrite-once
* url.rewrite-final is url.rewrite-once
*
*/
- { "url.rewrite", NULL, T_CONFIG_LOCAL, T_CONFIG_SCOPE_CONNECTION }, /* 2 */
- { "url.rewrite-final", NULL, T_CONFIG_LOCAL, T_CONFIG_SCOPE_CONNECTION }, /* 3 */
+ { "url.rewrite", NULL, T_CONFIG_LOCAL, T_CONFIG_SCOPE_CONNECTION }, /* 4 */
+ { "url.rewrite-final", NULL, T_CONFIG_LOCAL, T_CONFIG_SCOPE_CONNECTION }, /* 5 */
{ NULL, NULL, T_CONFIG_UNSET, T_CONFIG_SCOPE_UNSET }
};
@@ -245,11 +253,15 @@ SETDEFAULTS_FUNC(mod_rewrite_set_defaults) {
array *ca;
s = calloc(1, sizeof(plugin_config));
- s->rewrite = rewrite_rule_buffer_init();
+ s->rewrite = rewrite_rule_buffer_init();
+ s->rewrite_NF = rewrite_rule_buffer_init();
cv[0].destination = s->rewrite;
cv[1].destination = s->rewrite;
- cv[2].destination = s->rewrite;
+ cv[2].destination = s->rewrite_NF;
+ cv[3].destination = s->rewrite_NF;
+ cv[4].destination = s->rewrite;
+ cv[5].destination = s->rewrite;
p->config_storage[i] = s;
ca = ((data_config *)srv->config_context->data[i])->value;
@@ -258,21 +270,27 @@ SETDEFAULTS_FUNC(mod_rewrite_set_defaults) {
return HANDLER_ERROR;
}
- parse_config_entry(srv, s, ca, "url.rewrite-once", 1);
- parse_config_entry(srv, s, ca, "url.rewrite-final", 1);
- parse_config_entry(srv, s, ca, "url.rewrite", 1);
- parse_config_entry(srv, s, ca, "url.rewrite-repeat", 0);
+ parse_config_entry(srv, ca, s->rewrite, "url.rewrite-once", 1);
+ parse_config_entry(srv, ca, s->rewrite, "url.rewrite-final", 1);
+ parse_config_entry(srv, ca, s->rewrite_NF, "url.rewrite-if-not-file", 1);
+ parse_config_entry(srv, ca, s->rewrite_NF, "url.rewrite-repeat-if-not-file", 0);
+ parse_config_entry(srv, ca, s->rewrite, "url.rewrite", 1);
+ parse_config_entry(srv, ca, s->rewrite, "url.rewrite-repeat", 0);
}
return HANDLER_GO_ON;
}
#ifdef HAVE_PCRE_H
+#define PATCH(x) \
+ p->conf.x = s->x;
static int mod_rewrite_patch_connection(server *srv, connection *con, plugin_data *p) {
size_t i, j;
plugin_config *s = p->config_storage[0];
- p->conf.rewrite = s->rewrite;
+ PATCH(rewrite);
+ PATCH(rewrite_NF);
p->conf.context = NULL;
+ p->conf.context_NF = NULL;
/* skip the first, the global context */
for (i = 1; i < srv->config_context->used; i++) {
@@ -289,16 +307,22 @@ static int mod_rewrite_patch_connection(server *srv, connection *con, plugin_dat
data_unset *du = dc->value->data[j];
if (buffer_is_equal_string(du->key, CONST_STR_LEN("url.rewrite"))) {
- p->conf.rewrite = s->rewrite;
+ PATCH(rewrite);
p->conf.context = dc;
} else if (buffer_is_equal_string(du->key, CONST_STR_LEN("url.rewrite-once"))) {
- p->conf.rewrite = s->rewrite;
+ PATCH(rewrite);
p->conf.context = dc;
} else if (buffer_is_equal_string(du->key, CONST_STR_LEN("url.rewrite-repeat"))) {
- p->conf.rewrite = s->rewrite;
+ PATCH(rewrite);
p->conf.context = dc;
+ } else if (buffer_is_equal_string(du->key, CONST_STR_LEN("url.rewrite-if-not-file"))) {
+ PATCH(rewrite_NF);
+ p->conf.context_NF = dc;
+ } else if (buffer_is_equal_string(du->key, CONST_STR_LEN("url.rewrite-repeat-if-not-file"))) {
+ PATCH(rewrite_NF);
+ p->conf.context_NF = dc;
} else if (buffer_is_equal_string(du->key, CONST_STR_LEN("url.rewrite-final"))) {
- p->conf.rewrite = s->rewrite;
+ PATCH(rewrite);
p->conf.context = dc;
}
}
@@ -320,19 +344,11 @@ URIHANDLER_FUNC(mod_rewrite_con_reset) {
return HANDLER_GO_ON;
}
-URIHANDLER_FUNC(mod_rewrite_uri_handler) {
+static int process_rewrite_rules(server *srv, connection *con, plugin_data *p, rewrite_rule_buffer *kvb) {
#ifdef HAVE_PCRE_H
- plugin_data *p = p_d;
size_t i;
handler_ctx *hctx;
- /*
- * REWRITE URL
- *
- * e.g. rewrite /base/ to /index.php?section=base
- *
- */
-
if (con->plugin_ctx[p->id]) {
hctx = con->plugin_ctx[p->id];
@@ -346,18 +362,14 @@ URIHANDLER_FUNC(mod_rewrite_uri_handler) {
if (hctx->state == REWRITE_STATE_FINISHED) return HANDLER_GO_ON;
}
- mod_rewrite_patch_connection(srv, con, p);
-
- if (!p->conf.rewrite) return HANDLER_GO_ON;
-
buffer_copy_string_buffer(p->match_buf, con->request.uri);
- for (i = 0; i < p->conf.rewrite->used; i++) {
+ for (i = 0; i < kvb->used; i++) {
pcre *match;
const char *pattern;
size_t pattern_len;
int n;
- rewrite_rule *rule = p->conf.rewrite->ptr[i];
+ rewrite_rule *rule = kvb->ptr[i];
# define N 10
int ovec[N * 3];
@@ -373,7 +385,7 @@ URIHANDLER_FUNC(mod_rewrite_uri_handler) {
}
} else {
const char **list;
- size_t start, end;
+ size_t start;
size_t k;
/* it matched */
@@ -383,16 +395,14 @@ URIHANDLER_FUNC(mod_rewrite_uri_handler) {
buffer_reset(con->request.uri);
- start = 0; end = pattern_len;
+ start = 0;
for (k = 0; k < pattern_len; k++) {
if (pattern[k] == '$' || pattern[k] == '%') {
/* got one */
size_t num = pattern[k + 1] - '0';
- end = k;
-
- buffer_append_string_len(con->request.uri, pattern + start, end - start);
+ buffer_append_string_len(con->request.uri, pattern + start, k - start);
if (!isdigit((unsigned char)pattern[k + 1])) {
/* enable escape: "%%" => "%", "%a" => "%a", "$$" => "$" */
@@ -432,9 +442,62 @@ URIHANDLER_FUNC(mod_rewrite_uri_handler) {
return HANDLER_COMEBACK;
}
- }
#undef N
+ }
+#else
+ UNUSED(srv);
+ UNUSED(con);
+ UNUSED(p);
+ UNUSED(hctx);
+ UNUSED(kvb);
+#endif
+
+ return HANDLER_GO_ON;
+}
+
+URIHANDLER_FUNC(mod_rewrite_physical) {
+#ifdef HAVE_PCRE_H
+ plugin_data *p = p_d;
+ handler_t r;
+ stat_cache_entry *sce;
+
+ if (con->mode != DIRECT) return HANDLER_GO_ON;
+
+ mod_rewrite_patch_connection(srv, con, p);
+ p->conf.context = p->conf.context_NF;
+
+ if (!p->conf.rewrite_NF) return HANDLER_GO_ON;
+
+ /* skip if physical.path is a regular file */
+ sce = NULL;
+ if (HANDLER_ERROR != stat_cache_get_entry(srv, con, con->physical.path, &sce)) {
+ if (S_ISREG(sce->st.st_mode)) return HANDLER_GO_ON;
+ }
+
+ switch(r = process_rewrite_rules(srv, con, p, p->conf.rewrite_NF)) {
+ case HANDLER_COMEBACK:
+ buffer_reset(con->physical.path);
+ default:
+ return r;
+ }
+#else
+ UNUSED(srv);
+ UNUSED(con);
+ UNUSED(p_d);
+#endif
+
+ return HANDLER_GO_ON;
+}
+
+URIHANDLER_FUNC(mod_rewrite_uri_handler) {
+#ifdef HAVE_PCRE_H
+ plugin_data *p = p_d;
+
+ mod_rewrite_patch_connection(srv, con, p);
+
+ if (!p->conf.rewrite) return HANDLER_GO_ON;
+ return process_rewrite_rules(srv, con, p, p->conf.rewrite);
#else
UNUSED(srv);
UNUSED(con);
@@ -454,6 +517,7 @@ int mod_rewrite_plugin_init(plugin *p) {
*/
p->handle_uri_raw = mod_rewrite_uri_handler;
+ p->handle_physical = mod_rewrite_physical;
p->set_defaults = mod_rewrite_set_defaults;
p->cleanup = mod_rewrite_free;
p->connection_reset = mod_rewrite_con_reset;
diff --git a/src/mod_rrdtool.c b/src/mod_rrdtool.c
index 41095d3..9ebc201 100644
--- a/src/mod_rrdtool.c
+++ b/src/mod_rrdtool.c
@@ -1,4 +1,10 @@
-#define _GNU_SOURCE
+#include "server.h"
+#include "connections.h"
+#include "response.h"
+#include "connections.h"
+#include "log.h"
+
+#include "plugin.h"
#include <sys/types.h>
#include <fcntl.h>
@@ -9,13 +15,6 @@
#include <errno.h>
#include <time.h>
-#include "server.h"
-#include "connections.h"
-#include "response.h"
-#include "connections.h"
-#include "log.h"
-
-#include "plugin.h"
#ifdef HAVE_FORK
/* no need for waitpid if we don't have fork */
#include <sys/wait.h>
@@ -139,9 +138,7 @@ static int mod_rrd_create_pipe(server *srv, plugin_data *p) {
args[i++] = p->conf.path_rrdtool_bin->ptr;
args[i++] = dash;
- args[i++] = NULL;
-
- openDevNull(STDERR_FILENO);
+ args[i ] = NULL;
/* we don't need the client socket */
for (i = 3; i < 256; i++) {
@@ -268,7 +265,7 @@ static int mod_rrdtool_create_rrd(server *srv, plugin_data *p, plugin_config *s)
"RRA:MIN:0.5:24:775 "
"RRA:MIN:0.5:288:797\n"));
- if (-1 == (r = safe_write(p->write_fd, p->cmd->ptr, p->cmd->used - 1))) {
+ if (-1 == (safe_write(p->write_fd, p->cmd->ptr, p->cmd->used - 1))) {
log_error_write(srv, __FILE__, __LINE__, "ss",
"rrdtool-write: failed", strerror(errno));
diff --git a/src/mod_scgi.c b/src/mod_scgi.c
index e92a516..3702bd2 100644
--- a/src/mod_scgi.c
+++ b/src/mod_scgi.c
@@ -1,13 +1,3 @@
-#include <sys/types.h>
-#include <unistd.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <string.h>
-#include <stdlib.h>
-#include <ctype.h>
-#include <assert.h>
-#include <signal.h>
-
#include "buffer.h"
#include "server.h"
#include "keyvalue.h"
@@ -23,6 +13,16 @@
#include "inet_ntop_cache.h"
+#include <sys/types.h>
+#include <unistd.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <string.h>
+#include <stdlib.h>
+#include <ctype.h>
+#include <assert.h>
+#include <signal.h>
+
#include <stdio.h>
#ifdef HAVE_SYS_FILIO_H
@@ -32,10 +32,11 @@
#include "sys-socket.h"
#ifdef HAVE_SYS_UIO_H
-#include <sys/uio.h>
+# include <sys/uio.h>
#endif
+
#ifdef HAVE_SYS_WAIT_H
-#include <sys/wait.h>
+# include <sys/wait.h>
#endif
#include "version.h"
@@ -331,7 +332,20 @@ static handler_t scgi_handle_fdevent(void *s, void *ctx, int revents);
int scgi_proclist_sort_down(server *srv, scgi_extension_host *host, scgi_proc *proc);
-
+static void reset_signals(void) {
+#ifdef SIGTTOU
+ signal(SIGTTOU, SIG_DFL);
+#endif
+#ifdef SIGTTIN
+ signal(SIGTTIN, SIG_DFL);
+#endif
+#ifdef SIGTSTP
+ signal(SIGTSTP, SIG_DFL);
+#endif
+ signal(SIGHUP, SIG_DFL);
+ signal(SIGPIPE, SIG_DFL);
+ signal(SIGUSR1, SIG_DFL);
+}
static handler_ctx * handler_ctx_init() {
handler_ctx * hctx;
@@ -772,10 +786,8 @@ static int scgi_spawn_connection(server *srv,
env.used = 0;
if (scgi_fd != 0) {
- close(0);
dup2(scgi_fd, 0);
close(scgi_fd);
- scgi_fd = 0;
}
/* we don't need the client socket */
@@ -783,8 +795,6 @@ static int scgi_spawn_connection(server *srv,
close(fd);
}
- openDevNull(STDERR_FILENO);
-
/* build clean environment */
if (host->bin_env_copy->used) {
for (i = 0; i < host->bin_env_copy->used; i++) {
@@ -828,6 +838,8 @@ static int scgi_spawn_connection(server *srv,
buffer_copy_string_len(b, CONST_STR_LEN("exec "));
buffer_append_string_buffer(b, host->bin_path);
+ reset_signals();
+
/* exec the cgi */
execle("/bin/sh", "sh", "-c", b->ptr, (char *)NULL, env.ptr);
@@ -2163,8 +2175,11 @@ static handler_t scgi_write_request(server *srv, handler_ctx *hctx) {
int ret;
/* sanity check */
- if (!host ||
- ((!host->host->used || !host->port) && !host->unixsocket->used)) {
+ if (!host) {
+ log_error_write(srv, __FILE__, __LINE__, "s", "fatal error: host = NULL");
+ return HANDLER_ERROR;
+ }
+ if (((!host->host->used || !host->port) && !host->unixsocket->used)) {
log_error_write(srv, __FILE__, __LINE__, "sxddd",
"write-req: error",
host,
@@ -2299,8 +2314,8 @@ static handler_t scgi_write_request(server *srv, handler_ctx *hctx) {
chunkqueue_remove_finished_chunks(hctx->wb);
- if (-1 == ret) {
- if (errno == ENOTCONN) {
+ if (ret < 0) {
+ if (errno == ENOTCONN || ret == -2) {
/* the connection got dropped after accept()
*
* this is most of the time a PHP which dies
@@ -2325,24 +2340,17 @@ static handler_t scgi_write_request(server *srv, handler_ctx *hctx) {
*/
log_error_write(srv, __FILE__, __LINE__, "ssosd",
- "[REPORT ME] connection was dropped after accept(). reconnect() denied:",
+ "connection was dropped after accept(). reconnect() denied:",
"write-offset:", hctx->wb->bytes_out,
"reconnect attempts:", hctx->reconnects);
return HANDLER_ERROR;
- }
-
- if ((errno != EAGAIN) &&
- (errno != EINTR)) {
-
+ } else {
+ /* -1 == ret => error on our side */
log_error_write(srv, __FILE__, __LINE__, "ssd",
- "write failed:", strerror(errno), errno);
+ "write failed:", strerror(errno), errno);
return HANDLER_ERROR;
- } else {
- fdevent_event_add(srv->ev, &(hctx->fde_ndx), hctx->fd, FDEVENT_OUT);
-
- return HANDLER_WAIT_FOR_EVENT;
}
}
@@ -2469,12 +2477,10 @@ SUBREQUEST_FUNC(mod_scgi_handle_subrequest) {
}
static handler_t scgi_connection_close(server *srv, handler_ctx *hctx) {
- plugin_data *p;
connection *con;
if (NULL == hctx) return HANDLER_GO_ON;
- p = hctx->plugin_data;
con = hctx->remote_conn;
log_error_write(srv, __FILE__, __LINE__, "ssdsd",
@@ -2724,27 +2730,29 @@ static handler_t scgi_check_extension(server *srv, connection *con, void *p_d, i
/* check if extension matches */
for (k = 0; k < p->conf.exts->used; k++) {
size_t ct_len;
+ scgi_extension *ext = p->conf.exts->exts[k];
- extension = p->conf.exts->exts[k];
+ if (ext->key->used == 0) continue;
- if (extension->key->used == 0) continue;
-
- ct_len = extension->key->used - 1;
+ ct_len = ext->key->used - 1;
if (s_len < ct_len) continue;
/* check extension in the form "/scgi_pattern" */
- if (*(extension->key->ptr) == '/') {
- if (strncmp(fn->ptr, extension->key->ptr, ct_len) == 0)
+ if (*(ext->key->ptr) == '/') {
+ if (strncmp(fn->ptr, ext->key->ptr, ct_len) == 0) {
+ extension = ext;
break;
- } else if (0 == strncmp(fn->ptr + s_len - ct_len, extension->key->ptr, ct_len)) {
+ }
+ } else if (0 == strncmp(fn->ptr + s_len - ct_len, ext->key->ptr, ct_len)) {
/* check extension in the form ".fcg" */
+ extension = ext;
break;
}
}
/* extension doesn't match */
- if (k == p->conf.exts->used) {
+ if (NULL == extension) {
return HANDLER_GO_ON;
}
diff --git a/src/mod_secure_download.c b/src/mod_secure_download.c
index ca1f13e..67013c3 100644
--- a/src/mod_secure_download.c
+++ b/src/mod_secure_download.c
@@ -1,16 +1,12 @@
-#include <ctype.h>
-#include <stdlib.h>
-#include <string.h>
-
#include "base.h"
#include "log.h"
#include "buffer.h"
#include "plugin.h"
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
+#include <ctype.h>
+#include <stdlib.h>
+#include <string.h>
#ifdef USE_OPENSSL
# include <openssl/md5.h>
@@ -37,7 +33,7 @@ typedef struct {
buffer *secret;
buffer *uri_prefix;
- unsigned short timeout;
+ unsigned int timeout;
} plugin_config;
typedef struct {
@@ -99,7 +95,7 @@ SETDEFAULTS_FUNC(mod_secdownload_set_defaults) {
{ "secdownload.secret", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 0 */
{ "secdownload.document-root", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 1 */
{ "secdownload.uri-prefix", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 2 */
- { "secdownload.timeout", NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION }, /* 3 */
+ { "secdownload.timeout", NULL, T_CONFIG_INT, T_CONFIG_SCOPE_CONNECTION }, /* 3 */
{ NULL, NULL, T_CONFIG_UNSET, T_CONFIG_SCOPE_UNSET }
};
@@ -245,8 +241,8 @@ URIHANDLER_FUNC(mod_secdownload_uri_handler) {
}
/* timed-out */
- if ( (srv->cur_ts > ts && srv->cur_ts - ts > p->conf.timeout) ||
- (srv->cur_ts < ts && ts - srv->cur_ts > p->conf.timeout) ) {
+ if ( (srv->cur_ts > ts && (unsigned int) (srv->cur_ts - ts) > p->conf.timeout) ||
+ (srv->cur_ts < ts && (unsigned int) (ts - srv->cur_ts) > p->conf.timeout) ) {
/* "Gone" as the url will never be valid again instead of "408 - Timeout" where the request may be repeated */
con->http_status = 410;
diff --git a/src/mod_setenv.c b/src/mod_setenv.c
index a072466..4419b61 100644
--- a/src/mod_setenv.c
+++ b/src/mod_setenv.c
@@ -1,6 +1,3 @@
-#include <stdlib.h>
-#include <string.h>
-
#include "base.h"
#include "log.h"
#include "buffer.h"
@@ -9,6 +6,9 @@
#include "response.h"
+#include <stdlib.h>
+#include <string.h>
+
/* plugin config for all request/connections */
typedef struct {
@@ -215,7 +215,7 @@ URIHANDLER_FUNC(mod_setenv_uri_handler) {
return HANDLER_GO_ON;
}
-REQUESTDONE_FUNC(mod_setenv_reset) {
+CONNECTION_FUNC(mod_setenv_reset) {
plugin_data *p = p_d;
UNUSED(srv);
@@ -240,7 +240,7 @@ int mod_setenv_plugin_init(plugin *p) {
p->set_defaults = mod_setenv_set_defaults;
p->cleanup = mod_setenv_free;
- p->handle_request_done = mod_setenv_reset;
+ p->connection_reset = mod_setenv_reset;
p->data = NULL;
diff --git a/src/mod_simple_vhost.c b/src/mod_simple_vhost.c
index 21d0107..bbb61d5 100644
--- a/src/mod_simple_vhost.c
+++ b/src/mod_simple_vhost.c
@@ -1,8 +1,3 @@
-#include <ctype.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-
#include "base.h"
#include "log.h"
#include "buffer.h"
@@ -10,9 +5,10 @@
#include "plugin.h"
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
+#include <ctype.h>
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
typedef struct {
buffer *server_root;
diff --git a/src/mod_skeleton.c b/src/mod_skeleton.c
index 0ce833f..66de2b1 100644
--- a/src/mod_skeleton.c
+++ b/src/mod_skeleton.c
@@ -1,16 +1,12 @@
-#include <ctype.h>
-#include <stdlib.h>
-#include <string.h>
-
#include "base.h"
#include "log.h"
#include "buffer.h"
#include "plugin.h"
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
+#include <ctype.h>
+#include <stdlib.h>
+#include <string.h>
/**
* this is a skeleton for a lighttpd plugin
diff --git a/src/mod_ssi.c b/src/mod_ssi.c
index 07554bc..897f49e 100644
--- a/src/mod_ssi.c
+++ b/src/mod_ssi.c
@@ -1,13 +1,3 @@
-#include <sys/types.h>
-
-#include <ctype.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <errno.h>
-#include <time.h>
-#include <unistd.h>
-
#include "base.h"
#include "log.h"
#include "buffer.h"
@@ -24,16 +14,26 @@
#include "sys-socket.h"
+#include <sys/types.h>
+
+#include <ctype.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+#include <time.h>
+#include <unistd.h>
+
#ifdef HAVE_PWD_H
-#include <pwd.h>
+# include <pwd.h>
#endif
#ifdef HAVE_FORK
-#include <sys/wait.h>
+# include <sys/wait.h>
#endif
#ifdef HAVE_SYS_FILIO_H
-#include <sys/filio.h>
+# include <sys/filio.h>
#endif
#include "etag.h"
@@ -362,7 +362,8 @@ static int process_ssi_stmt(server *srv, connection *con, plugin_data *p,
switch(ssicmd) {
case SSI_ECHO: {
/* echo */
- int var = 0, enc = 0;
+ int var = 0;
+ /* int enc = 0; */
const char *var_val = NULL;
stat_cache_entry *sce = NULL;
@@ -381,6 +382,7 @@ static int process_ssi_stmt(server *srv, connection *con, plugin_data *p,
{ NULL, SSI_ECHO_UNSET }
};
+/*
struct {
const char *var;
enum { SSI_ENC_UNSET, SSI_ENC_URL, SSI_ENC_NONE, SSI_ENC_ENTITY } type;
@@ -391,6 +393,7 @@ static int process_ssi_stmt(server *srv, connection *con, plugin_data *p,
{ NULL, SSI_ENC_UNSET }
};
+*/
for (i = 2; i < n; i += 2) {
if (0 == strcmp(l[i], "var")) {
@@ -405,6 +408,7 @@ static int process_ssi_stmt(server *srv, connection *con, plugin_data *p,
}
}
} else if (0 == strcmp(l[i], "encoding")) {
+/*
int j;
for (j = 0; encvars[j].var; j++) {
@@ -413,6 +417,7 @@ static int process_ssi_stmt(server *srv, connection *con, plugin_data *p,
break;
}
}
+*/
} else {
log_error_write(srv, __FILE__, __LINE__, "sss",
"ssi: unknow attribute for ",
diff --git a/src/mod_ssi_expr.c b/src/mod_ssi_expr.c
index b560f79..c5d8581 100644
--- a/src/mod_ssi_expr.c
+++ b/src/mod_ssi_expr.c
@@ -1,12 +1,12 @@
-#include <ctype.h>
-#include <string.h>
-
#include "buffer.h"
#include "log.h"
#include "mod_ssi.h"
#include "mod_ssi_expr.h"
#include "mod_ssi_exprparser.h"
+#include <ctype.h>
+#include <string.h>
+
typedef struct {
const char *input;
size_t offset;
diff --git a/src/mod_ssi_exprparser.c b/src/mod_ssi_exprparser.c
index 676c274..6a0373d 100644
--- a/src/mod_ssi_exprparser.c
+++ b/src/mod_ssi_exprparser.c
@@ -6,15 +6,13 @@
#include <stdio.h>
#line 6 "../../src/mod_ssi_exprparser.y"
-#include <assert.h>
-#include <string.h>
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
#include "mod_ssi_expr.h"
#include "buffer.h"
-#line 18 "mod_ssi_exprparser.c"
+#include <assert.h>
+#include <string.h>
+
+#line 16 "mod_ssi_exprparser.c"
/* Next is all token values, in a form suitable for use by makeheaders.
** This section will be null unless lemon is run with the -m switch.
*/
@@ -349,9 +347,9 @@ static void yy_destructor(YYCODETYPE yymajor, YYMINORTYPE *yypminor){
case 10:
case 11:
case 12:
-#line 24 "../../src/mod_ssi_exprparser.y"
+#line 22 "../../src/mod_ssi_exprparser.y"
{ buffer_free((yypminor->yy0)); }
-#line 354 "mod_ssi_exprparser.c"
+#line 352 "mod_ssi_exprparser.c"
break;
default: break; /* If no destructor action specified: do nothing */
}
@@ -580,17 +578,17 @@ static void yy_reduce(
** break;
*/
case 0:
-#line 31 "../../src/mod_ssi_exprparser.y"
+#line 29 "../../src/mod_ssi_exprparser.y"
{
ctx->val.bo = ssi_val_tobool(yymsp[0].minor.yy29);
ctx->val.type = SSI_TYPE_BOOL;
ssi_val_free(yymsp[0].minor.yy29);
}
-#line 590 "mod_ssi_exprparser.c"
+#line 588 "mod_ssi_exprparser.c"
break;
case 1:
-#line 38 "../../src/mod_ssi_exprparser.y"
+#line 36 "../../src/mod_ssi_exprparser.y"
{
int cmp;
@@ -616,17 +614,17 @@ static void yy_reduce(
ssi_val_free(yymsp[0].minor.yy29);
}
-#line 619 "mod_ssi_exprparser.c"
+#line 617 "mod_ssi_exprparser.c"
break;
case 2:
-#line 63 "../../src/mod_ssi_exprparser.y"
+#line 61 "../../src/mod_ssi_exprparser.y"
{
yygotominor.yy29 = yymsp[0].minor.yy29;
}
-#line 626 "mod_ssi_exprparser.c"
+#line 624 "mod_ssi_exprparser.c"
break;
case 3:
-#line 66 "../../src/mod_ssi_exprparser.y"
+#line 64 "../../src/mod_ssi_exprparser.y"
{
int e;
@@ -637,11 +635,11 @@ static void yy_reduce(
yygotominor.yy29->type = SSI_TYPE_BOOL;
ssi_val_free(yymsp[0].minor.yy29);
}
-#line 640 "mod_ssi_exprparser.c"
+#line 638 "mod_ssi_exprparser.c"
yy_destructor(1,&yymsp[-1].minor);
break;
case 4:
-#line 77 "../../src/mod_ssi_exprparser.y"
+#line 75 "../../src/mod_ssi_exprparser.y"
{
int e;
@@ -652,11 +650,11 @@ static void yy_reduce(
yygotominor.yy29->type = SSI_TYPE_BOOL;
ssi_val_free(yymsp[0].minor.yy29);
}
-#line 655 "mod_ssi_exprparser.c"
+#line 653 "mod_ssi_exprparser.c"
yy_destructor(2,&yymsp[-1].minor);
break;
case 5:
-#line 88 "../../src/mod_ssi_exprparser.y"
+#line 86 "../../src/mod_ssi_exprparser.y"
{
int e;
@@ -666,77 +664,77 @@ static void yy_reduce(
yygotominor.yy29->bo = e;
yygotominor.yy29->type = SSI_TYPE_BOOL;
}
-#line 669 "mod_ssi_exprparser.c"
+#line 667 "mod_ssi_exprparser.c"
yy_destructor(9,&yymsp[-1].minor);
break;
case 6:
-#line 97 "../../src/mod_ssi_exprparser.y"
+#line 95 "../../src/mod_ssi_exprparser.y"
{
yygotominor.yy29 = yymsp[-1].minor.yy29;
}
-#line 677 "mod_ssi_exprparser.c"
+#line 675 "mod_ssi_exprparser.c"
yy_destructor(10,&yymsp[-2].minor);
yy_destructor(11,&yymsp[0].minor);
break;
case 7:
-#line 101 "../../src/mod_ssi_exprparser.y"
+#line 99 "../../src/mod_ssi_exprparser.y"
{
yygotominor.yy29 = ssi_val_init();
yygotominor.yy29->str = yymsp[0].minor.yy19;
yygotominor.yy29->type = SSI_TYPE_STRING;
}
-#line 688 "mod_ssi_exprparser.c"
+#line 686 "mod_ssi_exprparser.c"
break;
case 8:
-#line 107 "../../src/mod_ssi_exprparser.y"
+#line 105 "../../src/mod_ssi_exprparser.y"
{
yygotominor.yy19 = yymsp[0].minor.yy0;
}
-#line 695 "mod_ssi_exprparser.c"
+#line 693 "mod_ssi_exprparser.c"
break;
case 9:
-#line 111 "../../src/mod_ssi_exprparser.y"
+#line 109 "../../src/mod_ssi_exprparser.y"
{
yygotominor.yy19 = yymsp[-1].minor.yy19;
buffer_append_string_buffer(yygotominor.yy19, yymsp[0].minor.yy0);
buffer_free(yymsp[0].minor.yy0);
}
-#line 704 "mod_ssi_exprparser.c"
+#line 702 "mod_ssi_exprparser.c"
break;
case 10:
-#line 117 "../../src/mod_ssi_exprparser.y"
+#line 115 "../../src/mod_ssi_exprparser.y"
{ yygotominor.yy8 = SSI_COND_EQ; }
-#line 709 "mod_ssi_exprparser.c"
+#line 707 "mod_ssi_exprparser.c"
yy_destructor(3,&yymsp[0].minor);
break;
case 11:
-#line 118 "../../src/mod_ssi_exprparser.y"
+#line 116 "../../src/mod_ssi_exprparser.y"
{ yygotominor.yy8 = SSI_COND_NE; }
-#line 715 "mod_ssi_exprparser.c"
+#line 713 "mod_ssi_exprparser.c"
yy_destructor(4,&yymsp[0].minor);
break;
case 12:
-#line 119 "../../src/mod_ssi_exprparser.y"
+#line 117 "../../src/mod_ssi_exprparser.y"
{ yygotominor.yy8 = SSI_COND_LE; }
-#line 721 "mod_ssi_exprparser.c"
+#line 719 "mod_ssi_exprparser.c"
yy_destructor(8,&yymsp[0].minor);
break;
case 13:
-#line 120 "../../src/mod_ssi_exprparser.y"
+#line 118 "../../src/mod_ssi_exprparser.y"
{ yygotominor.yy8 = SSI_COND_GE; }
-#line 727 "mod_ssi_exprparser.c"
+#line 725 "mod_ssi_exprparser.c"
yy_destructor(6,&yymsp[0].minor);
break;
case 14:
-#line 121 "../../src/mod_ssi_exprparser.y"
+#line 119 "../../src/mod_ssi_exprparser.y"
{ yygotominor.yy8 = SSI_COND_LT; }
-#line 733 "mod_ssi_exprparser.c"
+#line 731 "mod_ssi_exprparser.c"
yy_destructor(7,&yymsp[0].minor);
break;
case 15:
-#line 122 "../../src/mod_ssi_exprparser.y"
+#line 120 "../../src/mod_ssi_exprparser.y"
{ yygotominor.yy8 = SSI_COND_GT; }
-#line 739 "mod_ssi_exprparser.c"
+#line 737 "mod_ssi_exprparser.c"
yy_destructor(5,&yymsp[0].minor);
break;
};
@@ -766,11 +764,11 @@ static void yy_parse_failed(
while( yypParser->yyidx>=0 ) yy_pop_parser_stack(yypParser);
/* Here code is inserted which will be executed whenever the
** parser fails */
-#line 16 "../../src/mod_ssi_exprparser.y"
+#line 14 "../../src/mod_ssi_exprparser.y"
ctx->ok = 0;
-#line 773 "mod_ssi_exprparser.c"
+#line 771 "mod_ssi_exprparser.c"
ssiexprparserARG_STORE; /* Suppress warning about unused %extra_argument variable */
}
diff --git a/src/mod_ssi_exprparser.y b/src/mod_ssi_exprparser.y
index f3d4a57..f4aaa96 100644
--- a/src/mod_ssi_exprparser.y
+++ b/src/mod_ssi_exprparser.y
@@ -4,13 +4,11 @@
%name ssiexprparser
%include {
-#include <assert.h>
-#include <string.h>
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
#include "mod_ssi_expr.h"
#include "buffer.h"
+
+#include <assert.h>
+#include <string.h>
}
%parse_failure {
diff --git a/src/mod_staticfile.c b/src/mod_staticfile.c
index df19d67..41dc6a2 100644
--- a/src/mod_staticfile.c
+++ b/src/mod_staticfile.c
@@ -1,8 +1,3 @@
-#include <ctype.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-
#include "base.h"
#include "log.h"
#include "buffer.h"
@@ -14,6 +9,11 @@
#include "http_chunk.h"
#include "response.h"
+#include <ctype.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
/**
* this is a staticfile for a lighttpd plugin
*
diff --git a/src/mod_status.c b/src/mod_status.c
index 7548276..df5bdb8 100644
--- a/src/mod_status.c
+++ b/src/mod_status.c
@@ -1,4 +1,13 @@
-#define _GNU_SOURCE
+#include "server.h"
+#include "connections.h"
+#include "response.h"
+#include "connections.h"
+#include "log.h"
+
+#include "plugin.h"
+
+#include "inet_ntop_cache.h"
+
#include <sys/types.h>
#include <fcntl.h>
@@ -9,15 +18,6 @@
#include <time.h>
#include <stdio.h>
-#include "server.h"
-#include "connections.h"
-#include "response.h"
-#include "connections.h"
-#include "log.h"
-
-#include "plugin.h"
-
-#include "inet_ntop_cache.h"
#include "version.h"
typedef struct {
@@ -438,7 +438,7 @@ static handler_t mod_status_handle_server_status_html(server *srv, connection *c
buffer_append_string_len(b, CONST_STR_LEN(
"<hr />\n<pre><b>legend</b>\n"
- ". = connect, C = close, E = hard error\n"
+ ". = connect, C = close, E = hard error, k = keep-alive\n"
"r = read, R = read-POST, W = write, h = handle-request\n"
"q = request-start, Q = request-end\n"
"s = response-start, S = response-end\n"));
@@ -449,7 +449,13 @@ static handler_t mod_status_handle_server_status_html(server *srv, connection *c
for (j = 0; j < srv->conns->used; j++) {
connection *c = srv->conns->ptr[j];
- const char *state = connection_get_short_state(c->state);
+ const char *state;
+
+ if (CON_STATE_READ == c->state && c->request.orig_uri->used > 0) {
+ state = "k";
+ } else {
+ state = connection_get_short_state(c->state);
+ }
buffer_append_string_len(b, state, 1);
@@ -497,7 +503,11 @@ static handler_t mod_status_handle_server_status_html(server *srv, connection *c
buffer_append_string_len(b, CONST_STR_LEN("</td><td class=\"string\">"));
- buffer_append_string(b, connection_get_state(c->state));
+ if (CON_STATE_READ == c->state && c->request.orig_uri->used > 0) {
+ buffer_append_string_len(b, CONST_STR_LEN("keep-alive"));
+ } else {
+ buffer_append_string(b, connection_get_state(c->state));
+ }
buffer_append_string_len(b, CONST_STR_LEN("</td><td class=\"int\">"));
@@ -611,10 +621,10 @@ static handler_t mod_status_handle_server_status_text(server *srv, connection *c
}
static handler_t mod_status_handle_server_statistics(server *srv, connection *con, void *p_d) {
- plugin_data *p = p_d;
- buffer *b = p->module_list;
+ buffer *b;
size_t i;
array *st = srv->status;
+ UNUSED(p_d);
if (0 == st->used) {
/* we have nothing to send */
diff --git a/src/mod_trigger_b4_dl.c b/src/mod_trigger_b4_dl.c
index 44f5db6..f813413 100644
--- a/src/mod_trigger_b4_dl.c
+++ b/src/mod_trigger_b4_dl.c
@@ -1,8 +1,3 @@
-#include <ctype.h>
-#include <stdlib.h>
-#include <fcntl.h>
-#include <string.h>
-
#include "base.h"
#include "log.h"
#include "buffer.h"
@@ -11,16 +6,21 @@
#include "response.h"
#include "inet_ntop_cache.h"
+#include <ctype.h>
+#include <stdlib.h>
+#include <fcntl.h>
+#include <string.h>
+
#if defined(HAVE_GDBM_H)
-#include <gdbm.h>
+# include <gdbm.h>
#endif
#if defined(HAVE_PCRE_H)
-#include <pcre.h>
+# include <pcre.h>
#endif
#if defined(HAVE_MEMCACHE_H)
-#include <memcache.h>
+# include <memcache.h>
#endif
/**
diff --git a/src/mod_userdir.c b/src/mod_userdir.c
index ebdabc7..f0fc005 100644
--- a/src/mod_userdir.c
+++ b/src/mod_userdir.c
@@ -1,8 +1,3 @@
-#include <sys/types.h>
-
-#include <stdlib.h>
-#include <string.h>
-
#include "base.h"
#include "log.h"
#include "buffer.h"
@@ -11,8 +6,13 @@
#include "plugin.h"
+#include <sys/types.h>
+
+#include <stdlib.h>
+#include <string.h>
+
#ifdef HAVE_PWD_H
-#include <pwd.h>
+# include <pwd.h>
#endif
/* plugin config for all request/connections */
diff --git a/src/mod_usertrack.c b/src/mod_usertrack.c
index 246bb98..cbdf1b0 100644
--- a/src/mod_usertrack.c
+++ b/src/mod_usertrack.c
@@ -1,13 +1,13 @@
-#include <ctype.h>
-#include <stdlib.h>
-#include <string.h>
-
#include "base.h"
#include "log.h"
#include "buffer.h"
#include "plugin.h"
+#include <ctype.h>
+#include <stdlib.h>
+#include <string.h>
+
#ifdef USE_OPENSSL
# include <openssl/md5.h>
#else
@@ -19,7 +19,7 @@
typedef struct {
buffer *cookie_name;
buffer *cookie_domain;
- unsigned short cookie_max_age;
+ unsigned int cookie_max_age;
} plugin_config;
typedef struct {
@@ -73,7 +73,7 @@ SETDEFAULTS_FUNC(mod_usertrack_set_defaults) {
config_values_t cv[] = {
{ "usertrack.cookie-name", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 0 */
- { "usertrack.cookie-max-age", NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION }, /* 1 */
+ { "usertrack.cookie-max-age", NULL, T_CONFIG_INT, T_CONFIG_SCOPE_CONNECTION }, /* 1 */
{ "usertrack.cookie-domain", NULL, T_CONFIG_STRING, T_CONFIG_SCOPE_CONNECTION }, /* 2 */
{ "usertrack.cookiename", NULL, T_CONFIG_DEPRECATED, T_CONFIG_SCOPE_CONNECTION },
diff --git a/src/mod_webdav.c b/src/mod_webdav.c
index a78b960..4b11996 100644
--- a/src/mod_webdav.c
+++ b/src/mod_webdav.c
@@ -1,3 +1,15 @@
+#include "base.h"
+#include "log.h"
+#include "buffer.h"
+#include "response.h"
+
+#include "plugin.h"
+
+#include "stream.h"
+#include "stat_cache.h"
+
+#include "sys-mmap.h"
+
#include <sys/types.h>
#include <sys/stat.h>
#include <ctype.h>
@@ -11,10 +23,6 @@
#include <unistd.h>
#include <dirent.h>
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
#if defined(HAVE_LIBXML_H) && defined(HAVE_SQLITE3_H)
#define USE_PROPPATCH
#include <libxml/tree.h>
@@ -28,18 +36,6 @@
#include <uuid/uuid.h>
#endif
-#include "base.h"
-#include "log.h"
-#include "buffer.h"
-#include "response.h"
-
-#include "plugin.h"
-
-#include "stream.h"
-#include "stat_cache.h"
-
-#include "sys-mmap.h"
-
/**
* this is a webdav for a lighttpd plugin
*
@@ -1096,6 +1092,7 @@ static int webdav_parse_chunkqueue(server *srv, connection *con, plugin_data *p,
}
#endif
+#ifdef USE_LOCKS
static int webdav_lockdiscovery(server *srv, connection *con,
buffer *locktoken, const char *lockscope, const char *locktype, int depth) {
@@ -1150,6 +1147,8 @@ static int webdav_lockdiscovery(server *srv, connection *con,
return 0;
}
+#endif
+
/**
* check if resource is having the right locks to access to resource
*
@@ -1783,7 +1782,7 @@ URIHANDLER_FUNC(mod_webdav_subrequest_handler) {
case HTTP_METHOD_MOVE:
case HTTP_METHOD_COPY: {
buffer *destination = NULL;
- char *sep, *start;
+ char *sep, *sep2, *start;
int overwrite = 1;
if (p->conf.is_readonly) {
@@ -1842,6 +1841,10 @@ URIHANDLER_FUNC(mod_webdav_subrequest_handler) {
con->http_status = 400;
return HANDLER_FINISHED;
}
+ if (NULL != (sep2 = memchr(start, '@', sep - start))) {
+ /* skip login information */
+ start = sep2 + 1;
+ }
buffer_copy_string_len(p->uri.authority, start, sep - start);
start = sep + 1;
@@ -1977,8 +1980,25 @@ URIHANDLER_FUNC(mod_webdav_subrequest_handler) {
if (0 == rename(con->physical.path->ptr, p->physical.path->ptr)) {
#ifdef USE_PROPPATCH
- sqlite3_stmt *stmt = p->conf.stmt_move_uri;
+ sqlite3_stmt *stmt;
+
+ stmt = p->conf.stmt_delete_uri;
+ if (stmt) {
+
+ sqlite3_reset(stmt);
+
+ /* bind the values to the insert */
+ sqlite3_bind_text(stmt, 1,
+ con->uri.path->ptr,
+ con->uri.path->used - 1,
+ SQLITE_TRANSIENT);
+
+ if (SQLITE_DONE != sqlite3_step(stmt)) {
+ log_error_write(srv, __FILE__, __LINE__, "ss", "sql-move(delete old) failed:", sqlite3_errmsg(p->conf.sql));
+ }
+ }
+ stmt = p->conf.stmt_move_uri;
if (stmt) {
sqlite3_reset(stmt);
diff --git a/src/network.c b/src/network.c
index e2d5f0b..4b07618 100644
--- a/src/network.c
+++ b/src/network.c
@@ -1,25 +1,26 @@
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/time.h>
-
-#include <errno.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <string.h>
-#include <stdlib.h>
-#include <assert.h>
-
#include "network.h"
#include "fdevent.h"
#include "log.h"
#include "connections.h"
#include "plugin.h"
#include "joblist.h"
+#include "configfile.h"
#include "network_backends.h"
#include "sys-mmap.h"
#include "sys-socket.h"
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/time.h>
+
+#include <errno.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <string.h>
+#include <stdlib.h>
+#include <assert.h>
+
#ifdef USE_OPENSSL
# include <openssl/ssl.h>
# include <openssl/err.h>
@@ -62,6 +63,50 @@ static handler_t network_server_handle_fdevent(void *s, void *context, int reven
return HANDLER_GO_ON;
}
+#if defined USE_OPENSSL && ! defined OPENSSL_NO_TLSEXT
+static int network_ssl_servername_callback(SSL *ssl, int *al, server *srv) {
+ const char *servername;
+ connection *con = (connection *) SSL_get_app_data(ssl);
+ UNUSED(al);
+
+ buffer_copy_string(con->uri.scheme, "https");
+
+ if (NULL == (servername = SSL_get_servername(ssl, TLSEXT_NAMETYPE_host_name))) {
+#if 0
+ /* this "error" just means the client didn't support it */
+ log_error_write(srv, __FILE__, __LINE__, "ss", "SSL:",
+ "failed to get TLS server name");
+#endif
+ return SSL_TLSEXT_ERR_NOACK;
+ }
+ buffer_copy_string(con->tlsext_server_name, servername);
+ buffer_to_lower(con->tlsext_server_name);
+
+ config_cond_cache_reset(srv, con);
+ config_setup_connection(srv, con);
+
+ config_patch_connection(srv, con, COMP_SERVER_SOCKET);
+ config_patch_connection(srv, con, COMP_HTTP_SCHEME);
+ config_patch_connection(srv, con, COMP_HTTP_HOST);
+
+ if (NULL == con->conf.ssl_ctx) {
+ /* ssl_ctx <=> pemfile was set <=> ssl_ctx got patched: so this should never happen */
+ log_error_write(srv, __FILE__, __LINE__, "ssb", "SSL:",
+ "null SSL_CTX for TLS server name", con->tlsext_server_name);
+ return SSL_TLSEXT_ERR_ALERT_FATAL;
+ }
+
+ /* switch to new SSL_CTX in reaction to a client's server_name extension */
+ if (con->conf.ssl_ctx != SSL_set_SSL_CTX(ssl, con->conf.ssl_ctx)) {
+ log_error_write(srv, __FILE__, __LINE__, "ssb", "SSL:",
+ "failed to set SSL_CTX for TLS server name", con->tlsext_server_name);
+ return SSL_TLSEXT_ERR_ALERT_FATAL;
+ }
+
+ return SSL_TLSEXT_ERR_OK;
+}
+#endif
+
static int network_server_init(server *srv, buffer *host_token, specific_config *s) {
int val;
socklen_t addr_len;
@@ -90,6 +135,7 @@ static int network_server_init(server *srv, buffer *host_token, specific_config
srv_socket = calloc(1, sizeof(*srv_socket));
srv_socket->fd = -1;
+ srv_socket->fde_ndx = -1;
srv_socket->srv_token = buffer_init();
buffer_copy_string_buffer(srv_socket->srv_token, host_token);
@@ -103,7 +149,7 @@ static int network_server_init(server *srv, buffer *host_token, specific_config
if (NULL == (sp = strrchr(b->ptr, ':'))) {
log_error_write(srv, __FILE__, __LINE__, "sb", "value of $SERVER[\"socket\"] has to be \"ip:port\".", b);
- return -1;
+ goto error_free_socket;
}
host = b->ptr;
@@ -126,7 +172,7 @@ static int network_server_init(server *srv, buffer *host_token, specific_config
} else if (port == 0 || port > 65535) {
log_error_write(srv, __FILE__, __LINE__, "sd", "port out of range:", port);
- return -1;
+ goto error_free_socket;
}
if (*host == '\0') host = NULL;
@@ -138,12 +184,12 @@ static int network_server_init(server *srv, buffer *host_token, specific_config
if (-1 == (srv_socket->fd = socket(srv_socket->addr.plain.sa_family, SOCK_STREAM, 0))) {
log_error_write(srv, __FILE__, __LINE__, "ss", "socket failed:", strerror(errno));
- return -1;
+ goto error_free_socket;
}
#else
log_error_write(srv, __FILE__, __LINE__, "s",
"ERROR: Unix Domain sockets are not supported.");
- return -1;
+ goto error_free_socket;
#endif
}
@@ -153,7 +199,7 @@ static int network_server_init(server *srv, buffer *host_token, specific_config
if (-1 == (srv_socket->fd = socket(srv_socket->addr.plain.sa_family, SOCK_STREAM, IPPROTO_TCP))) {
log_error_write(srv, __FILE__, __LINE__, "ss", "socket failed:", strerror(errno));
- return -1;
+ goto error_free_socket;
}
srv_socket->use_ipv6 = 1;
}
@@ -163,17 +209,22 @@ static int network_server_init(server *srv, buffer *host_token, specific_config
srv_socket->addr.plain.sa_family = AF_INET;
if (-1 == (srv_socket->fd = socket(srv_socket->addr.plain.sa_family, SOCK_STREAM, IPPROTO_TCP))) {
log_error_write(srv, __FILE__, __LINE__, "ss", "socket failed:", strerror(errno));
- return -1;
+ goto error_free_socket;
}
}
+#ifdef FD_CLOEXEC
+ /* set FD_CLOEXEC now, fdevent_fcntl_set is called later; needed for pipe-logger forks */
+ fcntl(srv_socket->fd, F_SETFD, FD_CLOEXEC);
+#endif
+
/* */
srv->cur_fds = srv_socket->fd;
val = 1;
if (setsockopt(srv_socket->fd, SOL_SOCKET, SO_REUSEADDR, &val, sizeof(val)) < 0) {
log_error_write(srv, __FILE__, __LINE__, "ss", "socketsockopt failed:", strerror(errno));
- return -1;
+ goto error_free_socket;
}
switch(srv_socket->addr.plain.sa_family) {
@@ -198,7 +249,7 @@ static int network_server_init(server *srv, buffer *host_token, specific_config
"sssss", "getaddrinfo failed: ",
gai_strerror(r), "'", host, "'");
- return -1;
+ goto error_free_socket;
}
memcpy(&(srv_socket->addr), res->ai_addr, res->ai_addrlen);
@@ -220,17 +271,17 @@ static int network_server_init(server *srv, buffer *host_token, specific_config
log_error_write(srv, __FILE__, __LINE__,
"sds", "gethostbyname failed: ",
h_errno, host);
- return -1;
+ goto error_free_socket;
}
if (he->h_addrtype != AF_INET) {
log_error_write(srv, __FILE__, __LINE__, "sd", "addr-type != AF_INET: ", he->h_addrtype);
- return -1;
+ goto error_free_socket;
}
if (he->h_length != sizeof(struct in_addr)) {
log_error_write(srv, __FILE__, __LINE__, "sd", "addr-length != sizeof(in_addr): ", he->h_length);
- return -1;
+ goto error_free_socket;
}
memcpy(&(srv_socket->addr.ipv4.sin_addr.s_addr), he->h_addr_list[0], he->h_length);
@@ -260,7 +311,7 @@ static int network_server_init(server *srv, buffer *host_token, specific_config
host);
- return -1;
+ goto error_free_socket;
}
/* connect failed */
@@ -275,14 +326,12 @@ static int network_server_init(server *srv, buffer *host_token, specific_config
"testing socket failed:",
host, strerror(errno));
- return -1;
+ goto error_free_socket;
}
break;
default:
- addr_len = 0;
-
- return -1;
+ goto error_free_socket;
}
if (0 != bind(srv_socket->fd, (struct sockaddr *) &(srv_socket->addr), addr_len)) {
@@ -298,88 +347,20 @@ static int network_server_init(server *srv, buffer *host_token, specific_config
host, port, strerror(errno));
break;
}
- return -1;
+ goto error_free_socket;
}
if (-1 == listen(srv_socket->fd, 128 * 8)) {
log_error_write(srv, __FILE__, __LINE__, "ss", "listen failed: ", strerror(errno));
- return -1;
+ goto error_free_socket;
}
if (s->is_ssl) {
#ifdef USE_OPENSSL
- if (srv->ssl_is_init == 0) {
- SSL_load_error_strings();
- SSL_library_init();
- srv->ssl_is_init = 1;
-
- if (0 == RAND_status()) {
- log_error_write(srv, __FILE__, __LINE__, "ss", "SSL:",
- "not enough entropy in the pool");
- return -1;
- }
- }
-
- if (NULL == (s->ssl_ctx = SSL_CTX_new(SSLv23_server_method()))) {
- log_error_write(srv, __FILE__, __LINE__, "ss", "SSL:",
- ERR_error_string(ERR_get_error(), NULL));
- return -1;
- }
-
- if (!s->ssl_use_sslv2) {
- /* disable SSLv2 */
- if (SSL_OP_NO_SSLv2 != SSL_CTX_set_options(s->ssl_ctx, SSL_OP_NO_SSLv2)) {
- log_error_write(srv, __FILE__, __LINE__, "ss", "SSL:",
- ERR_error_string(ERR_get_error(), NULL));
- return -1;
- }
- }
-
- if (!buffer_is_empty(s->ssl_cipher_list)) {
- /* Disable support for low encryption ciphers */
- if (SSL_CTX_set_cipher_list(s->ssl_ctx, s->ssl_cipher_list->ptr) != 1) {
- log_error_write(srv, __FILE__, __LINE__, "ss", "SSL:",
- ERR_error_string(ERR_get_error(), NULL));
- return -1;
- }
- }
-
- if (buffer_is_empty(s->ssl_pemfile)) {
+ if (NULL == (srv_socket->ssl_ctx = s->ssl_ctx)) {
log_error_write(srv, __FILE__, __LINE__, "s", "ssl.pemfile has to be set");
- return -1;
+ goto error_free_socket;
}
-
- if (!buffer_is_empty(s->ssl_ca_file)) {
- if (1 != SSL_CTX_load_verify_locations(s->ssl_ctx, s->ssl_ca_file->ptr, NULL)) {
- log_error_write(srv, __FILE__, __LINE__, "ssb", "SSL:",
- ERR_error_string(ERR_get_error(), NULL), s->ssl_ca_file);
- return -1;
- }
- }
-
- if (SSL_CTX_use_certificate_file(s->ssl_ctx, s->ssl_pemfile->ptr, SSL_FILETYPE_PEM) < 0) {
- log_error_write(srv, __FILE__, __LINE__, "ssb", "SSL:",
- ERR_error_string(ERR_get_error(), NULL), s->ssl_pemfile);
- return -1;
- }
-
- if (SSL_CTX_use_PrivateKey_file (s->ssl_ctx, s->ssl_pemfile->ptr, SSL_FILETYPE_PEM) < 0) {
- log_error_write(srv, __FILE__, __LINE__, "ssb", "SSL:",
- ERR_error_string(ERR_get_error(), NULL), s->ssl_pemfile);
- return -1;
- }
-
- if (SSL_CTX_check_private_key(s->ssl_ctx) != 1) {
- log_error_write(srv, __FILE__, __LINE__, "sssb", "SSL:",
- "Private key does not match the certificate public key, reason:",
- ERR_error_string(ERR_get_error(), NULL),
- s->ssl_pemfile);
- return -1;
- }
- SSL_CTX_set_default_read_ahead(s->ssl_ctx, 1);
- SSL_CTX_set_mode(s->ssl_ctx, SSL_CTX_get_mode(s->ssl_ctx) | SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER);
-
- srv_socket->ssl_ctx = s->ssl_ctx;
#else
buffer_free(srv_socket->srv_token);
@@ -390,7 +371,7 @@ static int network_server_init(server *srv, buffer *host_token, specific_config
log_error_write(srv, __FILE__, __LINE__, "ss", "SSL:",
"ssl requested but openssl support is not compiled in");
- return -1;
+ goto error_free_socket;
#endif
#ifdef TCP_DEFER_ACCEPT
} else if (s->defer_accept) {
@@ -414,7 +395,6 @@ static int network_server_init(server *srv, buffer *host_token, specific_config
}
srv_socket->is_ssl = s->is_ssl;
- srv_socket->fde_ndx = -1;
if (srv->srv_sockets.size == 0) {
srv->srv_sockets.size = 4;
@@ -430,6 +410,21 @@ static int network_server_init(server *srv, buffer *host_token, specific_config
buffer_free(b);
return 0;
+
+error_free_socket:
+ if (srv_socket->fd != -1) {
+ /* check if server fd are already registered */
+ if (srv_socket->fde_ndx != -1) {
+ fdevent_event_del(srv->ev, &(srv_socket->fde_ndx), srv_socket->fd);
+ fdevent_unregister(srv->ev, srv_socket->fd);
+ }
+
+ close(srv_socket->fd);
+ }
+ buffer_free(srv_socket->srv_token);
+ free(srv_socket);
+
+ return -1;
}
int network_close(server *srv) {
@@ -492,6 +487,125 @@ int network_init(server *srv) {
{ NETWORK_BACKEND_UNSET, NULL }
};
+#ifdef USE_OPENSSL
+ /* load SSL certificates */
+ for (i = 0; i < srv->config_context->used; i++) {
+ specific_config *s = srv->config_storage[i];
+
+ if (buffer_is_empty(s->ssl_pemfile)) continue;
+
+#ifdef OPENSSL_NO_TLSEXT
+ {
+ data_config *dc = (data_config *)srv->config_context->data[i];
+ if (COMP_HTTP_HOST == dc->comp) {
+ log_error_write(srv, __FILE__, __LINE__, "ss", "SSL:",
+ "can't use ssl.pemfile with $HTTP[\"host\"], openssl version does not support TLS extensions");
+ return -1;
+ }
+ }
+#endif
+
+ if (srv->ssl_is_init == 0) {
+ SSL_load_error_strings();
+ SSL_library_init();
+ srv->ssl_is_init = 1;
+
+ if (0 == RAND_status()) {
+ log_error_write(srv, __FILE__, __LINE__, "ss", "SSL:",
+ "not enough entropy in the pool");
+ return -1;
+ }
+ }
+
+ if (NULL == (s->ssl_ctx = SSL_CTX_new(SSLv23_server_method()))) {
+ log_error_write(srv, __FILE__, __LINE__, "ss", "SSL:",
+ ERR_error_string(ERR_get_error(), NULL));
+ return -1;
+ }
+
+ if (!s->ssl_use_sslv2) {
+ /* disable SSLv2 */
+ if (SSL_OP_NO_SSLv2 != SSL_CTX_set_options(s->ssl_ctx, SSL_OP_NO_SSLv2)) {
+ log_error_write(srv, __FILE__, __LINE__, "ss", "SSL:",
+ ERR_error_string(ERR_get_error(), NULL));
+ return -1;
+ }
+ }
+
+ if (!buffer_is_empty(s->ssl_cipher_list)) {
+ /* Disable support for low encryption ciphers */
+ if (SSL_CTX_set_cipher_list(s->ssl_ctx, s->ssl_cipher_list->ptr) != 1) {
+ log_error_write(srv, __FILE__, __LINE__, "ss", "SSL:",
+ ERR_error_string(ERR_get_error(), NULL));
+ return -1;
+ }
+ }
+
+ if (!buffer_is_empty(s->ssl_ca_file)) {
+ if (1 != SSL_CTX_load_verify_locations(s->ssl_ctx, s->ssl_ca_file->ptr, NULL)) {
+ log_error_write(srv, __FILE__, __LINE__, "ssb", "SSL:",
+ ERR_error_string(ERR_get_error(), NULL), s->ssl_ca_file);
+ return -1;
+ }
+ if (s->ssl_verifyclient) {
+ STACK_OF(X509_NAME) *certs = SSL_load_client_CA_file(s->ssl_ca_file->ptr);
+ if (!certs) {
+ log_error_write(srv, __FILE__, __LINE__, "ssb", "SSL:",
+ ERR_error_string(ERR_get_error(), NULL), s->ssl_ca_file);
+ }
+ if (SSL_CTX_set_session_id_context(s->ssl_ctx, (void*) &srv, sizeof(srv)) != 1) {
+ log_error_write(srv, __FILE__, __LINE__, "ss", "SSL:",
+ ERR_error_string(ERR_get_error(), NULL));
+ return -1;
+ }
+ SSL_CTX_set_client_CA_list(s->ssl_ctx, certs);
+ SSL_CTX_set_verify(
+ s->ssl_ctx,
+ SSL_VERIFY_PEER | (s->ssl_verifyclient_enforce ? SSL_VERIFY_FAIL_IF_NO_PEER_CERT : 0),
+ NULL
+ );
+ SSL_CTX_set_verify_depth(s->ssl_ctx, s->ssl_verifyclient_depth);
+ }
+ } else if (s->ssl_verifyclient) {
+ log_error_write(
+ srv, __FILE__, __LINE__, "s",
+ "SSL: You specified ssl.verifyclient.activate but no ca_file"
+ );
+ }
+
+ if (SSL_CTX_use_certificate_file(s->ssl_ctx, s->ssl_pemfile->ptr, SSL_FILETYPE_PEM) < 0) {
+ log_error_write(srv, __FILE__, __LINE__, "ssb", "SSL:",
+ ERR_error_string(ERR_get_error(), NULL), s->ssl_pemfile);
+ return -1;
+ }
+
+ if (SSL_CTX_use_PrivateKey_file (s->ssl_ctx, s->ssl_pemfile->ptr, SSL_FILETYPE_PEM) < 0) {
+ log_error_write(srv, __FILE__, __LINE__, "ssb", "SSL:",
+ ERR_error_string(ERR_get_error(), NULL), s->ssl_pemfile);
+ return -1;
+ }
+
+ if (SSL_CTX_check_private_key(s->ssl_ctx) != 1) {
+ log_error_write(srv, __FILE__, __LINE__, "sssb", "SSL:",
+ "Private key does not match the certificate public key, reason:",
+ ERR_error_string(ERR_get_error(), NULL),
+ s->ssl_pemfile);
+ return -1;
+ }
+ SSL_CTX_set_default_read_ahead(s->ssl_ctx, 1);
+ SSL_CTX_set_mode(s->ssl_ctx, SSL_CTX_get_mode(s->ssl_ctx) | SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER);
+
+# ifndef OPENSSL_NO_TLSEXT
+ if (!SSL_CTX_set_tlsext_servername_callback(s->ssl_ctx, network_ssl_servername_callback) ||
+ !SSL_CTX_set_tlsext_servername_arg(s->ssl_ctx, srv)) {
+ log_error_write(srv, __FILE__, __LINE__, "ss", "SSL:",
+ "failed to initialize TLS servername callback, openssl library does not support TLS servername extension");
+ return -1;
+ }
+# endif
+ }
+#endif
+
b = buffer_init();
buffer_copy_string_buffer(b, srv->srvconf.bindhost);
@@ -567,11 +681,7 @@ int network_init(server *srv) {
/* not our stage */
if (COMP_SERVER_SOCKET != dc->comp) continue;
- if (dc->cond != CONFIG_COND_EQ) {
- log_error_write(srv, __FILE__, __LINE__, "s", "only == is allowed for $SERVER[\"socket\"].");
-
- return -1;
- }
+ if (dc->cond != CONFIG_COND_EQ) continue;
/* check if we already know this socket,
* if yes, don't init it */
diff --git a/src/network_backends.h b/src/network_backends.h
index 3cb36af..8d92006 100644
--- a/src/network_backends.h
+++ b/src/network_backends.h
@@ -2,8 +2,9 @@
#define _NETWORK_BACKENDS_H_
#ifdef HAVE_CONFIG_H
-#include "config.h"
+# include "config.h"
#endif
+#include "settings.h"
#include <sys/types.h>
@@ -45,6 +46,11 @@
#include "base.h"
+/* return values:
+ * >= 0 : chunks completed
+ * -1 : error (on our side)
+ * -2 : remote close
+ */
int network_write_chunkqueue_write(server *srv, connection *con, int fd, chunkqueue *cq);
int network_write_chunkqueue_writev(server *srv, connection *con, int fd, chunkqueue *cq);
diff --git a/src/network_freebsd_sendfile.c b/src/network_freebsd_sendfile.c
index 9bdd2a9..ba92aaf 100644
--- a/src/network_freebsd_sendfile.c
+++ b/src/network_freebsd_sendfile.c
@@ -2,6 +2,11 @@
#ifdef USE_FREEBSD_SENDFILE
+#include "network.h"
+#include "fdevent.h"
+#include "log.h"
+#include "stat_cache.h"
+
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/stat.h>
@@ -18,11 +23,6 @@
#include <string.h>
#include <stdlib.h>
-#include "network.h"
-#include "fdevent.h"
-#include "log.h"
-#include "stat_cache.h"
-
#ifndef UIO_MAXIOV
# if defined(__FreeBSD__) || defined(__DragonFly__)
diff --git a/src/network_linux_sendfile.c b/src/network_linux_sendfile.c
index 5f01812..5a44b47 100644
--- a/src/network_linux_sendfile.c
+++ b/src/network_linux_sendfile.c
@@ -1,6 +1,12 @@
#include "network_backends.h"
#ifdef USE_LINUX_SENDFILE
+
+#include "network.h"
+#include "fdevent.h"
+#include "log.h"
+#include "stat_cache.h"
+
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/stat.h>
@@ -18,11 +24,6 @@
#include <stdlib.h>
#include <fcntl.h>
-#include "network.h"
-#include "fdevent.h"
-#include "log.h"
-#include "stat_cache.h"
-
/* on linux 2.4.29 + debian/ubuntu we have crashes if this is enabled */
#undef HAVE_POSIX_FADVISE
diff --git a/src/network_openssl.c b/src/network_openssl.c
index 756ce19..d2fb6d8 100644
--- a/src/network_openssl.c
+++ b/src/network_openssl.c
@@ -1,6 +1,12 @@
#include "network_backends.h"
#ifdef USE_OPENSSL
+
+#include "network.h"
+#include "fdevent.h"
+#include "log.h"
+#include "stat_cache.h"
+
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/stat.h>
@@ -18,11 +24,6 @@
#include <stdlib.h>
#include <assert.h>
-#include "network.h"
-#include "fdevent.h"
-#include "log.h"
-#include "stat_cache.h"
-
# include <openssl/ssl.h>
# include <openssl/err.h>
diff --git a/src/network_solaris_sendfilev.c b/src/network_solaris_sendfilev.c
index fcb7d10..fcfa178 100644
--- a/src/network_solaris_sendfilev.c
+++ b/src/network_solaris_sendfilev.c
@@ -2,6 +2,11 @@
#ifdef USE_SOLARIS_SENDFILEV
+#include "network.h"
+#include "fdevent.h"
+#include "log.h"
+#include "stat_cache.h"
+
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/stat.h>
@@ -19,13 +24,8 @@
#include <stdlib.h>
#include <limits.h>
-#include "network.h"
-#include "fdevent.h"
-#include "log.h"
-#include "stat_cache.h"
-
#ifndef UIO_MAXIOV
-#define UIO_MAXIOV IOV_MAX
+# define UIO_MAXIOV IOV_MAX
#endif
/**
diff --git a/src/network_write.c b/src/network_write.c
index 7fb52cb..b5c89f5 100644
--- a/src/network_write.c
+++ b/src/network_write.c
@@ -1,11 +1,4 @@
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/time.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <string.h>
-#include <stdlib.h>
+#include "network_backends.h"
#include "network.h"
#include "fdevent.h"
@@ -14,14 +7,21 @@
#include "sys-socket.h"
-#include "network_backends.h"
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/time.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <string.h>
+#include <stdlib.h>
#ifdef HAVE_SYS_FILIO_H
# include <sys/filio.h>
#endif
#ifdef HAVE_SYS_RESOURCE_H
-#include <sys/resource.h>
+# include <sys/resource.h>
#endif
int network_write_chunkqueue_write(server *srv, connection *con, int fd, chunkqueue *cq) {
@@ -46,15 +46,27 @@ int network_write_chunkqueue_write(server *srv, connection *con, int fd, chunkqu
toSend = c->mem->used - 1 - c->offset;
#ifdef __WIN32
if ((r = send(fd, offset, toSend, 0)) < 0) {
- log_error_write(srv, __FILE__, __LINE__, "ssd", "write failed: ", strerror(errno), fd);
+ /* no error handling for windows... */
+ log_error_write(srv, __FILE__, __LINE__, "ssd", "send failed: ", strerror(errno), fd);
return -1;
}
#else
if ((r = write(fd, offset, toSend)) < 0) {
- log_error_write(srv, __FILE__, __LINE__, "ssd", "write failed: ", strerror(errno), fd);
-
- return -1;
+ switch (errno) {
+ case EAGAIN:
+ case EINTR:
+ r = 0;
+ break;
+ case EPIPE:
+ case ECONNRESET:
+ return -2;
+ default:
+ log_error_write(srv, __FILE__, __LINE__, "ssd",
+ "write failed:", strerror(errno), fd);
+
+ return -1;
+ }
}
#endif
@@ -98,7 +110,7 @@ int network_write_chunkqueue_write(server *srv, connection *con, int fd, chunkqu
return -1;
}
-#if defined USE_MMAP
+#ifdef USE_MMAP
if (MAP_FAILED == (p = mmap(0, sce->st.st_size, PROT_READ, MAP_SHARED, ifd, 0))) {
log_error_write(srv, __FILE__, __LINE__, "ss", "mmap failed: ", strerror(errno));
@@ -109,13 +121,26 @@ int network_write_chunkqueue_write(server *srv, connection *con, int fd, chunkqu
close(ifd);
if ((r = write(fd, p + offset, toSend)) <= 0) {
- log_error_write(srv, __FILE__, __LINE__, "ss", "write failed: ", strerror(errno));
- munmap(p, sce->st.st_size);
- return -1;
+ switch (errno) {
+ case EAGAIN:
+ case EINTR:
+ r = 0;
+ break;
+ case EPIPE:
+ case ECONNRESET:
+ munmap(p, sce->st.st_size);
+ return -2;
+ default:
+ log_error_write(srv, __FILE__, __LINE__, "ssd",
+ "write failed:", strerror(errno), fd);
+ munmap(p, sce->st.st_size);
+
+ return -1;
+ }
}
munmap(p, sce->st.st_size);
-#else
+#else /* USE_MMAP */
buffer_prepare_copy(srv->tmp_buf, toSend);
lseek(ifd, offset, SEEK_SET);
@@ -127,12 +152,33 @@ int network_write_chunkqueue_write(server *srv, connection *con, int fd, chunkqu
}
close(ifd);
- if (-1 == (r = send(fd, srv->tmp_buf->ptr, toSend, 0))) {
- log_error_write(srv, __FILE__, __LINE__, "ss", "write: ", strerror(errno));
+#ifdef __WIN32
+ if ((r = send(fd, srv->tmp_buf->ptr, toSend, 0)) < 0) {
+ /* no error handling for windows... */
+ log_error_write(srv, __FILE__, __LINE__, "ssd", "send failed: ", strerror(errno), fd);
return -1;
}
-#endif
+#else /* __WIN32 */
+ if ((r = write(fd, srv->tmp_buf->ptr, toSend)) < 0) {
+ switch (errno) {
+ case EAGAIN:
+ case EINTR:
+ r = 0;
+ break;
+ case EPIPE:
+ case ECONNRESET:
+ return -2;
+ default:
+ log_error_write(srv, __FILE__, __LINE__, "ssd",
+ "write failed:", strerror(errno), fd);
+
+ return -1;
+ }
+ }
+#endif /* __WIN32 */
+#endif /* USE_MMAP */
+
c->offset += r;
cq->bytes_out += r;
diff --git a/src/network_writev.c b/src/network_writev.c
index 4c2684f..6a19348 100644
--- a/src/network_writev.c
+++ b/src/network_writev.c
@@ -2,6 +2,11 @@
#ifdef USE_WRITEV
+#include "network.h"
+#include "fdevent.h"
+#include "log.h"
+#include "stat_cache.h"
+
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/uio.h>
@@ -21,11 +26,6 @@
#include <stdio.h>
#include <assert.h>
-#include "network.h"
-#include "fdevent.h"
-#include "log.h"
-#include "stat_cache.h"
-
#if 0
#define LOCAL_BUFFERING 1
#endif
diff --git a/src/plugin.c b/src/plugin.c
index 68eab65..0690629 100644
--- a/src/plugin.c
+++ b/src/plugin.c
@@ -1,20 +1,17 @@
+#include "plugin.h"
+#include "log.h"
+
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
-#include "plugin.h"
-#include "log.h"
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
#ifdef HAVE_VALGRIND_VALGRIND_H
-#include <valgrind/valgrind.h>
+# include <valgrind/valgrind.h>
#endif
#ifndef __WIN32
-#include <dlfcn.h>
+# include <dlfcn.h>
#endif
/*
*
diff --git a/src/proc_open.c b/src/proc_open.c
index 79f62c6..eb9dbdd 100644
--- a/src/proc_open.c
+++ b/src/proc_open.c
@@ -1,15 +1,16 @@
+#include "proc_open.h"
+
#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
#include <errno.h>
-#include "proc_open.h"
#ifdef WIN32
-#include <io.h>
-#include <fcntl.h>
+# include <io.h>
+# include <fcntl.h>
#else
-#include <sys/wait.h>
-#include <unistd.h>
+# include <sys/wait.h>
+# include <unistd.h>
#endif
@@ -309,6 +310,14 @@ int proc_open_buffer(const char *command, buffer *in, buffer *out, buffer *err)
if (err) {
proc_read_fd_to_buffer(proc.err.fd, err);
+ } else {
+ buffer *tmp = buffer_init();
+ proc_read_fd_to_buffer(proc.err.fd, tmp);
+ if (tmp->used > 0 && write(2, (void*)tmp->ptr, tmp->used) < 0) {
+ perror("error writing pipe");
+ return -1;
+ }
+ buffer_free(tmp);
}
pipe_close(&proc.err);
diff --git a/src/request.c b/src/request.c
index c5762e4..5879efe 100644
--- a/src/request.c
+++ b/src/request.c
@@ -1,3 +1,7 @@
+#include "request.h"
+#include "keyvalue.h"
+#include "log.h"
+
#include <sys/stat.h>
#include <limits.h>
@@ -6,10 +10,6 @@
#include <stdio.h>
#include <ctype.h>
-#include "request.h"
-#include "keyvalue.h"
-#include "log.h"
-
static int request_check_hostname(server *srv, connection *con, buffer *host) {
enum { DOMAINLABEL, TOPLABEL } stage = TOPLABEL;
size_t i;
@@ -111,7 +111,7 @@ static int request_check_hostname(server *srv, connection *con, buffer *host) {
/* check the first character at right of the dot */
if (is_ip == 0) {
- if (!light_isalpha(host->ptr[i+1])) {
+ if (!light_isalnum(host->ptr[i+1])) {
return -1;
}
} else if (!light_isdigit(host->ptr[i+1])) {
@@ -133,7 +133,7 @@ static int request_check_hostname(server *srv, connection *con, buffer *host) {
}
} else if (i == 0) {
/* the first character of the hostname */
- if (!light_isalpha(c)) {
+ if (!light_isalnum(c)) {
return -1;
}
label_len++;
@@ -282,6 +282,8 @@ int http_request_parse(server *srv, connection *con) {
char *uri = NULL, *proto = NULL, *method = NULL, con_length_set;
int is_key = 1, key_len = 0, is_ws_after_key = 0, in_folding;
char *value = NULL, *key = NULL;
+ char *reqline_host = NULL;
+ int reqline_hostlen = 0;
enum { HTTP_CONNECTION_UNSET, HTTP_CONNECTION_KEEPALIVE, HTTP_CONNECTION_CLOSE } keep_alive_set = HTTP_CONNECTION_UNSET;
@@ -451,7 +453,14 @@ int http_request_parse(server *srv, connection *con) {
if (0 == strncmp(uri, "http://", 7) &&
NULL != (nuri = strchr(uri + 7, '/'))) {
- /* ignore the host-part */
+ reqline_host = uri + 7;
+ reqline_hostlen = nuri - reqline_host;
+
+ buffer_copy_string_len(con->request.uri, nuri, proto - nuri - 1);
+ } else if (0 == strncmp(uri, "https://", 8) &&
+ NULL != (nuri = strchr(uri + 8, '/'))) {
+ reqline_host = uri + 8;
+ reqline_hostlen = nuri - reqline_host;
buffer_copy_string_len(con->request.uri, nuri, proto - nuri - 1);
} else {
@@ -540,8 +549,8 @@ int http_request_parse(server *srv, connection *con) {
con->response.keep_alive = 0;
con->keep_alive = 0;
- log_error_write(srv, __FILE__, __LINE__, "s", "no uri specified -> 400");
if (srv->srvconf.log_request_header_on_error) {
+ log_error_write(srv, __FILE__, __LINE__, "s", "no uri specified -> 400");
log_error_write(srv, __FILE__, __LINE__, "Sb",
"request-header:\n",
con->request.request);
@@ -549,6 +558,19 @@ int http_request_parse(server *srv, connection *con) {
return 0;
}
+ if (reqline_host) {
+ /* Insert as host header */
+ data_string *ds;
+
+ if (NULL == (ds = (data_string *)array_get_unused_element(con->request.headers, TYPE_STRING))) {
+ ds = data_string_init();
+ }
+
+ buffer_copy_string_len(ds->key, CONST_STR_LEN("Host"));
+ buffer_copy_string_len(ds->value, reqline_host, reqline_hostlen);
+ array_insert_unique(con->request.headers, (data_unset *)ds);
+ con->request.http_host = ds->value;
+ }
for (; i < con->parse_request->used && !done; i++) {
char *cur = con->parse_request->ptr + i;
@@ -909,7 +931,11 @@ int http_request_parse(server *srv, connection *con) {
return 0;
}
} else if (cmp > 0 && 0 == (cmp = buffer_caseless_compare(CONST_BUF_LEN(ds->key), CONST_STR_LEN("Host")))) {
- if (!con->request.http_host) {
+ if (reqline_host) {
+ /* ignore all host: headers as we got the host in the request line */
+ ds->free((data_unset*) ds);
+ ds = NULL;
+ } else if (!con->request.http_host) {
con->request.http_host = ds->value;
} else {
con->http_status = 400;
diff --git a/src/response.c b/src/response.c
index ae9aeff..df543a5 100644
--- a/src/response.c
+++ b/src/response.c
@@ -1,3 +1,14 @@
+#include "response.h"
+#include "keyvalue.h"
+#include "log.h"
+#include "stat_cache.h"
+#include "chunk.h"
+
+#include "configfile.h"
+#include "connections.h"
+
+#include "plugin.h"
+
#include <sys/types.h>
#include <sys/stat.h>
@@ -13,17 +24,6 @@
#include <stdio.h>
-#include "response.h"
-#include "keyvalue.h"
-#include "log.h"
-#include "stat_cache.h"
-#include "chunk.h"
-
-#include "configfile.h"
-#include "connections.h"
-
-#include "plugin.h"
-
#include "sys-socket.h"
#include "version.h"
@@ -45,8 +45,10 @@ int http_response_write_header(server *srv, connection *con) {
buffer_append_string(b, get_http_status_name(con->http_status));
/* disable keep-alive if requested */
- if (con->request_count > con->conf.max_keep_alive_requests) {
+ if (con->request_count > con->conf.max_keep_alive_requests || 0 == con->conf.max_keep_alive_idle) {
con->keep_alive = 0;
+ } else {
+ con->keep_alive_idle = con->conf.max_keep_alive_idle;
}
if (con->request.http_version != HTTP_VERSION_1_1 || con->keep_alive == 0) {
@@ -70,7 +72,7 @@ int http_response_write_header(server *srv, connection *con) {
if (ds->value->used && ds->key->used &&
0 != strncasecmp(ds->key->ptr, CONST_STR_LEN("X-LIGHTTPD-")) &&
- 0 != strcasecmp(ds->key->ptr, "X-Sendfile")) {
+ 0 != strncasecmp(ds->key->ptr, CONST_STR_LEN("X-Sendfile"))) {
if (0 == strcasecmp(ds->key->ptr, "Date")) have_date = 1;
if (0 == strcasecmp(ds->key->ptr, "Server")) have_server = 1;
if (0 == strcasecmp(ds->key->ptr, "Content-Encoding") && 304 == con->http_status) continue;
diff --git a/src/response.h b/src/response.h
index c9ff234..289add8 100644
--- a/src/response.h
+++ b/src/response.h
@@ -1,15 +1,16 @@
#ifndef _RESPONSE_H_
#define _RESPONSE_H_
-#include <time.h>
-
#include "server.h"
+#include <time.h>
+
int http_response_parse(server *srv, connection *con);
int http_response_write_header(server *srv, connection *con);
int response_header_insert(server *srv, connection *con, const char *key, size_t keylen, const char *value, size_t vallen);
int response_header_overwrite(server *srv, connection *con, const char *key, size_t keylen, const char *value, size_t vallen);
+int response_header_append(server *srv, connection *con, const char *key, size_t keylen, const char *value, size_t vallen);
handler_t http_response_prepare(server *srv, connection *con);
int http_response_redirect_to_directory(server *srv, connection *con);
diff --git a/src/server.c b/src/server.c
index d5066ea..1bedd00 100644
--- a/src/server.c
+++ b/src/server.c
@@ -1,19 +1,3 @@
-#include <sys/types.h>
-#include <sys/time.h>
-#include <sys/stat.h>
-
-#include <string.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <time.h>
-#include <signal.h>
-#include <assert.h>
-#include <locale.h>
-
-#include <stdio.h>
-
#include "server.h"
#include "buffer.h"
#include "network.h"
@@ -31,29 +15,45 @@
#include "network_backends.h"
#include "version.h"
+#include <sys/types.h>
+#include <sys/time.h>
+#include <sys/stat.h>
+
+#include <string.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <time.h>
+#include <signal.h>
+#include <assert.h>
+#include <locale.h>
+
+#include <stdio.h>
+
#ifdef HAVE_GETOPT_H
-#include <getopt.h>
+# include <getopt.h>
#endif
#ifdef HAVE_VALGRIND_VALGRIND_H
-#include <valgrind/valgrind.h>
+# include <valgrind/valgrind.h>
#endif
#ifdef HAVE_SYS_WAIT_H
-#include <sys/wait.h>
+# include <sys/wait.h>
#endif
#ifdef HAVE_PWD_H
-#include <grp.h>
-#include <pwd.h>
+# include <grp.h>
+# include <pwd.h>
#endif
#ifdef HAVE_SYS_RESOURCE_H
-#include <sys/resource.h>
+# include <sys/resource.h>
#endif
#ifdef HAVE_SYS_PRCTL_H
-#include <sys/prctl.h>
+# include <sys/prctl.h>
#endif
#ifdef USE_OPENSSL
@@ -187,6 +187,7 @@ static server *server_init(void) {
CLEAN(cond_check_buf);
CLEAN(srvconf.errorlog_file);
+ CLEAN(srvconf.breakagelog_file);
CLEAN(srvconf.groupname);
CLEAN(srvconf.username);
CLEAN(srvconf.changeroot);
@@ -242,8 +243,8 @@ static server *server_init(void) {
srv->srvconf.reject_expect_100_with_417 = 1;
/* use syslog */
- srv->errorlog_fd = -1;
- srv->errorlog_mode = ERRORLOG_STDERR;
+ srv->errorlog_fd = STDERR_FILENO;
+ srv->errorlog_mode = ERRORLOG_FD;
srv->split_vals = array_init();
@@ -271,6 +272,7 @@ static void server_free(server *srv) {
CLEAN(cond_check_buf);
CLEAN(srvconf.errorlog_file);
+ CLEAN(srvconf.breakagelog_file);
CLEAN(srvconf.groupname);
CLEAN(srvconf.username);
CLEAN(srvconf.changeroot);
@@ -305,6 +307,7 @@ static void server_free(server *srv) {
buffer_free(s->error_handler);
buffer_free(s->errorfile_prefix);
array_free(s->mimetypes);
+ buffer_free(s->ssl_verifyclient_username);
#ifdef USE_OPENSSL
SSL_CTX_free(s->ssl_ctx);
#endif
@@ -717,7 +720,7 @@ int main (int argc, char **argv) {
}
if (srv->event_handler == FDEVENT_HANDLER_SELECT) {
- srv->max_fds = rlim.rlim_cur < FD_SETSIZE - 200 ? rlim.rlim_cur : FD_SETSIZE - 200;
+ srv->max_fds = rlim.rlim_cur < ((int)FD_SETSIZE) - 200 ? rlim.rlim_cur : FD_SETSIZE - 200;
} else {
srv->max_fds = rlim.rlim_cur;
}
@@ -730,7 +733,7 @@ int main (int argc, char **argv) {
#endif
if (srv->event_handler == FDEVENT_HANDLER_SELECT) {
/* don't raise the limit above FD_SET_SIZE */
- if (srv->max_fds > FD_SETSIZE - 200) {
+ if (srv->max_fds > ((int)FD_SETSIZE) - 200) {
log_error_write(srv, __FILE__, __LINE__, "sd",
"can't raise max filedescriptors above", FD_SETSIZE - 200,
"if event-handler is 'select'. Use 'poll' or something else or reduce server.max-fds.");
@@ -780,7 +783,7 @@ int main (int argc, char **argv) {
* Change group before chroot, when we have access
* to /etc/group
* */
- if (srv->srvconf.groupname->used) {
+ if (NULL != grp) {
setgid(grp->gr_gid);
setgroups(0, NULL);
if (srv->srvconf.username->used) {
@@ -804,7 +807,7 @@ int main (int argc, char **argv) {
#endif
#ifdef HAVE_PWD_H
/* drop root privs */
- if (srv->srvconf.username->used) {
+ if (NULL != pwd) {
setuid(pwd->pw_uid);
}
#endif
@@ -843,7 +846,7 @@ int main (int argc, char **argv) {
}
if (srv->event_handler == FDEVENT_HANDLER_SELECT) {
- srv->max_fds = rlim.rlim_cur < FD_SETSIZE - 200 ? rlim.rlim_cur : FD_SETSIZE - 200;
+ srv->max_fds = rlim.rlim_cur < ((int)FD_SETSIZE) - 200 ? rlim.rlim_cur : FD_SETSIZE - 200;
} else {
srv->max_fds = rlim.rlim_cur;
}
@@ -857,7 +860,7 @@ int main (int argc, char **argv) {
#endif
if (srv->event_handler == FDEVENT_HANDLER_SELECT) {
/* don't raise the limit above FD_SET_SIZE */
- if (srv->max_fds > FD_SETSIZE - 200) {
+ if (srv->max_fds > ((int)FD_SETSIZE) - 200) {
log_error_write(srv, __FILE__, __LINE__, "sd",
"can't raise max filedescriptors above", FD_SETSIZE - 200,
"if event-handler is 'select'. Use 'poll' or something else or reduce server.max-fds.");
@@ -1251,7 +1254,7 @@ int main (int argc, char **argv) {
changed = 1;
}
} else {
- if (srv->cur_ts - con->read_idle_ts > con->conf.max_keep_alive_idle) {
+ if (srv->cur_ts - con->read_idle_ts > con->keep_alive_idle) {
/* time - out */
#if 0
log_error_write(srv, __FILE__, __LINE__, "sd",
@@ -1288,6 +1291,11 @@ int main (int argc, char **argv) {
changed = 1;
}
}
+
+ if (con->state == CON_STATE_CLOSE && (srv->cur_ts - con->close_timeout_ts > HTTP_LINGER_TIMEOUT)) {
+ changed = 1;
+ }
+
/* we don't like div by zero */
if (0 == (t_diff = srv->cur_ts - con->connection_start)) t_diff = 1;
diff --git a/src/settings.h b/src/settings.h
index 8d74c4a..6ee44b6 100644
--- a/src/settings.h
+++ b/src/settings.h
@@ -1,6 +1,14 @@
#ifndef _LIGHTTPD_SETTINGS_H_
#define _LIGHTTPD_SETTINGS_H_
+#ifndef _GNU_SOURCE
+# define _GNU_SOURCE
+#endif
+
+#ifndef __USE_GNU
+# define __USE_GNU /* a hack in my eyes, <fcntl.h> F_SETSIG should work with _GNU_SOURCE */
+#endif
+
#define BV(x) (1 << x)
#define INET_NTOP_CACHE_MAX 4
@@ -32,6 +40,7 @@ typedef enum { HANDLER_UNSET,
HANDLER_WAIT_FOR_FD
} handler_t;
+#define HTTP_LINGER_TIMEOUT 5
/* we use it in a enum */
#ifdef TRUE
diff --git a/src/splaytree.c b/src/splaytree.c
index 68b0b73..51aa0ca 100644
--- a/src/splaytree.c
+++ b/src/splaytree.c
@@ -46,9 +46,9 @@
Addison-Wesley, 1993, pp 367-375
*/
+#include "splaytree.h"
#include <stdlib.h>
#include <assert.h>
-#include "splaytree.h"
#define compare(i,j) ((i)-(j))
/* This is the comparison. */
@@ -61,12 +61,11 @@
* size fields are maintained */
splay_tree * splaytree_splay (splay_tree *t, int i) {
splay_tree N, *l, *r, *y;
- int comp, root_size, l_size, r_size;
+ int comp, l_size, r_size;
if (t == NULL) return t;
N.left = N.right = NULL;
l = r = &N;
- root_size = node_size(t);
l_size = r_size = 0;
for (;;) {
diff --git a/src/stat_cache.c b/src/stat_cache.c
index 2657143..c1afade 100644
--- a/src/stat_cache.c
+++ b/src/stat_cache.c
@@ -1,4 +1,7 @@
-#define _GNU_SOURCE
+#include "log.h"
+#include "stat_cache.h"
+#include "fdevent.h"
+#include "etag.h"
#include <sys/types.h>
#include <sys/stat.h>
@@ -11,13 +14,8 @@
#include <fcntl.h>
#include <assert.h>
-#include "log.h"
-#include "stat_cache.h"
-#include "fdevent.h"
-#include "etag.h"
-
#ifdef HAVE_ATTR_ATTRIBUTES_H
-#include <attr/attributes.h>
+# include <attr/attributes.h>
#endif
#ifdef HAVE_FAM_H
@@ -36,7 +34,7 @@
#endif
#ifndef HAVE_LSTAT
-#define lstat stat
+# define lstat stat
#endif
#if 0
@@ -503,11 +501,9 @@ handler_t stat_cache_get_entry(server *srv, connection *con, buffer *name, stat_
}
if (NULL == sce) {
- int osize = 0;
-
- if (sc->files) {
- osize = sc->files->size;
- }
+#ifdef DEBUG_STAT_CACHE
+ int osize = splaytree_size(sc->files);
+#endif
sce = stat_cache_entry_init();
buffer_copy_string_buffer(sce->name, name);
diff --git a/src/status_counter.c b/src/status_counter.c
index eaf9251..ab130da 100644
--- a/src/status_counter.c
+++ b/src/status_counter.c
@@ -1,6 +1,7 @@
+#include "status_counter.h"
+
#include <stdlib.h>
-#include "status_counter.h"
/**
* The status array can carry all the status information you want
* the key to the array is <module-prefix>.<name>
diff --git a/src/status_counter.h b/src/status_counter.h
index 210fe85..ba5e76f 100644
--- a/src/status_counter.h
+++ b/src/status_counter.h
@@ -1,11 +1,11 @@
#ifndef _STATUS_COUNTER_H_
#define _STATUS_COUNTER_H_
-#include <sys/types.h>
-
#include "array.h"
#include "base.h"
+#include <sys/types.h>
+
data_integer *status_counter_get_counter(server *srv, const char *s, size_t len);
int status_counter_inc(server *srv, const char *s, size_t len);
int status_counter_dec(server *srv, const char *s, size_t len);
diff --git a/src/stream.c b/src/stream.c
index d249647..f91e73c 100644
--- a/src/stream.c
+++ b/src/stream.c
@@ -1,14 +1,11 @@
+#include "stream.h"
+
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <fcntl.h>
-#include "stream.h"
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
#include "sys-mmap.h"
#ifndef O_BINARY
diff --git a/src/version.h b/src/version.h
index f8eea22..e05b654 100644
--- a/src/version.h
+++ b/src/version.h
@@ -2,9 +2,9 @@
#define _VERSION_H_
#ifdef HAVE_VERSION_H
-#include "versionstamp.h"
+# include "versionstamp.h"
#else
-#define REPO_VERSION ""
+# define REPO_VERSION ""
#endif
#define PACKAGE_DESC PACKAGE_NAME "/" PACKAGE_VERSION REPO_VERSION