This module was moved a long time ago in example/src.
Without this fix, at the Yaws startup, the mime_types.erl generation fails on windows when Yaws is installed using the installer. It also fails for Yaws releases built with reltool (using rebar or autotools). Fix issue #161.
I was trying to install with rebar compile and kept getting the failure that the ibrowse dependency wasn't available. Once I did a rebar get-deps, the rebar compile seemed to have gone through.
Now, at compile time, we only check if sendfile syscall and file:sendfile/5 are supported. Then, dynamically, we can configure which version to use. This can be done using the directive large_file_sendfile. Supported values are: * erlang: if supported, use file:sendfile/5 * yaws: if supported, use the Yaws sendfile linked-in driver * disable: do not use any sendfile method, but gen_tcp:send/2 If an unsupported method is configured, we fall back on gen_tcp:send/2. file:sendfile/5 implementation is buggy (in R15 & R16). When async-threads are enabled, in efile driver, the tcp socket is set in blocking mode and the sendfile syscall is executed on an async-thread. So an unresponsive client could block it for a very long time and therefore block the async-thread. In this way, all async-threads could be easily blocked. So, by default, the use of sendfile is disable.
By adding a "<listen_opts> ... </listen_opts>" block in vhosts configuration, it is possible to define some options to be set on listen sockets and, by inheritance, on accepted sockets. Supported options are (see inet:setopts for details): * buffer * delay_send * linger * nodelay * priority * sndbuf * recbuf * send_timeout * send_timeout_close send_timeout / send_timeout_close options could be very useful to handle unresponsive clients and thus avoid some sorts of DoS.
Now it is possible to disable sendfile in yaws passing the option '--disable-senfile' (or '--enable-sendfile=no') to the configure script. It is also possible to choose between the erlang implementation (the default) and the yaws implementation.
fix a typo: "can be override" => "can be overridden"
When X-Forwarded-For header appears multiple times in a request only the last value is supplied by yaws_api:headers_x_forwarded_for/1. RFC 2616 section 4.2 permits multiple headers with the same name as an equivalent of one header with a comma-separated list of values. http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2 Pound loadbalancer ( http://www.apsis.ch/pound ) repeats the header. Change yaws to collect all values for this header and present them as a single comma-separated list. Add a regression test to test/t2.
… it was assumed we had a TCP socket, crashed on SSL sockets
yaws_session_server:print_sessions/0 not working due incorrect message
The yapp application relies on the yaws:setup_sconf/2 function, but at some point it was made private to yaws.erl. Export it so yapp works properly again.
This uses @capflam's patch from klacke#145 to create the log directory if specified like logdir = +path/to/log in the configuration file.
Fix runtime error on OpenBSD 5.3
This fixes the "Cannot load specified object" / setuid_drv.so: undefined symbol '__guard_local' error that occurs on OpenBSD 5.3. It changes the LD_SHARED variable to use gcc rather than ld. A similar issue is documented here: http://erlang.org/pipermail/erlang-questions/2013-May/073837.html. Tested on OpenBSD 5.3 and FreeBSD 9.
After 98db40b the check outputs: $ erl -noshell -eval 'code:load_file(file), io:format("~p~n",[[erlang:function_exported(file,sendfile,5)]]), erlang:halt().' [true] =ERROR REPORT==== 25-Jun-2013::09:40:51 === Can't load module that resides in sticky dir Use code:ensure_loaded/1 instead as suggested by Tuncer Ayaz. Fix similar module loading check in rebar.config.script.
rel: sync files with upstream templates
In R16B01, crypto:sha/1 is deprecated in favor of crypto:hash/2, but the latter is not available prior to R15B02. Change the configure script and rebar support to look for crypto:hash/2 and use it if found, otherwise fall back to crypto:sha/1. Also in R16B01 the public_key application, used by some of the tests, now requires the asn1 application to be started first. Change the tests to accommodate that.
Yaws cannot be compiled with R16B1.