Version bump.
SSL: the "ssl_verify_client" directive parameter "optional_no_ca".

This parameter allows to don't require certificate to be signed by
a trusted CA, e.g. if CA certificate isn't known in advance, like in
WebID protocol.

Note that it doesn't add any security unless the certificate is actually
checked to be trusted by some external means (e.g. by a backend).

Patch by Mike Kazantsev, Eric O'Connor.
Log: $apache_bytes_sent removed.

It was renamed to $body_bytes_sent in nginx 0.3.10 and the old name is
deprecated since then.
Variable $bytes_sent.

It replicates variable $bytes_sent as previously available in log module
only.

Patch by Benjamin Grössing (with minor changes).
OCSP stapling: properly check if there is ssl.ctx.

This fixes segfault if stapling was enabled in a server without a certificate
configured (and hence no ssl.ctx).
Gunzip: fixed r->gzip_ok check.
Removed conditional compilation from waitpid() error test.

There are reports that call to a signal handler for an exited process
despite waitpid() already called for the process may happen on Linux
as well.
Core: the "auto" parameter of the "worker_processes" directive.

The parameter will set the number of worker processes to the
autodetected number of available CPU cores.
ngx_http_keepalive_handler() is now trying to not keep c->buffer's memory for
idle connections.

This behaviour is consistent with the ngx_http_set_keepalive() function and it
should decrease memory usage in some cases (especially if epoll/rtsig is used).
Resolver: added missing memory allocation error handling.
Variables $connection and $connection_requests.

Log module counterparts are removed as they aren't used often and
there is no need to preserve them for efficiency.
Style, parentheses instead of braces in misc/GNUMakefile.
Event pipe: fixed handling of buf_to_file data.

Input filter might free a buffer if there is no data in it, and in case
of first buffer (used for cache header and request header, aka p->buf_to_file)
this resulted in cache corruption.  Buffer memory was reused to read upstream
response before headers were written to disk.

Fix is to avoid moving pointers in ngx_event_pipe_add_free_buf() to a buffer
start if we were asked to free a buffer used by p->buf_to_file.

This fixes occasional cache file corruption, usually resulted
in "cache file ... has md5 collision" alerts.

Reported by Anatoli Marinov.
nginx-1.3.8-RELEASE
Version bump.
Fixed setting of CPU affinity on respawn of dead worker processes.

Worker processes are now made aware of their sequential number needed
to select CPU affinity mask.  This replaces a workaround from r4865.
Variables $request_time and $msec.

Log module counterparts are preserved for efficiency.
Upstream: honor the "down" flag for a single server.

If an upstream block was defined with the only server marked as
"down", e.g.

    upstream u {
        server 127.0.0.1:8080 down;
    }

an attempt was made to contact the server despite the "down" flag.
It is believed that immediate 502 response is better in such a
case, and it's also consistent with what is currently done in case
of multiple servers all marked as "down".
Upstream: better detection of connect() failures with kqueue.

Pending EOF might be reported on both read and write events, whichever
comes first, so check both of them.

Patch by Yichun Zhang (agentzh), slightly modified.
Trailing whitespace fix.