start crypto app for yaws_session_server_test for R13
Fix doc errors
Remove invalid macro in yaws.hrl

?sc_set_ssl is never used and rely on the undefined macro ?SC_SSL.
handle case with DOS attack towards pam login with embedded NUL chars in username or password. The protocol cannot handle NUL chars and Yaws dies
Extend syntax of redirect block to allow an optional status code

Now, it is possible to change the HTTP status code used in redirect rules.
Supported formats are:

   Path = URL
   Path = code
   Path = code URL

* '==' syntax instead of '=' is always valid.
* If no status code is defined, Yaws will perform a 302 redirect.
* For 3xx status codes, the URL parameter must be present and will be used
  to build the new location.
* For other status codes (1xx, 2xx, 4xx and 5xx), it can be omitted. In the
  absence of URL, Yaws will return a generic response with the specified
  status code. Otherwise, the URL parameter must be a relative URL and will
  be used to customize the response.

For example:

  <redirect>
    /foo = http://yaws.hyber.org  # (1)
    /bar = 301 /foo               # (2)
    /baz = 404                    # (3)
    /qux = 403 /forbidden.yaws    # (4)
  </redirect>

(1) do a 302 redirect on 'http://yaws.hyber.org/foo/...'
(2) do a 301 redirect on 'scheme:host:port/bar/...'
(3) return a generic 404 error
(4) do a reentrant call to '/forbidden.yaws' by setting the status code
    to 403.

Note: this new feature is fully compatible with older one.
Take care to preserve the query-string in yaws_server:deliver_302/4

It is an old bug on the redirect made when the trailing slash is missing.
The query-string was always missing from the redirect URL. So now, we add
it explicitly.
skip sslaccept_tout_test for R15B03

An SSL bug introduced in R15B03 makes the sslaccept_tout_test fail. The bug
is explained here:

http://erlang.org/pipermail/erlang-bugs/2012-November/003208.html
http://erlang.org/pipermail/erlang-bugs/2012-November/003209.html

Check the Erlang version and skip that test for R15B03.
Fix compilation of mime_types.erl when working directory is not 'yaws'

When mime_types.erl is generated, we must check if it is done during a Yaws
compilation or a Yaws startup. In the first case, we must use a relative
path for includes. Else include_lib must be used.
This issue was reported by Andrei Zavada and avoid a compile error when the
working directory is not 'yaws'.

The mechanisms to generate and compile this file have also changed.

Then, to centralize calls to yaws_generated:is_local_install/0, following
functions was added in yaws.erl:
  get_app_dir/0, get_src_dir/0, get_ebin_dir/0, get_priv_dir/0, get_inc_dir/0
Fix io:format call in yaws_compile.

Basically, yaws_compile was unable to process items in some "unlucky"
paths on Win32.

NTFS may generate filenames in an MS-DOS compatible format if the
original filename is not compatible with the legacy 8.3 notation;
these filenames often contain tilde characters, which are inserted
(unquoted) in the Format parameter of io:format by the string
concatenation.

These unquoted tilde characters are processed as usual, leading to
a badarg error as the Data parameter is always an empty list.
Merge pull request #133 from olgeni/tilde_injection_fix

Fix io:format call in yaws_compile.
Support multipart/form-data "name" with backslash at the end.

Also add multipart/form-data tests ("name" with escaped characters).
Make be possible to chain appmods

Before, all appmods were disabled during a reentrent call. So it was
impossible to chain appmods. Now, it is possible. Only the current appmod
is disabled for the next recursion (if we are inside an appmod of course).

So if we have this configuration for appmods:

  appmods = </foo, foo> </bar, bar>

When "/foo" is requested, the appmon "foo" is called. At this step, it is
possible to call the appmod "bar" by returning {page, "/bar"}.
Add a clause to yaws_api:url_encode to handle deep lists
Keep info about the original request during a reentrant call

Some information must be preserved during a reentrant call. From the original
request, we keep:
  * buffered data (Arg#arg.clidata) and the number of bytes read
  * the request state (Arg#arg.cont & Arg#arg.state)
Fix a bug: redirect URL must be url-encoded
Flush remaining data in case of 3xx redirect

When Yaws returns a 3xx response, if the client connection is kept alive,
the remaining data must be flushed. Else the next request on the same
connection cannot be handled.
Update docs & testsuite accordingly
Fix when 'Expires' and 'Cache-Control' headers are set

Because the content-type of the response may change many times during the
request handling process, we must wait the #outh{} serialization to set it.

Note: 'Last-modified' header is also managed in a same way because there is
no good reason to set it before.
Fix checks on the response content type when a charset is present

When we test if a response is compressible or not, or when 'Expires' and
'Cache-Control' headers are set, the charset must be removed from the
response content-type to only keep the response mime-type.
Add support of the 'Vary' header in response

With this patch, Yaws will add 'Accept-Encoding' in 'Vary' header if the
support of gzip compression is enabled or if the response is compressed.
The 'Vary' header can be set using 'yaws:outh_set_vary(Fields)' or by
returning '{header, {vary, Fields}}' from scripts (where Fields is a list
of header names).