From c82a9b990b775ffd78b18925dbc00c7bb06e0a24 Mon Sep 17 00:00:00 2001 From: Wilfried Goesgens Date: Sat, 5 Oct 2013 21:10:02 +0200 Subject: [PATCH] add a blacklist of mimetypes which we won't gzip compress on the way out. --- webcit/Makefile.in | 6 +- webcit/config.guess | 184 ++++++++++++++++++++++---------------- webcit/config.sub | 97 +++++++++++--------- webcit/configure.ac | 14 +++ webcit/debian/rules | 3 +- webcit/downloads.c | 8 +- webcit/messages.c | 10 ++- webcit/nogz-mimetypes.txt | 4 + webcit/sysdep.c | 67 ++++++++++++++ webcit/webcit.h | 1 + webcit/webserver.c | 2 + 11 files changed, 266 insertions(+), 130 deletions(-) create mode 100644 webcit/nogz-mimetypes.txt diff --git a/webcit/Makefile.in b/webcit/Makefile.in index 50098d9fb..bbd973df4 100644 --- a/webcit/Makefile.in +++ b/webcit/Makefile.in @@ -18,6 +18,7 @@ PROG_SUBDIRS=@PROG_SUBDIRS@ SUBDIRS=$(LIB_SUBDIRS) $(PROG_SUBDIRS) LOCALEDIR=@LOCALEDIR@ WWWDIR=@WWWDIR@ +ETCDIR=@ETCDIR@ HEADERS=calendar.h dav.h messages.h modules_init.h paramhandling.h preferences.h roomops.h subst.h sysdep.h tcp_sockets.h utils.h webcit.h webserver.h # End of configuration section @@ -104,7 +105,7 @@ $(srcdir)/configure: $(srcdir)/configure.ac $(srcdir)/aclocal.m4 $(srcdir)/aclocal.m4: $(srcdir)/acinclude.m4 cd $(srcdir) && $(ACLOCAL) -install: install-bin install-setupbin install-wwwdata install-tinymce install-locale +install: install-bin install-setupbin install-wwwdata install-tinymce install-locale install-cfg install-bin: test -d $(DESTDIR)$(prefix) || mkdir -p $(DESTDIR)$(prefix) @@ -114,6 +115,9 @@ install-bin: ln -s $(DESTDIR)$(prefix)/webcit $(DESTDIR)$(prefix)/webserver; \ fi +install-cfg: + test -d $(DESTDIR)$(ETCDIR) || mkdir -p $(DESTDIR)$(ETCDIR) + $(INSTALL) nogz-mimetypes.txt $(DESTDIR)/$(ETCDIR)/nogz-mimetypes.txt install-setupbin: install-bin $(INSTALL) setup $(DESTDIR)$(prefix)/setup diff --git a/webcit/config.guess b/webcit/config.guess index d622a44e5..b79252d6b 100755 --- a/webcit/config.guess +++ b/webcit/config.guess @@ -1,14 +1,12 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, -# 2011, 2012 Free Software Foundation, Inc. +# Copyright 1992-2013 Free Software Foundation, Inc. -timestamp='2012-02-10' +timestamp='2013-06-10' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or +# the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but @@ -22,19 +20,17 @@ timestamp='2012-02-10' # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - - -# Originally written by Per Bothner. Please send patches (context -# diff format) to and include a ChangeLog -# entry. +# the same distribution terms that you use for the rest of that +# program. This Exception is an additional permission under section 7 +# of the GNU General Public License, version 3 ("GPLv3"). # -# This script attempts to guess a canonical system name similar to -# config.sub. If it succeeds, it prints the system name on stdout, and -# exits with 0. Otherwise, it exits with 1. +# Originally written by Per Bothner. # # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD +# +# Please send patches with a ChangeLog entry to config-patches@gnu.org. + me=`echo "$0" | sed -e 's,.*/,,'` @@ -54,9 +50,7 @@ version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, -2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 -Free Software Foundation, Inc. +Copyright 1992-2013 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -138,6 +132,27 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown +case "${UNAME_SYSTEM}" in +Linux|GNU|GNU/*) + # If the system lacks a compiler, then just pick glibc. + # We could probably try harder. + LIBC=gnu + + eval $set_cc_for_build + cat <<-EOF > $dummy.c + #include + #if defined(__UCLIBC__) + LIBC=uclibc + #elif defined(__dietlibc__) + LIBC=dietlibc + #else + LIBC=gnu + #endif + EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` + ;; +esac + # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in @@ -200,6 +215,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; + *:Bitrig:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} + exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} @@ -302,7 +321,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; - arm:riscos:*:*|arm:RISCOS:*:*) + arm*:riscos:*:*|arm*:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) @@ -801,6 +820,9 @@ EOF i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; + *:MINGW64*:*) + echo ${UNAME_MACHINE}-pc-mingw64 + exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; @@ -852,21 +874,21 @@ EOF exit ;; *:GNU:*:*) # the GNU system - echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland - echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu + echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; aarch64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in @@ -879,59 +901,54 @@ EOF EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 - if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi - echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} + if test "$?" = 0 ; then LIBC="gnulibc1" ; fi + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + arc:Linux:*:* | arceb:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then - echo ${UNAME_MACHINE}-unknown-linux-gnueabi + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi else - echo ${UNAME_MACHINE}-unknown-linux-gnueabihf + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf fi fi exit ;; avr32*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; cris:Linux:*:*) - echo ${UNAME_MACHINE}-axis-linux-gnu + echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; crisv32:Linux:*:*) - echo ${UNAME_MACHINE}-axis-linux-gnu + echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; frv:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; hexagon:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:Linux:*:*) - LIBC=gnu - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #ifdef __dietlibc__ - LIBC=dietlibc - #endif -EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` - echo "${UNAME_MACHINE}-pc-linux-${LIBC}" + echo ${UNAME_MACHINE}-pc-linux-${LIBC} exit ;; ia64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m32r*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m68*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; mips:Linux:*:* | mips64:Linux:*:*) eval $set_cc_for_build @@ -950,54 +967,63 @@ EOF #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` - test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } ;; + or1k:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; or32:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; padre:Linux:*:*) - echo sparc-unknown-linux-gnu + echo sparc-unknown-linux-${LIBC} exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-gnu + echo hppa64-unknown-linux-${LIBC} exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in - PA7*) echo hppa1.1-unknown-linux-gnu ;; - PA8*) echo hppa2.0-unknown-linux-gnu ;; - *) echo hppa-unknown-linux-gnu ;; + PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; + PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; + *) echo hppa-unknown-linux-${LIBC} ;; esac exit ;; ppc64:Linux:*:*) - echo powerpc64-unknown-linux-gnu + echo powerpc64-unknown-linux-${LIBC} exit ;; ppc:Linux:*:*) - echo powerpc-unknown-linux-gnu + echo powerpc-unknown-linux-${LIBC} + exit ;; + ppc64le:Linux:*:*) + echo powerpc64le-unknown-linux-${LIBC} + exit ;; + ppcle:Linux:*:*) + echo powerpcle-unknown-linux-${LIBC} exit ;; s390:Linux:*:* | s390x:Linux:*:*) - echo ${UNAME_MACHINE}-ibm-linux + echo ${UNAME_MACHINE}-ibm-linux-${LIBC} exit ;; sh64*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sh*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; tile*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; vax:Linux:*:*) - echo ${UNAME_MACHINE}-dec-linux-gnu + echo ${UNAME_MACHINE}-dec-linux-${LIBC} exit ;; x86_64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; xtensa*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. @@ -1201,6 +1227,9 @@ EOF BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; + x86_64:Haiku:*:*) + echo x86_64-unknown-haiku + exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; @@ -1227,19 +1256,21 @@ EOF exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown - case $UNAME_PROCESSOR in - i386) - eval $set_cc_for_build - if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then - if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_64BIT_ARCH >/dev/null - then - UNAME_PROCESSOR="x86_64" - fi - fi ;; - unknown) UNAME_PROCESSOR=powerpc ;; - esac + eval $set_cc_for_build + if test "$UNAME_PROCESSOR" = unknown ; then + UNAME_PROCESSOR=powerpc + fi + if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + case $UNAME_PROCESSOR in + i386) UNAME_PROCESSOR=x86_64 ;; + powerpc) UNAME_PROCESSOR=powerpc64 ;; + esac + fi + fi echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) @@ -1256,7 +1287,7 @@ EOF NEO-?:NONSTOP_KERNEL:*:*) echo neo-tandem-nsk${UNAME_RELEASE} exit ;; - NSE-?:NONSTOP_KERNEL:*:*) + NSE-*:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) @@ -1330,9 +1361,6 @@ EOF exit ;; esac -#echo '(No uname command or uname output not recognized.)' 1>&2 -#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 - eval $set_cc_for_build cat >$dummy.c <. @@ -26,11 +20,12 @@ timestamp='2012-04-18' # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. +# the same distribution terms that you use for the rest of that +# program. This Exception is an additional permission under section 7 +# of the GNU General Public License, version 3 ("GPLv3"). -# Please send patches to . Submit a context -# diff and a properly formatted GNU ChangeLog entry. +# Please send patches with a ChangeLog entry to config-patches@gnu.org. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. @@ -73,9 +68,7 @@ Report bugs and patches to ." version="\ GNU config.sub ($timestamp) -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, -2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 -Free Software Foundation, Inc. +Copyright 1992-2013 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -123,7 +116,7 @@ esac maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ - linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ + linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ knetbsd*-gnu* | netbsd*-gnu* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) @@ -156,7 +149,7 @@ case $os in -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ - -apple | -axis | -knuth | -cray | -microblaze) + -apple | -axis | -knuth | -cray | -microblaze*) os= basic_machine=$1 ;; @@ -259,10 +252,12 @@ case $basic_machine in | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ - | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ - | be32 | be64 \ + | arc | arceb \ + | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ + | avr | avr32 \ + | be32 | be64 \ | bfin \ - | c4x | clipper \ + | c4x | c8051 | clipper \ | d10v | d30v | dlx | dsp16xx \ | epiphany \ | fido | fr30 | frv \ @@ -273,7 +268,7 @@ case $basic_machine in | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ - | maxq | mb | microblaze | mcore | mep | metag \ + | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ @@ -291,16 +286,17 @@ case $basic_machine in | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ + | mipsr5900 | mipsr5900el \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nds32 | nds32le | nds32be \ - | nios | nios2 \ + | nios | nios2 | nios2eb | nios2el \ | ns16k | ns32k \ | open8 \ - | or32 \ + | or1k | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ @@ -370,13 +366,13 @@ case $basic_machine in | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ - | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ - | clipper-* | craynv-* | cydra-* \ + | c8051-* | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ @@ -389,7 +385,8 @@ case $basic_machine in | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ - | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \ + | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ + | microblaze-* | microblazeel-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ @@ -407,12 +404,13 @@ case $basic_machine in | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipsr5900-* | mipsr5900el-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ - | nios-* | nios2-* \ + | nios-* | nios2-* | nios2eb-* | nios2el-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ | orion-* \ @@ -788,11 +786,15 @@ case $basic_machine in basic_machine=ns32k-utek os=-sysv ;; - microblaze) + microblaze*) basic_machine=microblaze-xilinx ;; + mingw64) + basic_machine=x86_64-pc + os=-mingw64 + ;; mingw32) - basic_machine=i386-pc + basic_machine=i686-pc os=-mingw32 ;; mingw32ce) @@ -828,7 +830,7 @@ case $basic_machine in basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; msys) - basic_machine=i386-pc + basic_machine=i686-pc os=-msys ;; mvs) @@ -1019,7 +1021,11 @@ case $basic_machine in basic_machine=i586-unknown os=-pw32 ;; - rdos) + rdos | rdos64) + basic_machine=x86_64-pc + os=-rdos + ;; + rdos32) basic_machine=i386-pc os=-rdos ;; @@ -1346,21 +1352,21 @@ case $os in -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ - | -sym* | -kopensolaris* \ + | -sym* | -kopensolaris* | -plan9* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ - | -openbsd* | -solidbsd* \ + | -bitrig* | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* \ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -mingw32* | -linux-gnu* | -linux-android* \ - | -linux-newlib* | -linux-uclibc* \ + | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ + | -linux-newlib* | -linux-musl* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ @@ -1492,9 +1498,6 @@ case $os in -aros*) os=-aros ;; - -kaos*) - os=-kaos - ;; -zvmoe) os=-zvmoe ;; @@ -1543,6 +1546,9 @@ case $basic_machine in c4x-* | tic4x-*) os=-coff ;; + c8051-*) + os=-elf + ;; hexagon-*) os=-elf ;; @@ -1586,6 +1592,9 @@ case $basic_machine in mips*-*) os=-elf ;; + or1k-*) + os=-elf + ;; or32-*) os=-coff ;; diff --git a/webcit/configure.ac b/webcit/configure.ac index 46d6b51c1..6485534c2 100644 --- a/webcit/configure.ac +++ b/webcit/configure.ac @@ -486,12 +486,14 @@ if test "$prefix" = NONE; then wwwdir=$ac_default_prefix rundir=$ac_default_prefix editordir=$ac_default_prefix/tiny_mce + etcdir=$ac_default_prefix else localedir=$prefix wwwdir=$prefix datadir=$prefix rundir=$prefix editordir=$prefix/tiny_mce + etcdir=$prefix fi dnl where to put the locale files @@ -552,6 +554,18 @@ AC_ARG_WITH(editordir, ) AC_DEFINE_UNQUOTED(EDITORDIR, "$editordir", [where to find our mail editor]) +dnl Checks where to find our configs +AC_ARG_WITH(etcdir, + [ --with-etcdir directory to read our configs], + [ if test "x$withval" != "xno" ; then + etcdir=$withval + fi + ] +) +AC_DEFINE_UNQUOTED(ETCDIR, "$etcdir", [where to find our configs]) +ETCDIR=$etcdir +AC_SUBST(ETCDIR) + abs_srcdir="`cd $srcdir && pwd`" abs_builddir="`pwd`" if test "$abs_srcdir" != "$abs_builddir"; then diff --git a/webcit/debian/rules b/webcit/debian/rules index 6b962b289..76881bef5 100755 --- a/webcit/debian/rules +++ b/webcit/debian/rules @@ -61,6 +61,7 @@ endif --with-editordir=/usr/share/tinymce/www/ \ --with-rundir=/var/run/citadel \ --with-ssldir=/etc/ssl/webcit/ \ + --with-etcdir=/etc/citadel \ --with-ssl \ --with-datadir=/var/run/citadel \ --enable-debug $(EXTRA_ARGS) $(PROFILE_ARGS) @@ -94,7 +95,7 @@ install: build dh_testroot dh_clean -k dh_installdirs - $(MAKE) install-bin install-locale install-wwwdata DESTDIR=$(DESTDIR) + $(MAKE) install-bin install-locale install-wwwdata install-cfg DESTDIR=$(DESTDIR) chmod a-x -R $(DESTDIR)/usr/share/citadel-webcit/static/* find $(DESTDIR)/usr/share/locale/ -name webcit.mo -exec chmod a-x {} \; rm $(DESTDIR)/usr/share/citadel-webcit/static/prototype.js diff --git a/webcit/downloads.c b/webcit/downloads.c index ccb603908..836398208 100644 --- a/webcit/downloads.c +++ b/webcit/downloads.c @@ -270,12 +270,13 @@ void download_file(void) if (GetServerStatus(Buf, NULL) == 2) { StrBufCutLeft(Buf, 4); bytes = StrBufExtract_long(Buf, 0, '|'); - if (!force_download) { - StrBufExtract_token(ContentType, Buf, 3, '|'); - } + StrBufExtract_token(ContentType, Buf, 3, '|'); serv_read_binary(WCC->WBuf, bytes, Buf); serv_puts("CLOS"); StrBuf_ServGetln(Buf); + CheckGZipCompressionAllowed (SKEY(ContentType)); + if (force_download) + FlushStrBuf(ContentType); http_transmit_thing(ChrPtr(ContentType), 0); } else { StrBufCutLeft(Buf, 4); @@ -397,6 +398,7 @@ void output_image(void) /** Write it to the browser */ if (!IsEmptyStr(MimeType)) { + CheckGZipCompressionAllowed (MimeType, strlen(MimeType)); http_transmit_thing(MimeType, 0); FreeStrBuf(&Buf); return; diff --git a/webcit/messages.c b/webcit/messages.c index ebc4e41f8..3444d6f9f 100644 --- a/webcit/messages.c +++ b/webcit/messages.c @@ -1821,9 +1821,11 @@ void mimepart(int force_download) if (GetServerStatus(Buf, &ErrorDetail) == 2) { StrBufCutLeft(Buf, 4); bytes = StrBufExtract_long(Buf, 0, '|'); - if (!force_download) { - StrBufExtract_token(ContentType, Buf, 3, '|'); - } + StrBufExtract_token(ContentType, Buf, 3, '|'); + CheckGZipCompressionAllowed (SKEY(ContentType)); + if (force_download) + FlushStrBuf(ContentType); + serv_read_binary(WCC->WBuf, bytes, Buf); serv_puts("CLOS"); @@ -1834,9 +1836,11 @@ void mimepart(int force_download) if (!strcasecmp(ChrPtr(ContentType), "application/octet-stream")) { StrBufExtract_token(Buf, WCC->Hdr->HR.ReqLine, 2, '/'); CT = GuessMimeByFilename(SKEY(Buf)); + CheckGZipCompressionAllowed (CT, strlen(CT)); } if (!strcasecmp(ChrPtr(ContentType), "application/octet-stream")) { CT = GuessMimeType(SKEY(WCC->WBuf)); + CheckGZipCompressionAllowed (CT, strlen(CT)); } } http_transmit_thing(CT, 0); diff --git a/webcit/nogz-mimetypes.txt b/webcit/nogz-mimetypes.txt new file mode 100644 index 000000000..36e56658c --- /dev/null +++ b/webcit/nogz-mimetypes.txt @@ -0,0 +1,4 @@ +# all mimetypes enlisted in this file won't be gzipped on the fly. +application/gzip +video/mpeg +video/mkv diff --git a/webcit/sysdep.c b/webcit/sysdep.c index 6c0efa49b..ae959505a 100644 --- a/webcit/sysdep.c +++ b/webcit/sysdep.c @@ -79,8 +79,10 @@ char ctdl_key_dir[PATH_MAX]=SSL_DIR; char file_crpt_file_key[PATH_MAX]=""; char file_crpt_file_csr[PATH_MAX]=""; char file_crpt_file_cer[PATH_MAX]=""; +char file_etc_mimelist[PATH_MAX]=""; const char editor_absolut_dir[PATH_MAX]=EDITORDIR; /* nailed to what configure gives us. */ +char etc_dir[PATH_MAX]; char static_dir[PATH_MAX]; /* calculated on startup */ char static_local_dir[PATH_MAX]; /* calculated on startup */ char static_icon_dir[PATH_MAX]; /* where should we find our mime icons? */ @@ -92,6 +94,62 @@ char *static_dirs[]={ /* needs same sort order as the web mapping */ }; int ExitPipe[2]; +HashList *GZMimeBlackList = NULL; /* mimetypes which shouldn't be gzip compressed */ + +void LoadMimeBlacklist(void) +{ + StrBuf *MimeBlackLine; + IOBuffer IOB; + eReadState state; + + memset(&IOB, 0, sizeof(IOBuffer)); + IOB.fd = open(file_etc_mimelist, O_RDONLY); + + IOB.Buf = NewStrBuf(); + MimeBlackLine = NewStrBuf(); + GZMimeBlackList = NewHash(1, NULL); + + do + { + state = StrBufChunkSipLine(MimeBlackLine, &IOB); + + switch (state) + { + case eMustReadMore: + if (StrBuf_read_one_chunk_callback(IOB.fd, 0, &IOB) <= 0) + state = eReadFail; + break; + case eReadSuccess: + if ((StrLength(MimeBlackLine) > 1) && + (*ChrPtr(MimeBlackLine) != '#')) + { + Put(GZMimeBlackList, SKEY(MimeBlackLine), + (void*) 1, reference_free_handler); + } + FlushStrBuf(MimeBlackLine); + break; + case eReadFail: + break; + case eBufferNotEmpty: + break; + } + } + while (state != eReadFail); + + close(IOB.fd); + + FreeStrBuf(&IOB.Buf); + FreeStrBuf(&MimeBlackLine); +} + +void CheckGZipCompressionAllowed(const char *MimeType, long MLen) +{ + void *v; + wcsession *WCC = WC; + + if (WCC->Hdr->HR.gzip_ok) + WCC->Hdr->HR.gzip_ok = GetHash(GZMimeBlackList, MimeType, MLen, &v) == 0; +} void InitialiseSemaphores(void) { @@ -486,6 +544,15 @@ webcit_calc_dirs_n_files(int relh, const char *basedir, int home, char *webcitdi "%s/citadel.cer", ctdl_key_dir); + + basedir=ETCDIR; + COMPUTE_DIRECTORY(etc_dir); + StripSlashes(etc_dir, 1); + snprintf(file_etc_mimelist, + sizeof file_etc_mimelist, + "%s/nogz-mimetypes.txt", + etc_dir); + /* we should go somewhere we can leave our coredump, if enabled... */ syslog(LOG_INFO, "Changing directory to %s\n", socket_dir); if (chdir(webcitdir) != 0) { diff --git a/webcit/webcit.h b/webcit/webcit.h index 7f8ba7c14..bab66fd0c 100644 --- a/webcit/webcit.h +++ b/webcit/webcit.h @@ -581,6 +581,7 @@ void InitialiseSemaphores(void); void begin_critical_section(int which_one); void end_critical_section(int which_one); +void CheckGZipCompressionAllowed(const char *MimeType, long MLen); extern void do_404(void); void http_redirect(const char *); diff --git a/webcit/webserver.c b/webcit/webserver.c index 8ecdec843..db3a01aa9 100644 --- a/webcit/webserver.c +++ b/webcit/webserver.c @@ -56,6 +56,7 @@ extern StrBuf *I18nDump; void InitTemplateCache(void); extern int LoadTemplates; +void LoadMimeBlacklist(void); /* * Here's where it all begins. @@ -223,6 +224,7 @@ int main(int argc, char **argv) } webcit_calc_dirs_n_files(relh, basedir, home, webcitdir, relhome); + LoadMimeBlacklist(); LoadIconDir(static_icon_dir); /* Tell 'em who's in da house */ -- 2.30.2