Core: use uppercase hexadecimal digits for percent-encoding.

RFC3986 says that, for consistency, URI producers and normalizers
should use uppercase hexadecimal digits for all percent-encodings.

This is also what modern web browsers and other tools use.

Using lowercase hexadecimal digits makes it harder to interact with
those tools in case when use of the percent-encoded URI is required,
for example when $request_uri is part of the cache key.

Signed-off-by: Piotr Sikora <piotr@cloudflare.com>
GeoIP: not all variable fields were initialized.

The ngx_http_geoip_city_float_variable and
ngx_http_geoip_city_int_variable functions did not always initialize
all variable fields like "not_found", which could lead to empty values
for those corresponding nginx variables randomly.
Upstream: SSL handshake timeouts.

Timeout may not be set on an upstream connection when we call
ngx_ssl_handshake() in ngx_http_upstream_ssl_init_connection(),
so make sure to arm it if it's not set.

Based on a patch by Yichun Zhang.
SSL: misplaced space in debug message.
Bigger iovec buffer in ngx_readv_chain().

This helps to reduce likelyhood of memory allocations in ngx_readv_chain(),
which are known to lead to noticeable effects in some cases, see
http://mailman.nginx.org/pipermail/nginx/2014-July/044512.html.
SSL: fix build with OPENSSL_NO_ENGINE and/or OPENSSL_NO_OCSP.

This is really just a prerequisite for building against BoringSSL,
which doesn't provide either of those features.

Signed-off-by: Piotr Sikora <piotr@cloudflare.com>
SSL: let it build against BoringSSL.

This change adds support for using BoringSSL as a drop-in replacement
for OpenSSL without adding support for any of the BoringSSL-specific
features.

Signed-off-by: Piotr Sikora <piotr@cloudflare.com>
SSL: let it build against LibreSSL.

LibreSSL developers decided that LibreSSL is OpenSSL-2.0.0, so tests
for OpenSSL-1.0.2+ are now passing, even though the library doesn't
provide functions that are expected from that version of OpenSSL.

Signed-off-by: Piotr Sikora <piotr@cloudflare.com>
Typos fixed.
Dav: ngx_http_map_uri_to_path() errors were not checked.

Once error occured, it could lead to use uninitialized variables to log,
even more segmentation fault.
Configure: remove outdated and unused patch.zlib.h.

Signed-off-by: Piotr Sikora <piotr@cloudflare.com>
Status: indentation and style, no functional changes.
Core: improved ngx_pstrdup() error handling.
Style: use ngx_free() instead of free().
Core: exit on ngx_pnalloc() failure.

Signed-off-by: Piotr Sikora <piotr@cloudflare.com>
Mail: discard pipelined commands after SMTP STARTTLS.

The bug had appeared in nginx 1.5.6 (04e43d03e153).

Reported by Chris Boulton.
nginx-1.7.4-RELEASE
release-1.7.4 tag
Version bump.
Access log: allowed logs to syslog with "if=" (ticket #596).