Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

add rebar support (Tuncer Ayaz and Steve Vinoski)

Add support for building yaws with rebar. The original configure and
make support is kept intact.

If you build with rebar you get a local install. The rebar approach
does not support a regular install, which defaults into /usr/local. If
you want a regular install, use configure and make.

Create a new top-level contrib directory and move unused src files
there. Also move src/benchmarks and src/contrib contents there as
well. Remove the obsolete src/patches directory. This is all to keep
rebar from compiling this unused code (since by default it compiles
everything under the src dir).

Move a number of build rules out of Makefiles into separate scripts so
they can be used by both rebar and make.

Modify yaws version specifier and handling to be amenable to rebar.

Clean up trailing whitespace in a number of scripts and Makefiles.

Use the following environment variables to customize the rebar build
defaults:

DEFAULT_CHARSET: used in mime type table (default: "")
ERLBINDIR: e.g. /usr/local/bin
ETCDIR: etc directory (default: ./etc)
VARDIR: var directory (default: ./var)
  • Loading branch information...
commit bedbc05b597a9c0ed2a74c8cb763e776161ccb5a 1 parent d8cf062
@tuncer tuncer authored vinoski committed
Showing with 389 additions and 381 deletions.
  1. +16 −23 Makefile
  2. +74 −52 README
  3. +1 −1  applications/chat/include.mk
  4. +1 −1  applications/mail/include.mk
  5. +1 −1  applications/wiki/include.mk
  6. +2 −2 c_src/Makefile
  7. +8 −2 c_src/yaws_sendfile_drv.c
  8. 0  {src → contrib}/benchmarks/README
  9. 0  {src → contrib}/benchmarks/all.erl
  10. 0  {src → contrib}/benchmarks/bench.erl
  11. 0  {src → contrib}/benchmarks/bench.hrl
  12. 0  {src → contrib}/benchmarks/conc_path_bm.erl
  13. 0  {src → contrib}/yaws_content_negotiation.erl
  14. 0  {src → }/contrib/yaws_mnesia_session.erl
  15. 0  {src → contrib}/yaws_showarg.erl
  16. 0  {src → contrib}/ymnesia.erl
  17. +5 −5 include.mk.in
  18. +18 −0 rebar.config
  19. +3 −3 scripts/Install
  20. +10 −52 scripts/Makefile
  21. +3 −3 scripts/Subst
  22. +17 −0 scripts/gen-yaws
  23. +21 −0 scripts/gen-yaws-conf
  24. +14 −0 scripts/gen-yaws-generated
  25. +35 −0 scripts/local-install
  26. +69 −0 scripts/rebar-pre-script
  27. +26 −0 scripts/regular-install
  28. +38 −73 scripts/yaws.conf.template
  29. +1 −1  scripts/yaws.template
  30. +18 −22 src/Makefile
  31. +1 −1  src/mime_type_c.erl
  32. +0 −3  src/patches/README
  33. +0 −132 src/patches/dos-http-header.patch
  34. +2 −2 src/yaws.app.src
  35. +2 −2 src/yaws_generated.template
  36. +3 −0  www/news
View
39 Makefile
@@ -5,10 +5,12 @@ include ./vsn.mk
PKGCONFIG_FILES = yaws.pc
-all debug clean: cleantests
+all debug clean:
@set -e ; \
for d in $(SUBDIRS) ; do \
- if [ -f $$d/Makefile ]; then ( cd $$d && $(MAKE) $@ ) || exit 1 ; fi ; \
+ if [ -f $$d/Makefile ]; \
+ then ( cd $$d && $(MAKE) $@ ) || exit 1 ; \
+ fi ; \
done
rm -rf yaws-${YAWS_VSN}.script yaws-${YAWS_VSN}.boot
rm -rf yaws-${YAWS_VSN}.rel yaws-${YAWS_VSN}.tar.gz
@@ -16,17 +18,21 @@ all debug clean: cleantests
cleantests:
cd test && $(MAKE) clean
-install: all
+clean: cleantests
+
+install: all
set -e ; \
for d in $(SUBDIRS) ; do \
- if [ -f $$d/Makefile ]; then ( cd $$d && $(MAKE) $@ ) || exit 1 ; fi ; \
+ if [ -f $$d/Makefile ]; \
+ then ( cd $$d && $(MAKE) $@ ) || exit 1 ; \
+ fi ; \
done
$(INSTALL) -d $(DESTDIR)$(PREFIX)/lib/pkgconfig
$(INSTALL) -m 644 $(PKGCONFIG_FILES) $(DESTDIR)$(PREFIX)/lib/pkgconfig
@echo "-------------------------------"
@echo
- @echo "** etc files went into ${ETCDIR}"
- @echo "** executables went into ${prefix}/bin"
+ @echo "** etc files went into ${ETCDIR}"
+ @echo "** executables went into ${prefix}/bin"
@echo "** library files went into ${prefix}/lib/yaws"
@echo "** var files went into ${VARDIR}"
@echo "** default docroot went into ${VARDIR}/yaws/www"
@@ -45,7 +51,7 @@ local_install: all
# Target for folks that want to build a proper OTP release
-# to be used with regular OTP release management.
+# to be used with regular OTP release management.
release: vsn.mk include.mk yaws.rel.src all
sed -e "s/%YAWS_VSN%/${YAWS_VSN}/g" \
-e "s/%ERTS_VSN%/${ERTS_VSN}/" \
@@ -70,28 +76,15 @@ touch:
find . -name '*' -print | xargs touch -m
find . -name '*.erl' -print | xargs touch -m
-
-
-
-foo:
- @echo "-------------------------------"
- @echo
- @echo "** etc files will go into ${ETCDIR}"
- @echo "** executables will go into ${prefix}/bin"
- @echo "** library file will go into ${prefix}/lib/yaws"
- @echo "** var files will go into ${VARDIR}"
- @echo
- @echo "--------------------------------"
-
-yaws.plt:
+yaws.plt:
dialyzer --build_plt -r . --output_plt yaws.plt \
-r $(ERLDIR)/lib/sasl-$(SASL_VSN) \
-r $(ERLDIR)/lib/kernel-$(KERNEL_VSN) \
-r $(ERLDIR)/lib/stdlib-$(STDLIB_VSN) \
- -r $(ERLDIR)/lib/erts-$(ERTS_VSN)
+ -r $(ERLDIR)/lib/erts-$(ERTS_VSN)
# Not debug compiled, let's just ignore it
-# -r $(ERLDIR)/lib/ssl-$(SSL_VSN)
+# -r $(ERLDIR)/lib/ssl-$(SSL_VSN)
dialyzer: yaws.plt
dialyzer --plt yaws.plt -r .
View
126 README
@@ -5,88 +5,111 @@ This is yaws, a webserver for dynamic content written in Erlang.
To build and install
-0. Get and install an erlang system (http://www.erlang.org)
+0. Get and install an Erlang system (http://www.erlang.org)
-1. If you've cloned the source from github, there is no ./configure
- script in the source, create one:
+1. If you've cloned the source from github and you want to build using
+ configure and make, note there is no ./configure script in the
+ source, so create one:
# autoconf
+1.b Install build-deps. On Ubuntu/debian this is pretty much equal to
+# apt-get build-dep yaws
-1.b Install build-deps. On Ubuntu/debian this is pretty much equal to
-# apt-get build-dep yaws
+2. You can build using rebar:
-:-)
+# rebar compile
+ or via configure and make:
+# ./configure --prefix=/usr/local
-2. ./configure --prefix=/usr/local
- This will install everything under /usr/local including var files
- in /usr/local/var/run/yaws and etc files in
- /usr/local/etc/yaws.*
+ If using rebar, you'll get a local installation with yaws in
+ $HOME/bin and the yaws configuration file in $HOME/yaws.conf. If
+ using configuration and make, the build will be configured by
+ default for installation under /usr/local including var files in
+ /usr/local/var/run/yaws and etc files in /usr/local/etc/yaws.
- A plain ./configure will install executables under
- /usr/local/bin and libs in /usr/local/lib/yaws etc and
- var files will end up under /usr/local/etc and /usr/local/var
+ NOTE: With configure, you can also change the target directory for
+ etc and var directories by using:
-
-Note: We can also change the target directory for etc and var
- directories by using:
-
- --localstatedir=DIR for files that should go in /var
- --sysconfdir=DIR for files that should go in /etc
- --disable-pam If we for some reason do not want pam support
+ --localstatedir=DIR for files that should go in /var
+ --sysconfdir=DIR for files that should go in /etc
+ --disable-pam If we for some reason do not want pam support
--with-extrainclude=DIR Will add DIR to the include path
- May be useful if e.g. pam is installed
- somewhere where its usually not found
+ May be useful if e.g. pam is installed
+ somewhere where its usually not found
--with-defaultcharset=String Will set the default charset used
in generated page headers. Usually never needed.
-
-This way you can precisely control where you install Yaws (This is
-usefull for computers where you do not have right access to the
-standard systemdirs).
-For example:
-./configure --prefix=/home/install/yaws --localstatedir=/home/install/yaws/var --sysconfdir=/home/install/etc
+ This way you can precisely control where you install Yaws (This is
+ useful for computers where you do not have right access to the
+ standard systemdirs).
+
+ For example:
+
+ ./configure --prefix=/home/install/yaws --localstatedir=/home/install/yaws/var --sysconfdir=/home/install/etc
+
+2b. Note to packagers (rpm, deb ...) All install targets support the
+ DESTDIR variable. Thus, if we do
+ ./configure --prefix=/usr; make
-2b. Note to packagers (rpm, deb ...) All install targets support the
- DESTDIR variable.
- Thus, if we do ./configure --prefix=/usr; make
we can subsequently do:
+
DESTDIR=/foo/bar make install
- All yaws files will be installed under DESTDIR, but all
- code will assume yaws should be installed under /usr
+ All yaws files will be installed under DESTDIR, but all
+ code will assume yaws should be installed under /usr.
3. make
- This will build the system
- make docs
- (Optional) You can issue this command if you want to build Yaws
- documentation.
+ This will build the system.
+
+ make docs
+
+ (Optional) You can issue this command if you want to build Yaws
+ documentation.
+
+ make local_install
- make local_install
- and perform something we call a
- local install. It will create an executable script in the $HOME/bin
- directory and a config file in $HOME/yaws.conf. This is for developers
- only
+ This will create an executable script in the $HOME/bin directory
+ and a config file in $HOME/yaws.conf. This is for developers
+ only. This is the only type of installation "rebar compile"
+ supports.
-4. To test the build, Start as bin/yaws -i
- This will start a webserver at http://0.0.0.0:8000
- Terminate through ^C or
- > init:stop()
+4. To test the build, start it as
+
+ ./bin/yaws -i
+
+ If you used rebar to compile yaws, you can alternatively start yaws
+ with
+
+ $HOME/bin/yaws -i
+
+ Either approach will start a webserver at http://0.0.0.0:8000 .
+ Terminate through ^C, or ^G followed by q, or
+
+ > init:stop()
+
+ NOTE: If you've used rebar to build the system, none of the
+ following directions apply. With rebar only local installations are
+ supported.
5. as root make install
-6. as root start as /usr/local/bin/yaws -i
- (this starts an interactive system)
+6. as root start as
+
+ /usr/local/bin/yaws -i
-7. This will create a webserver at http://${host} and one at https://${host}
+ This starts an interactive system.
-8. as root edit /usr/local/etc/yaws/yaws.conf
+7. With the default yaws.conf file, this will create a webserver at
+ http://${host} and one at https://${host}
-9. Create content in /usr/local/var/yaws
+8. as root edit /usr/local/etc/yaws/yaws.conf
+
+9. Create content in /usr/local/var/yaws/www
10a. Start as /usr/local/bin/yaws --daemon --heart
This will start a daemon (--daemon) which will be autorestarted when/if
@@ -96,7 +119,6 @@ For example:
10b. Or start interactive system as /usr/local/bin/yaws -i
-
11. Example: Here is how I compile/start the yaws system that runs
at http://yaws.hyber.org (Ubuntu server system)
View
2  applications/chat/include.mk
@@ -33,7 +33,7 @@ INSTALL_DATA=${INSTALL} -m 644
# Hmm, don't know if you are supposed to like this better... ;-)
-APPSCRIPT = '$$vsn=shift; $$mods=""; while(@ARGV){ $$_=shift; s/^([A-Z].*)$$/\'\''$$1\'\''/; $$mods.=", " if $$mods; $$mods .= $$_; } while(<>) { s/%VSN%/$$vsn/; s/%MODULES%/$$mods/; print; }'
+APPSCRIPT = '$$vsn=shift; $$mods=""; while(@ARGV){ $$_=shift; s/^([A-Z].*)$$/\'\''$$1\'\''/; $$mods.=", " if $$mods; $$mods .= $$_; } while(<>) { s/\{vsn, git\}/\{vsn, $$vsn\}/; s/\{modules,\[\]\}/\{modules,\[$$mods\]\}/; print; }'
# Targets
View
2  applications/mail/include.mk
@@ -33,7 +33,7 @@ INSTALL_DATA=${INSTALL} -m 644
# Hmm, don't know if you are supposed to like this better... ;-)
-APPSCRIPT = '$$vsn=shift; $$mods=""; while(@ARGV){ $$_=shift; s/^([A-Z].*)$$/\'\''$$1\'\''/; $$mods.=", " if $$mods; $$mods .= $$_; } while(<>) { s/%VSN%/$$vsn/; s/%MODULES%/$$mods/; print; }'
+APPSCRIPT = '$$vsn=shift; $$mods=""; while(@ARGV){ $$_=shift; s/^([A-Z].*)$$/\'\''$$1\'\''/; $$mods.=", " if $$mods; $$mods .= $$_; } while(<>) { s/\{vsn, git\}/\{vsn, $$vsn\}/; s/\{modules,\[\]\}/\{modules,\[$$mods\]\}/; print; }'
# Targets
View
2  applications/wiki/include.mk
@@ -33,7 +33,7 @@ INSTALL_DATA=${INSTALL} -m 644
# Hmm, don't know if you are supposed to like this better... ;-)
-APPSCRIPT = '$$vsn=shift; $$mods=""; while(@ARGV){ $$_=shift; s/^([A-Z].*)$$/\'\''$$1\'\''/; $$mods.=", " if $$mods; $$mods .= $$_; } while(<>) { s/%VSN%/$$vsn/; s/%MODULES%/$$mods/; print; }'
+APPSCRIPT = '$$vsn=shift; $$mods=""; while(@ARGV){ $$_=shift; s/^([A-Z].*)$$/\'\''$$1\'\''/; $$mods.=", " if $$mods; $$mods .= $$_; } while(<>) { s/\{vsn, git\}/\{vsn, $$vsn\}/; s/\{modules,\[\]\}/\{modules,\[$$mods\]\}/; print; }'
# Targets
View
4 c_src/Makefile
@@ -26,8 +26,8 @@ CFLAGS += -I/usr/include/pam/ $(EXTRAINCLUDE)
# Targets
#
-all: $(PRIV_FILES)
-debug:
+all: $(PRIV_FILES)
+debug:
CFLAGS="$(CFLAGS) -g" $(MAKE) all
clean:
View
10 c_src/yaws_sendfile_drv.c
@@ -2,6 +2,8 @@
/* author: vinoski@ieee.org */
/* Created : 09 Nov 2008 by Steve Vinoski <vinoski@ieee.org> */
+#ifdef HAVE_SENDFILE
+
#include <errno.h>
#include <stdint.h>
#include <sys/types.h>
@@ -15,8 +17,6 @@
#elif (defined(__APPLE__) && defined(__MACH__)) || defined(__FreeBSD__)
#include <sys/socket.h>
#include <sys/uio.h>
-#else
-#error "yaws_sendfile_drv not supported on this platform"
#endif
#include "erl_driver.h"
@@ -299,3 +299,9 @@ DRIVER_INIT(yaws_sendfile_drv)
{
return &yaws_sendfile_driver_entry;
}
+
+#else
+
+#error "yaws_sendfile_drv not supported on this platform"
+
+#endif /* HAVE_SENDFILE */
View
0  src/benchmarks/README → contrib/benchmarks/README
File renamed without changes
View
0  src/benchmarks/all.erl → contrib/benchmarks/all.erl
File renamed without changes
View
0  src/benchmarks/bench.erl → contrib/benchmarks/bench.erl
File renamed without changes
View
0  src/benchmarks/bench.hrl → contrib/benchmarks/bench.hrl
File renamed without changes
View
0  src/benchmarks/conc_path_bm.erl → contrib/benchmarks/conc_path_bm.erl
File renamed without changes
View
0  src/yaws_content_negotiation.erl → contrib/yaws_content_negotiation.erl
File renamed without changes
View
0  src/contrib/yaws_mnesia_session.erl → contrib/yaws_mnesia_session.erl
File renamed without changes
View
0  src/yaws_showarg.erl → contrib/yaws_showarg.erl
File renamed without changes
View
0  src/ymnesia.erl → contrib/ymnesia.erl
File renamed without changes
View
10 include.mk.in
@@ -43,6 +43,9 @@ endif
CC=@CC@
CFLAGS=@CFLAGS@
+ifeq ($(HAVE_SENDFILE),true)
+CFLAGS += -DHAVE_SENDFILE
+endif
LINKER=@LINKER@
LDFLAGS=@LDFLAGS@
WIN32=@WIN32@
@@ -88,14 +91,14 @@ endif
# Hmm, don't know if you are supposed to like this better... ;-)
-APPSCRIPT = '$$vsn=shift; $$mods=""; while(@ARGV){ $$_=shift; s/^([A-Z].*)$$/\'\''$$1\'\''/; $$mods.=", " if $$mods; $$mods .= $$_; } while(<>) { s/%VSN%/$$vsn/; s/%MODULES%/$$mods/; print; }'
+APPSCRIPT = '$$vsn=shift; $$mods=""; while(@ARGV){ $$_=shift; s/^([A-Z].*)$$/\'\''$$1\'\''/; $$mods.=", " if $$mods; $$mods .= $$_; } while(<>) { s/\{vsn, git\}/\{vsn, $$vsn\}/; s/\{modules,\[\]\}/\{modules,\[$$mods\]\}/; print; }'
# Targets
../ebin/%.app: %.app.src ../vsn.mk Makefile
perl -e $(APPSCRIPT) "$(VSN)" $(MODULES) < $< > $@
-../ebin/%.appup: %.appup
+../ebin/%.appup: %.appup
cp $< $@
../ebin/%.$(EMULATOR): %.erl
@@ -103,6 +106,3 @@ APPSCRIPT = '$$vsn=shift; $$mods=""; while(@ARGV){ $$_=shift; s/^([A-Z].*)$$/\'\
%.$(EMULATOR): %.erl
$(ERLC) $(ERLC_FLAGS) $<
-
-
-
View
18 rebar.config
@@ -0,0 +1,18 @@
+%% -*- mode: erlang;erlang-indent-level: 4;indent-tabs-mode: nil -*-
+%% ex: ft=erlang ts=4 sw=4 et
+
+{erl_opts, [{platform_define,
+ "(linux|freebsd|darwin)", 'HAVE_SENDFILE'},
+ no_debug_info]}.
+
+{port_envs, [{"CFLAGS", "$CFLAGS -g -O3 -Wall -I/usr/include/security"},
+ {"(linux|freebsd|dragonfly|solaris|darwin)",
+ "DRV_CFLAGS", "$DRV_CFLAGS -DHAVE_SENDFILE"}]}.
+
+{so_specs, [{"priv/lib/epam.so", ["c_src/epam.o"]},
+ {"priv/lib/setuid_drv.so", ["c_src/setuid_drv.o"]},
+ {"priv/lib/yaws_sendfile_drv.so",
+ ["c_src/yaws_sendfile_drv.o", "c_src/hashtable.o"]}]}.
+
+{pre_hooks, [{compile, "./scripts/rebar-pre-script"},
+ {clean, "./scripts/rebar-pre-script clean"}]}.
View
6 scripts/Install 100644 → 100755
@@ -84,9 +84,9 @@ elif [ "`uname -s`" = "FreeBSD" ]; then
sed -e "s;%prefix%;$p;g" -e "s;%etcdir%;$e;g" freebsd/yaws.sh > ${destdir}${etcdir}/rc.d/yaws.sh
elif [ "`uname -s`" = "NetBSD" ]; then
sed -e "s;%prefix%;$p;g" -e "s;%etcdir%;$e;g" netbsd/yaws.sh > /etc/rc.d/yaws
-else
- install -d ${destdir}${etcdir}
- echo "Don't know how to make /etc/init scrips for this system"
+else
+ install -d ${destdir}${etcdir}
+ echo "Don't know how to make /etc/init scripts for this system"
echo "possibly add ${prefix}/bin/yaws --daemon --heart to your /etc/rc.local manually"
fi
View
62 scripts/Makefile
@@ -4,50 +4,18 @@ include ../include.mk
all debug: ../bin/yaws yaws.conf
../bin/yaws: yaws.template
- cat yaws.template | \
- ./Subst %yawsdir% "`pwd`/.." | \
- ./Subst %vardir% "$(VARDIR)" | \
- ./Subst %run_erl% "$(ERLBINDIR)/run_erl" | \
- ./Subst %to_erl% "$(ERLBINDIR)/to_erl" | \
- ./Subst %erl% $(ERL) | \
- ./Subst %werl% $(WERL) > ../bin/yaws
- chmod +x ../bin/yaws
+ VARDIR='$(VARDIR)' ERLBINDIR='$(ERLBINDIR)' \
+ ERL='$(ERL)' WERL='$(WERL)' ./gen-yaws > $@
+ chmod +x $@
local_install: ../bin/yaws
- @install -d $$HOME/yaws_logs
- @if [ -f $$HOME/yaws.conf ]; \
- then target=$$HOME/yaws.conf.template; \
- else \
- target=$$HOME/yaws.conf; \
- fi; \
- echo "--- Installing local config file at $${target} "; \
- cat yaws.conf.template | \
- ./Subst %yawsdir% "`pwd`/.." | \
- ./Subst %logdir% $$HOME/yaws_logs | \
- ./Subst %host% `hostname` | \
- ./Subst %port% 8000 | \
- ./Subst %vardir% "$(VARDIR)" | \
- ./Subst %docroot% `pwd`/../www | \
- ./Subst %certdir% `pwd`/../ssl | \
- ./Subst %sslport% 4443 > $${target}; \
- $(INSTALL) -d $$HOME/bin; \
- rm $$HOME/bin/yaws 2> /dev/null; \
- cp -f ../bin/yaws $$HOME/bin/yaws; \
- echo "--- Installed $$HOME/bin/yaws"
-
+ VARDIR='$(VARDIR)' ./local-install
yaws.conf:
- @echo PREFIX is $(PREFIX)
- cat yaws.conf.template | \
- ./Subst %yawsdir% "$(PREFIX)/lib/yaws" | \
- ./Subst %logdir% "$(PREFIX)/var/log/yaws" | \
- ./Subst %vardir% "$(VARDIR)" | \
- ./Subst %host% `hostname` | \
- ./Subst %port% 80 | \
- ./Subst %docroot% "$(VARDIR)/yaws/www" | \
- ./Subst %certdir% "$(ETCDIR)/yaws" | \
- ./Subst %sslport% 443 > yaws.conf
+ YAWSDIR='$(PREFIX)/lib/yaws' LOGDIR='$(PREFIX)/var/log/yaws' \
+ VARDIR='$(VARDIR)' PORT=80 DOCROOT='$(VARDIR)/yaws/www' \
+ CERTDIR='$(ETCDIR)/yaws' SSLPORT=443 ./gen-yaws-conf > $@
clean:
rm -f ../bin/yaws yaws.conf
@@ -55,16 +23,6 @@ clean:
install: .install
.install:
- -rm -rf /tmp/yaws 2> /dev/null
- sh ./Install $(PREFIX) $(ERL) \
- $(WERL) $(ETCDIR)/ $(VARDIR)/ $(ERLBINDIR)/ $(DESTDIR)
- @if [ -f $(DESTDIR)$(ETCDIR)/yaws/yaws.conf ]; \
- then echo "Keeping old config file "; \
- cp yaws.conf $(DESTDIR)$(ETCDIR)/yaws/yaws.conf.template; \
- else \
- echo "Installing $(DESTDIR)$(ETCDIR)/yaws/yaws.conf"; \
- mkdir -p $(DESTDIR)$(ETCDIR)/yaws; \
- cp yaws.conf $(DESTDIR)$(ETCDIR)/yaws/yaws.conf; \
- fi
- @cp ../ssl/yaws-cert.pem $(DESTDIR)$(ETCDIR)/yaws
- @cp ../ssl/yaws-key.pem $(DESTDIR)$(ETCDIR)/yaws
+ PREFIX='$(PREFIX)' ETCDIR='$(ETCDIR)' VARDIR='$(VARDIR)' \
+ ERLBINDIR='$(ERLBINDIR)' DESTDIR='$(DESTDIR)' \
+ ERL='$(subst ",,$(ERL))' WERL='$(subst ",,$(WERL))' ./regular-install
View
6 scripts/Subst
@@ -3,10 +3,10 @@
p=$1
-if [ `uname -a | fgrep -c Cygwin` != 0 ]; then
- d=`cygpath -m "$2"`
+if [ `uname -a | fgrep -c Cygwin` != 0 ]; then
+ d=`cygpath -m "$2"`
else
- d=$2
+ d=$2
fi
sed -e "s;$p;$d;g"
View
17 scripts/gen-yaws
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+# Used by scripts/Makefile and scripts/rebar-pre-script to generate
+# the yaws execution script
+
+set -e
+
+topdir=`cd .. && pwd`
+cat yaws.template | \
+ ./Subst %yawsdir% "${topdir}" | \
+ ./Subst %vardir% "${VARDIR}" | \
+ ./Subst %run_erl% "${ERLBINDIR}/run_erl" | \
+ ./Subst %to_erl% "${ERLBINDIR}/to_erl" | \
+ ./Subst %erl% "${ERL}" | \
+ ./Subst %werl% "${WERL}"
+
+exit 0
View
21 scripts/gen-yaws-conf
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+# Used by scripts/Makefile and scripts/rebar-pre-script to create
+# the yaws.conf file
+
+set -e
+
+[ -d "${VARDIR}/yaws" ] || mkdir "${VARDIR}/yaws"
+[ -d "${VARDIR}/yaws/ebin" ] || mkdir "${VARDIR}/yaws/ebin"
+
+cat yaws.conf.template | \
+ ./Subst %yawsdir% "$YAWSDIR" | \
+ ./Subst %logdir% "$LOGDIR" | \
+ ./Subst %vardir% "$VARDIR" | \
+ ./Subst %host% `hostname` | \
+ ./Subst %port% $PORT | \
+ ./Subst %docroot% "$DOCROOT" | \
+ ./Subst %certdir% "$CERTDIR" | \
+ ./Subst %sslport% $SSLPORT
+
+exit 0
View
14 scripts/gen-yaws-generated
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+# Used by src/Makefile and scripts/rebar-pre-script to create the
+# yaws_generated.erl file
+
+set -e
+
+cat yaws_generated.template | \
+ ../scripts/Subst %VSN% "${YAWS_VSN}" | \
+ ../scripts/Subst %VARDIR% "${VARDIR}" | \
+ ../scripts/Subst %localinstall% $1 | \
+ ../scripts/Subst %ETCDIR% "${ETCDIR}"
+
+exit 0
View
35 scripts/local-install
@@ -0,0 +1,35 @@
+#!/bin/sh
+
+# Used by scripts/Makefile and scripts/rebar-pre-script to do a local
+# install of yaws
+
+set -e
+
+if [ -z "$HOME" ]; then
+ if [ `id -u` = 0 -a -d /root ]; then
+ export HOME=/root
+ else
+ export HOME=/tmp
+ fi
+fi
+
+logdir="${HOME}/yaws_logs"
+[ -d $logdir ] || mkdir $logdir
+if [ -f "${HOME}/yaws.conf" ]; then
+ echo "--- Will not overwrite ${HOME}/yaws.conf"
+ target="${HOME}/yaws.conf.template"
+else
+ target="${HOME}/yaws.conf"
+fi
+echo "--- Installing local config file at $target"
+
+topdir=`cd .. && pwd`
+YAWSDIR="$topdir" LOGDIR="$logdir" VARDIR="$VARDIR" PORT=8000 \
+ DOCROOT="${topdir}/www" CERTDIR="${topdir}/ssl" SSLPORT=4443 \
+ ./gen-yaws-conf > $target
+[ -d "${HOME}/bin" ] || mkdir "${HOME}/bin"
+rm -f "${HOME}/bin/yaws"
+cp -f ../bin/yaws "${HOME}/bin/yaws"
+echo "--- Installed $HOME/bin/yaws"
+
+exit 0
View
69 scripts/rebar-pre-script
@@ -0,0 +1,69 @@
+#!/bin/sh
+
+YAWS_DIR=`pwd`
+DEFAULT_YAWS_VSN=`sed -e 's/^.*=//' $YAWS_DIR/vsn.mk 2>/dev/null`
+YAWS_VSN=${VSN-$DEFAULT_YAWS_VSN}
+YAWS_VARDIR=${VARDIR-$YAWS_DIR/var}
+YAWS_ETCDIR=${ETCDIR-$YAWS_DIR/etc}
+ERL_BIN=`which erl`
+ERL_BIN_DIR=${ERL_BIN%/erl}
+YAWS_ERLBINDIR=${ERLBINDIR-$ERL_BIN_DIR}
+ERL_BIN=$YAWS_ERLBINDIR/erl
+WERL_BIN=$YAWS_ERLBINDIR/werl
+
+# For rebar, support only local install for the yaws script.
+YAWS_LOCALINSTALL=true
+
+# Use a function for error exit instead of set -e so we can conditionally
+# remove files before exiting. If this were bash we could trap ERR but
+# Bourne shell doesn't support that portably.
+fail() {
+ [ -n "$@" ] && rm -f "$@"
+ exit 1
+}
+
+cd src || fail
+
+if [ "$1" = clean ]; then
+ rm -f mime_types.erl charset.def yaws_configure.hrl yaws_generated.erl
+ exit 0
+fi
+
+CHARSET=${DEFAULT_CHARSET-""}
+need_mime=yes
+if [ -f mime_types.erl ]; then
+ need_mime=`find mime_type_c.erl -newer mime_types.erl -print`
+fi
+if [ -n "$need_mime" ]; then
+ echo ${CHARSET} > charset.def || fail
+ erlc -o ../ebin mime_type_c.erl || fail charset.def
+ erl -pa ../ebin -noshell -s mime_type_c compile || \
+ fail charset.def mime_types.erl
+fi
+
+if [ ! -f yaws_configure.hrl ]; then
+ echo '%% rebar sets HAVE_SENDFILE in erlc command line' > yaws_configure.hrl
+ [ $? -eq 0 ] || fail
+fi
+YAWS_VSN=$YAWS_VSN VARDIR="$YAWS_VARDIR" ETCDIR="$YAWS_ETCDIR" \
+ ../scripts/gen-yaws-generated $YAWS_LOCALINSTALL >yaws_generated.erl || fail
+[ -d "$YAWS_VARDIR" ] || mkdir "$YAWS_VARDIR" || fail
+[ -d "$YAWS_ETCDIR" ] || mkdir "$YAWS_ETCDIR" || fail
+
+cd ../scripts
+
+case $YAWS_LOCALINSTALL in
+ true)
+ VARDIR="${YAWS_VARDIR}" ERLBINDIR="${YAWS_ERLBINDIR}" \
+ ERL="${ERL_BIN}" WERL="${WERL_BIN}" ./gen-yaws > ../bin/yaws || fail
+ test -x ../bin/yaws || chmod +x ../bin/yaws || fail
+ VARDIR="${YAWS_VARDIR}" ./local-install || fail
+ ;;
+ *)
+ echo "ERROR: Configurations other than 'localinstall' not yet \
+ supported with rebar"
+ exit 1
+ ;;
+esac
+
+exit 0
View
26 scripts/regular-install
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+# Used by scripts/Makefile and scripts/rebar-pre-script to
+# install yaws
+
+rm -rf /tmp/yaws 2>/dev/null
+
+set -e
+
+./Install ${PREFIX} ${ERL} ${WERL} ${ETCDIR}/ ${VARDIR}/ ${ERLBINDIR}/ ${DESTDIR}
+
+conffile="${DESTDIR}${ETCDIR}/yaws/yaws.conf"
+if [ -f "$conffile" ]; then
+ echo "Keeping old config file $conffile"
+ cp yaws.conf "${conffile}.template"
+else
+ echo "Installing $conffile"
+ mkdir "$DESTDIR"
+ mkdir "${DESTDIR}${ETCDIR}"
+ mkdir "${DESTDIR}${ETCDIR}/yaws"
+ cp yaws.conf "$conffile"
+fi
+cp ../ssl/yaws-cert.pem "${DESTDIR}${ETCDIR}/yaws"
+cp ../ssl/yaws-key.pem "${DESTDIR}${ETCDIR}/yaws"
+
+exit 0
View
111 scripts/yaws.conf.template
@@ -1,138 +1,113 @@
# conf for yaws
-
-# first we have a set of globals
-# That apply to all virtual servers
-
+# First we have a set of globals that apply to all virtual servers
# This is the directory where all logfiles for
-# all virtual servers will be written
-
+# all virtual servers will be written.
logdir = %logdir%
-# This the path to a directory where additional
-# beam code can be placed. The daemon will add this
-# directory to its search path
-
+# These are the paths to directories where additional
+# beam code can be placed. The daemon will add these
+# directories to its search path.
ebin_dir = %yawsdir%/examples/ebin
ebin_dir = %vardir%/yaws/ebin
-
# This is a directory where application specific .hrl
-# files can be placed. application specifig .yaws code can
-# then include these .hrl files
-
+# files can be placed. Application-specific .yaws code can
+# then include these .hrl files.
include_dir = %yawsdir%/examples/include
# Set this to an integer value to control
-# max number of connections from clients into the server
+# max number of connections from clients into the server.
max_connections = nolimit
# Normally, yaws does not restrict the number of times a connection is
# kept alive using keepalive. Setting this parameter to an integer X
# will ensure that connections are closed once they have been used X times.
-# This can be a useful to guard against long running connections
-# collecting too much garbage in the erlang VM.
+# This can be a useful to guard against long running connections
+# collecting too much garbage in the Erlang VM.
keepalive_maxuses = nolimit
# Override the garbage collection option parameters for processes
-# which handle new connections. Useful for systems which expect long lived
-# connections which handle a lot of data. The default value is erlangs
+# that handle new connections. Useful for systems expecting long-lived
+# connections that handle a lot of data. The default value is Erlang's
# default. Valid options are {fullsweep_after, X} and/or {min_heap_size, Y} where
-# X and Y are integers. See erlangs erlang:spawn_opt/4 function for more details.
-# The value type is a quoted string containing an erlang proplist
+# X and Y are integers. See Erlang's erlang:spawn_opt/4 function for more
+# details. The value type is a quoted string containing an Erlang proplist.
process_options = "[]"
# This is a debug variable, possible values are http | traffic | false
# It is also possible to set the trace (possibly to the tty) while
# invoking yaws from the shell as in
-# yaws -i -T -x (see man yaws)
-
+# yaws -i -T -x (see man yaws).
trace = false
# Enable this if we want to use the old OTP ssl implementation
-# OTP R13B03 is known to work with this flag set to false (default)
+# OTP R13B03 is known to work with this flag set to false (default).
use_old_ssl = false
-
-# it is possible to have yaws start additional
-# application specific code at startup
-#
+# It is possible to have yaws start additional application-specific code at
+# startup. Set runmod to the name of the module you want yaws to start. It
+# assumes the module has an exported function start/0. To have multiple
+# runmods just add more "runmod = xyz" lines.
+#
# runmod = mymodule
-
# By default yaws will copy the erlang error_log and
-# end write it to a wrap log called report.log (in the logdir)
-# this feature can be turned off. This would typically
-# be the case when yaws runs within another larger app
-
+# append it to a wrap log called report.log (in the logdir).
+# This feature can be turned off. This would typically
+# be the case when yaws runs within another larger app.
copy_error_log = true
-
# Logs are wrap logs
-
log_wrap_size = 1000000
-
# Possibly resolve all hostnames in logfiles so webalizer
# can produce the nice geography piechart
-
log_resolve_hostname = false
-
-
-# fail completely or not if yaws fails
-# to bind a listen socket
+# Fail completely or not if yaws fails to bind a listen socket.
fail_on_bind_err = true
-
-
-
# If HTTP auth is used, it is possible to have a specific
# auth log.
-
auth_log = true
-
-# When we're running multiple yaws systems on the same
+# When we're running multiple yaws systems on the same
# host, we need to give each yaws system an individual
# name. Yaws will write a number of runtime files under
# ${HOME}/.yaws/yaws/${id}
# The default value is "default"
# If we're not planning to run multiple webservers on the
-# same host it's mych better to leave this value unset since
+# same host it's much better to leave this value unset since
# then all the ctl function (--stop et.el) work without having
# to supply the id.
-
+#
# id = myname
-
-# earlier versions of Yaws picked the first virtual host
+# Earlier versions of Yaws picked the first virtual host
# in a list of hosts with the same IP/PORT when the Host:
-# header doesn't match any name on any Host
+# header doesn't match any name on any Host.
# This is often nice in testing environments but not
-# acceptable in real live hosting scenarios
-# think http://suckmydick.bigcompany.com
-
+# acceptable in real-world hosting scenarios;
+# think http://porn.bigcompany.com
pick_first_virthost_on_nomatch = true
# If the HTTP client session is to be kept alive, wait this many
# milliseconds for a new request before timing out the connection. Note
# that infinity is a valid value but it's not recommended.
-
keepalive_timeout = 30000
-
-# and then a set of virtual servers
-# First two virthosted servers on the same IP (0.0.0.0)
-# in this case, but an explicit IP can be given as well
+# Now, a set of virtual servers.
+# The examples below first show two virthosted servers on the same IP (0.0.0.0)
+# in this case, but an explicit IP can be given as well.
<server %host%>
port = %port%
listen = 0.0.0.0
docroot = %docroot%
- appmods = <cgi-bin, yaws_appmod_cgi>
+ appmods = <cgi-bin, yaws_appmod_cgi>
</server>
<server localhost>
@@ -149,26 +124,16 @@ keepalive_timeout = 30000
</auth>
</server>
-
-
-# And then an ssl server
+# Now an SSL server
<server %host%>
port = %sslport%
docroot = /tmp
listen = 0.0.0.0
dir_listings = true
- <ssl>
+ <ssl>
keyfile = %certdir%/yaws-key.pem
certfile = %certdir%/yaws-cert.pem
depth = 0
</ssl>
</server>
-
-
-
-
-
-
-
-
View
2  scripts/yaws.template
@@ -7,7 +7,7 @@ run_erl="%run_erl%"
to_erl="%to_erl%"
# erlexec requires HOME to be set, and some distros
-# run /etc/rc scripts without HOME being set
+# run /etc/rc scripts without HOME being set
if [ -z "$HOME" ]; then
if [ `id -u` = 0 -a -d /root ]; then
export HOME=/root
View
40 src/Makefile
@@ -31,7 +31,6 @@ MODULES=yaws \
yaws_cgi \
yaws_zlib \
yaws_generated \
- mime_type_c \
mime_types \
yaws_session_server \
yaws_outmod \
@@ -63,7 +62,7 @@ ERLC_FLAGS+=-W $(DEBUG_FLAGS) -pa ../../yaws -I ../include
# Targets
#
-all: yaws_generated.erl yaws_configure.hrl $(EBIN_FILES)
+all: yaws_generated.erl yaws_configure.hrl $(EBIN_FILES)
dav:
$(MAKE) MODULES="$(MODULES) yaws_dav"
@@ -73,12 +72,9 @@ $(EBIN_FILES) : ../include/yaws.hrl ../include/yaws_api.hrl
../ebin/yaws_sendfile.$(EMULATOR): yaws_configure.hrl
yaws_generated.erl: yaws_generated.template ../vsn.mk
- . ../vsn.mk; \
- cat yaws_generated.template | \
- ../scripts/Subst %VSN% ${YAWS_VSN} | \
- ../scripts/Subst %VARDIR% ${VARDIR} | \
- ../scripts/Subst %localinstall% true | \
- ../scripts/Subst %ETCDIR% ${ETCDIR} > yaws_generated.erl
+ . ../vsn.mk ; \
+ YAWS_VSN='$(YAWS_VSN)' VARDIR='$(VARDIR)' ETCDIR='$(ETCDIR)' \
+ ../scripts/gen-yaws-generated true > yaws_generated.erl
yaws_configure.hrl: ../vsn.mk ../include.mk
set -x; \
@@ -88,27 +84,28 @@ yaws_configure.hrl: ../vsn.mk ../include.mk
## need to differentiate between local install and not
+.PHONY: regen
regen:
- . ../vsn.mk; \
- cat yaws_generated.template | \
- ../scripts/Subst %VSN% ${YAWS_VSN} | \
- ../scripts/Subst %VARDIR% ${VARDIR} | \
- ../scripts/Subst %localinstall% false | \
- ../scripts/Subst %ETCDIR% ${ETCDIR} > yaws_generated.erl
+ . ../vsn.mk ; \
+ YAWS_VSN='$(YAWS_VSN)' VARDIR='$(VARDIR)' ETCDIR='$(ETCDIR)' \
+ ../scripts/gen-yaws-generated false > yaws_generated.erl
-charset.def:
- if [ ! -z "$(DEFAULT_CHARSET)" ]; then \
- echo $(DEFAULT_CHARSET) > charset.def; \
- else rm charset.def 2> /dev/null; touch charset.def; fi
+charset.def:
+ if [ -n "$(DEFAULT_CHARSET)" ]; then \
+ echo $(DEFAULT_CHARSET) > charset.def; \
+ else rm -f charset.def ; touch charset.def; fi
-mime_types.erl: mime.types mime_type_c.erl charset.def
- $(ERL) -noshell -pa ../ebin -s mime_type_c compile
+mime_type_c.beam: mime_type_c.erl
+
+mime_types.erl: mime.types charset.def mime_type_c.beam
+ $(ERL) -noshell -pa ../ebin -s mime_type_c compile
debug:
$(MAKE) TYPE=debug
clean:
- rm -f $(EBIN_FILES) yaws_generated.erl charset.def mime_types.erl yaws_configure.hrl ../ebin/*.beam
+ rm -f $(EBIN_FILES) yaws_generated.erl charset.def \
+ mime_types.erl yaws_configure.hrl
install: regen all docsinstall
$(INSTALL) -d $(DESTDIR)$(PREFIX)/lib/yaws/examples/ebin
@@ -120,7 +117,6 @@ install: regen all docsinstall
(cd ..; tar cf - ebin ) | (cd $(DESTDIR)$(PREFIX)/lib/yaws; tar xf - )
(cd ..; tar cf - include ) | (cd $(DESTDIR)$(PREFIX)/lib/yaws; tar xf - )
(cd ..; tar cf - priv/*.xsd ) | (cd $(DESTDIR)$(PREFIX)/lib/yaws; tar xf - )
- $(RM) yaws_generated.erl ../ebin/yaws_generated.beam 2>/dev/null || true
docsinstall:
$(INSTALL) -d $(DESTDIR)$(VARDIR)/yaws/www
View
2  src/mime_type_c.erl
@@ -16,7 +16,7 @@
compile() ->
R = (catch c()),
- io:format("~p~n ",[R]),
+ io:format("~p~n",[R]),
erlang:halt().
View
3  src/patches/README
@@ -1,3 +0,0 @@
-
-This dir contains some patches that may be interesting
-for backporters
View
132 src/patches/dos-http-header.patch
@@ -1,132 +0,0 @@
-Index: yaws.erl
-===================================================================
---- yaws.erl (revision 1380)
-+++ yaws.erl (working copy)
-@@ -1793,7 +1803,7 @@
- closed ->
- closed;
- R ->
-- H = http_collect_headers(CliSock, R, #headers{}, SSL),
-+ H = http_collect_headers(CliSock, R, #headers{}, SSL, 0),
- {R, H}
- end.
-
-@@ -1820,57 +1830,70 @@
-
-
-
--http_collect_headers(CliSock, Req, H, SSL) ->
-+http_collect_headers(CliSock, Req, H, SSL, Count) when Count < 1000 ->
- Recv = do_recv(CliSock, 0, SSL),
- case Recv of
- {ok, {http_header, _Num, 'Host', _, Host}} ->
-- http_collect_headers(CliSock, Req, H#headers{host = Host},SSL);
-+ http_collect_headers(CliSock, Req, H#headers{host = Host},
-+ SSL, Count+1);
- {ok, {http_header, _Num, 'Connection', _, Conn}} ->
- http_collect_headers(CliSock, Req,
-- H#headers{connection = Conn},SSL);
-+ H#headers{connection = Conn},SSL, Count+1);
- {ok, {http_header, _Num, 'Accept', _, Accept}} ->
-- http_collect_headers(CliSock, Req, H#headers{accept = Accept},SSL);
-+ http_collect_headers(CliSock, Req, H#headers{accept = Accept},
-+ SSL, Count+1);
- {ok, {http_header, _Num, 'If-Modified-Since', _, X}} ->
- http_collect_headers(CliSock, Req,
-- H#headers{if_modified_since = X},SSL);
-+ H#headers{if_modified_since = X},SSL, Count+1);
- {ok, {http_header, _Num, 'If-Match', _, X}} ->
-- http_collect_headers(CliSock, Req, H#headers{if_match = X},SSL);
-+ http_collect_headers(CliSock, Req, H#headers{if_match = X},
-+ SSL, Count+1);
- {ok, {http_header, _Num, 'If-None-Match', _, X}} ->
- http_collect_headers(CliSock, Req,
-- H#headers{if_none_match = X},SSL);
-+ H#headers{if_none_match = X},SSL, Count+1);
- {ok, {http_header, _Num, 'If-Range', _, X}} ->
-- http_collect_headers(CliSock, Req, H#headers{if_range = X},SSL);
-+ http_collect_headers(CliSock, Req, H#headers{if_range = X},
-+ SSL, Count+1);
- {ok, {http_header, _Num, 'If-Unmodified-Since', _, X}} ->
- http_collect_headers(CliSock, Req,
-- H#headers{if_unmodified_since = X},SSL);
-+ H#headers{if_unmodified_since = X},SSL,
-+ Count+1);
- {ok, {http_header, _Num, 'Range', _, X}} ->
-- http_collect_headers(CliSock, Req, H#headers{range = X},SSL);
-+ http_collect_headers(CliSock, Req, H#headers{range = X},
-+ SSL, Count+1);
- {ok, {http_header, _Num, 'Referer',_, X}} ->
-- http_collect_headers(CliSock, Req, H#headers{referer = X},SSL);
-+ http_collect_headers(CliSock, Req, H#headers{referer = X},
-+ SSL, Count+1);
- {ok, {http_header, _Num, 'User-Agent', _, X}} ->
-- http_collect_headers(CliSock, Req, H#headers{user_agent = X},SSL);
-+ http_collect_headers(CliSock, Req, H#headers{user_agent = X},
-+ SSL, Count+1);
- {ok, {http_header, _Num, 'Accept-Ranges', _, X}} ->
- http_collect_headers(CliSock, Req,
-- H#headers{accept_ranges = X},SSL);
-+ H#headers{accept_ranges = X},SSL, Count+1);
- {ok, {http_header, _Num, 'Cookie', _, X}} ->
- http_collect_headers(CliSock, Req,
-- H#headers{cookie = [X|H#headers.cookie]},SSL);
-+ H#headers{cookie = [X|H#headers.cookie]},
-+ SSL, Count+1);
- {ok, {http_header, _Num, 'Keep-Alive', _, X}} ->
-- http_collect_headers(CliSock, Req, H#headers{keep_alive = X},SSL);
-+ http_collect_headers(CliSock, Req, H#headers{keep_alive = X},
-+ SSL, Count+1);
- {ok, {http_header, _Num, 'Content-Length', _, X}} ->
- http_collect_headers(CliSock, Req,
-- H#headers{content_length = X},SSL);
-+ H#headers{content_length = X},SSL,
-+ Count+1);
- {ok, {http_header, _Num, 'Content-Type', _, X}} ->
- http_collect_headers(CliSock, Req,
-- H#headers{content_type = X},SSL);
-+ H#headers{content_type = X},SSL, Count+1);
- {ok, {http_header, _Num, 'Transfer-Encoding', _, X}} ->
- http_collect_headers(CliSock, Req,
-- H#headers{transfer_encoding=X},SSL);
-+ H#headers{transfer_encoding=X},SSL, Count+1);
- {ok, {http_header, _Num, 'Location', _, X}} ->
-- http_collect_headers(CliSock, Req, H#headers{location=X},SSL);
-+ http_collect_headers(CliSock, Req, H#headers{location=X},
-+ SSL, Count+1);
- {ok, {http_header, _Num, 'Authorization', _, X}} ->
- http_collect_headers(CliSock, Req,
-- H#headers{authorization = parse_auth(X)},SSL);
-+ H#headers{authorization = parse_auth(X)},
-+ SSL, Count+1);
-
- {ok, http_eoh} ->
- H;
-@@ -1879,19 +1902,23 @@
- %% bad (typically test script) clients
-
- {error, {http_error, "\r\n"}} ->
-- http_collect_headers(CliSock, Req, H,SSL);
-+ http_collect_headers(CliSock, Req, H,SSL, Count+1);
- {error, {http_error, "\n"}} ->
-- http_collect_headers(CliSock, Req, H,SSL);
-+ http_collect_headers(CliSock, Req, H,SSL, Count+1);
-
- %% auxilliary headers we don't have builtin support for
- {ok, X} ->
- ?Debug("OTHER header ~p~n", [X]),
- http_collect_headers(CliSock, Req,
-- H#headers{other=[X|H#headers.other]},SSL);
-+ H#headers{other=[X|H#headers.other]},
-+ SSL, Count+1);
- _Err ->
- exit(normal)
-
-- end.
-+ end;
-+http_collect_headers(_CliSock, _Req, _H, _SSL, _Count) ->
-+ error_logger:format("Max num headers - DOS attack closing\n", []),
-+ exit(normal).
-
-
-
View
4 src/yaws.app.src
@@ -1,7 +1,7 @@
{application,yaws,
[{description,"yaws WWW server"},
- {vsn,"%VSN%"},
- {modules,[%MODULES%]},
+ {vsn, git},
+ {modules,[]},
{registered, []},
{mod,{yaws_app,[]}},
{env, [
View
4 src/yaws_generated.template
@@ -1,7 +1,7 @@
%%%----------------------------------------------------------------------
%%% File : yaws_generated.template
%%% Author : Klacke <klacke@bluetail.com>
-%%% Purpose :
+%%% Purpose :
%%% Created : 10 Jun 2002 by Klacke <klacke@bluetail.com>
%%%----------------------------------------------------------------------
@@ -19,5 +19,5 @@ vardir() -> "%VARDIR%".
etcdir() -> "%ETCDIR%".
is_local_install() -> %localinstall%.
-
+
View
3  www/news
@@ -1,3 +1,6 @@
+Sat May 7 09:16:04 EDT 2011 added rebar support
+Yaws can now be built with rebar (Tuncer Ayaz and Steve Vinoski)
+
Sun May 1 10:35 PM EDT 2011 JSON-RPC 2.0
Updated Yaws JSON-RPC support to version 2.0 (Steve Vinoski)
Please sign in to comment.
Something went wrong with that request. Please try again.