The default yaws.app file specifies only kernel and stdlib as application dependencies, but depending on how it's used, Yaws can also depend on the crypto and compiler applications. If these are used but are missing from the yaws.app file, building an Erlang/OTP release will fail. Add --enable-crypto and --enable-compiler options to the configure script to allow the user to add either or both of these applications to the yaws.app file. Specifying the --enable-crypto option also causes the Yaws startup code to start the crypto application; likewise for --enable-compiler and the compiler application. For rebar builds, enhance rebar.config.script to generate the same files the configure script generates for any extra app dependencies.
Thanks to Richard Carlsson for pointing out this unused option.
Setting the OS environment variable YAWS_DISABLE_PAM to any value causes rebar builds to avoid building pam. This is equivalent to using the --disable-pam option with configure, and is useful for building in environments where pam development files are not available.
The yaws_ticker processes were not cleaned up due to an incorrect EXIT message receive spec. Thanks to Nico Kruber for reporting the problem, and for supplying a new regression test case which is now in the test/eunit directory.
During a reload, when a virtual host is added or updated, it must be at the same position than in the configuration file. With this fix, it is possible to reorder virtual hosts, or add new ones at any position.
Richard Carlsson pointed out in a private email that having configure generate the priv/charset.def file to be read and interpreted by src/mime_type_c.erl was overly complicated. Modify configure script and rebar.config.script to instead generate src/yaws_charset.hrl, and include that into src/mime_type_c.erl. Thanks to Richard for suggesting these simplifications. Also, enhance rebar.config.script to be able to extract the desired charset from the YAWS_CHARSET OS environment variable if set, thus providing rebar users a way to set the charset, which they couldn't do before. Fix test/t2/app_test.erl to not fail on Content-Type header tests if the header value contains a charset specification.
On OS X (and perhaps elsewhere too) there were tons of false errors in the test output, all coming from the ibrowse client complaining about closed connections. This made it impossible to know whether the tests were actually working or not. Instead of using ibrowse master, pin the version the yaws tests use to 3.0.4, which doesn't exhibit this problem.
Make configure script check for the pam_appl.h header in multiple directories, and add the directory in which it's found to CFLAGS. Ensure the checking takes EXTRAINCLUDE settings into account. Remove specifications of the /usr/include/pam include path from CFLAGS in the configure script, and also from c_src/Makefile, as it's no longer necessary to specify that path explicitly. Add EXTRAINCLUDE to CFLAGS and CPPFLAGS when pam is enabled (note that adding it to CPPFLAGS is needed so the new configure checking for pam_appl.h works correctly), and remove the addition of EXTRAINCLUDE to CFLAGS in c_src/Makefile. Add check for pam library. Fix checking of the --disable-pam configure option. Thanks to Antoine Catton for starting the work on these changes.
According to HTTP 1.1 section 4.2, a receiver may combine multiple instances of any header whose value can be a comma-separated list, which applies to the case of receiving multiple Accept-Encoding headers. HTTPbis in section 3.2.2 keeps the same rule. Yaws was using only the first such header and ignoring any others, but should instead be combining the multiple Accept-Encoding headers into one before processing the combined value. This commit fixes that and adds a new test case for it.
…ntimed_stream_loop_send fixed by Martin Bjorklund.
…tead on relying on flags to erlc to find the included file
Documentation for cookies used the old yaws_api:setcookie functions, which are deprecated. Change the docs to use yaws_api:set_cookie/3 instead. Also add a little more detail to cookies.yaws regarding how yaws_api:set_cookie/3 is used and what it returns.
The now() call requires global locking to ensure monotonicity, so replace some calls to now() with calls to os:timestamp() where monotonicity isn't required. There are probably other such calls in other modules that can be similarly replaced. Calculate size of data sent only when stats requires it.