]> git.kaiwu.me - nginx.git/log
nginx.git
9 years agoIntroduced the ngx_sockaddr_t type.
Ruslan Ermilov [Mon, 23 May 2016 13:37:20 +0000 (16:37 +0300)]
Introduced the ngx_sockaddr_t type.

It's properly aligned and can hold any supported sockaddr.

9 years agoStream: fixed duplicate listen address detection.
Ruslan Ermilov [Mon, 23 May 2016 09:50:59 +0000 (12:50 +0300)]
Stream: fixed duplicate listen address detection.

The 6f8254ae61b8 change inadvertently fixed the duplicate port
detection similar to how it was fixed for mail in b2920b517490.
It also revealed another issue: the socket type (tcp vs. udp)
wasn't taken into account.

9 years agoUse ngx_cmp_sockaddr() where appropriate.
Ruslan Ermilov [Fri, 20 May 2016 16:10:42 +0000 (19:10 +0300)]
Use ngx_cmp_sockaddr() where appropriate.

9 years agoHTTP/2: the "421 Misdirected Request" response (closes #848).
Valentin Bartenev [Fri, 20 May 2016 15:41:17 +0000 (18:41 +0300)]
HTTP/2: the "421 Misdirected Request" response (closes #848).

Since 4fbef397c753 nginx rejects with the 400 error any attempts of
requesting different host over the same connection, if the relevant
virtual server requires verification of a client certificate.

While requesting hosts other than negotiated isn't something legal
in HTTP/1.x, the HTTP/2 specification explicitly permits such requests
for connection reuse and has introduced a special response code 421.

According to RFC 7540 Section 9.1.2 this code can be sent by a server
that is not configured to produce responses for the combination of
scheme and authority that are included in the request URI.  And the
client may retry the request over a different connection.

Now this code is used for requests that aren't authorized in current
connection.  After receiving the 421 response a client will be able
to open a new connection, provide the required certificate and retry
the request.

Unfortunately, not all clients currently are able to handle it well.
Notably Chrome just shows an error, while at least the latest version
of Firefox retries the request over a new connection.

9 years agoBelatedly changed the ngx_create_listening() prototype.
Ruslan Ermilov [Fri, 20 May 2016 14:02:04 +0000 (17:02 +0300)]
Belatedly changed the ngx_create_listening() prototype.

The function is called only with "struct sockaddr *" since 0.7.58.

9 years agoSSL: removed default DH parameters.
Maxim Dounin [Thu, 19 May 2016 11:46:32 +0000 (14:46 +0300)]
SSL: removed default DH parameters.

Using the same DH parameters on multiple servers is believed to be subject
to precomputation attacks, see http://weakdh.org/.  Additionally, 1024 bits
are not enough in the modern world as well.  Let users provide their own
DH parameters with the ssl_dhparam directive if they want to use EDH ciphers.

Note that SSL_CTX_set_dh_auto() as provided by OpenSSL 1.1.0 uses fixed
DH parameters from RFC 5114 and RFC 3526, and therefore subject to the same
precomputation attacks.  We avoid using it as well.

This change also fixes compilation with OpenSSL 1.1.0-pre5 (aka Beta 2),
as OpenSSL developers changed their policy after releasing Beta 1 and
broke API once again by making the DH struct opaque (see ticket #860).

9 years agoSSL: support for multiple curves (ticket #885).
Maxim Dounin [Thu, 19 May 2016 11:46:32 +0000 (14:46 +0300)]
SSL: support for multiple curves (ticket #885).

OpenSSL 1.0.2+ allows configuring a curve list instead of a single curve
previously supported.  This allows use of different curves depending on
what client supports (as available via the elliptic_curves extension),
and also allows use of different curves in an ECDHE key exchange and
in the ECDSA certificate.

The special value "auto" was introduced (now the default for ssl_ecdh_curve),
which means "use an internal list of curves as available in the OpenSSL
library used".  For versions prior to OpenSSL 1.0.2 it maps to "prime256v1"
as previously used.  The default in 1.0.2b+ prefers prime256v1 as well
(and X25519 in OpenSSL 1.1.0+).

As client vs. server preference of curves is controlled by the
same option as used for ciphers (SSL_OP_CIPHER_SERVER_PREFERENCE),
the ssl_prefer_server_ciphers directive now controls both.

9 years agoSSL: style.
Maxim Dounin [Thu, 19 May 2016 11:46:32 +0000 (14:46 +0300)]
SSL: style.

9 years agoSSL: error messages style.
Maxim Dounin [Thu, 19 May 2016 11:46:32 +0000 (14:46 +0300)]
SSL: error messages style.

9 years agoSSL: support for multiple certificates (ticket #814).
Maxim Dounin [Thu, 19 May 2016 11:46:32 +0000 (14:46 +0300)]
SSL: support for multiple certificates (ticket #814).

9 years agoSSL: support for per-certificate chains.
Maxim Dounin [Thu, 19 May 2016 11:46:32 +0000 (14:46 +0300)]
SSL: support for per-certificate chains.

The SSL_CTX_add0_chain_cert() function as introduced in OpenSSL 1.0.2 now
used instead of SSL_CTX_add_extra_chain_cert().

SSL_CTX_add_extra_chain_cert() adds extra certs for all certificates
in the context, while SSL_CTX_add0_chain_cert() only to a particular
certificate.  There is no difference unless multiple certificates are used,
though it is important when using multiple certificates.

Additionally, SSL_CTX_select_current_cert() is now called before using
a chain to make sure correct chain will be returned.

9 years agoSSL: made it possible to iterate though all certificates.
Maxim Dounin [Thu, 19 May 2016 11:46:32 +0000 (14:46 +0300)]
SSL: made it possible to iterate though all certificates.

A pointer to a previously configured certificate now stored in a certificate.
This makes it possible to iterate though all certificates configured in
the SSL context.  This is now used to configure OCSP stapling for all
certificates, and in ngx_ssl_session_id_context().

As SSL_CTX_use_certificate() frees previously loaded certificate of the same
type, and we have no way to find out if it's the case, X509_free() calls
are now posponed till ngx_ssl_cleanup_ctx().

Note that in OpenSSL 1.0.2+ this can be done without storing things in exdata
using the SSL_CTX_set_current_cert() and SSL_CTX_get0_certificate() functions.
These are not yet available in all supported versions though, so it's easier
to continue to use exdata for now.

9 years agoOCSP stapling: additional function to configure stapling on a cert.
Maxim Dounin [Thu, 19 May 2016 11:46:32 +0000 (14:46 +0300)]
OCSP stapling: additional function to configure stapling on a cert.

9 years agoOCSP stapling: staple now extracted via SSL_get_certificate().
Maxim Dounin [Thu, 19 May 2016 11:46:32 +0000 (14:46 +0300)]
OCSP stapling: staple now extracted via SSL_get_certificate().

This makes it possible to properly return OCSP staple with multiple
certificates configured.

Note that it only works properly in OpenSSL 1.0.1d+, 1.0.0k, 0.9.8y+.
In older versions SSL_get_certificate() fails to return correct certificate
when the certificate status callback is called.

9 years agoOCSP stapling: staple now stored in certificate, not SSL context.
Maxim Dounin [Thu, 19 May 2016 11:46:32 +0000 (14:46 +0300)]
OCSP stapling: staple now stored in certificate, not SSL context.

9 years agoOCSP stapling: staple provided in arguments.
Maxim Dounin [Thu, 19 May 2016 11:46:32 +0000 (14:46 +0300)]
OCSP stapling: staple provided in arguments.

9 years agoAdded overflow checks for version numbers (ticket #762).
Maxim Dounin [Wed, 18 May 2016 13:21:32 +0000 (16:21 +0300)]
Added overflow checks for version numbers (ticket #762).

Both minor and major versions are now limited to 999 maximum.  In case of
r->http_minor, this limit is already implied by the code.  Major version,
r->http_major, in theory can be up to 65535 with current code, but such
values are very unlikely to become real (and, additionally, such values
are not allowed by RFC 7230), so the same test was used for r->http_major.

9 years agoEvents: close descriptors on errors in ngx_epoll_test_rdhup().
Maxim Dounin [Wed, 18 May 2016 12:57:30 +0000 (15:57 +0300)]
Events: close descriptors on errors in ngx_epoll_test_rdhup().

9 years agoEvents: changed ngx_epoll_test_rdhup() to use existing epollfd.
Maxim Dounin [Wed, 18 May 2016 12:57:29 +0000 (15:57 +0300)]
Events: changed ngx_epoll_test_rdhup() to use existing epollfd.

9 years agoFixed work with --test-build-epoll after f7849bfb6d21.
Maxim Dounin [Wed, 18 May 2016 12:57:28 +0000 (15:57 +0300)]
Fixed work with --test-build-epoll after f7849bfb6d21.

9 years agoCache: fixed updating bypassed cached errors (ticket #827).
Maxim Dounin [Mon, 16 May 2016 17:37:38 +0000 (20:37 +0300)]
Cache: fixed updating bypassed cached errors (ticket #827).

9 years agoDav: return 501 on PUT with ranges (ticket #948).
Maxim Dounin [Mon, 16 May 2016 17:37:23 +0000 (20:37 +0300)]
Dav: return 501 on PUT with ranges (ticket #948).

9 years agoFixed an error log message about epoll_wait() timeout.
Valentin Bartenev [Mon, 16 May 2016 13:22:34 +0000 (16:22 +0300)]
Fixed an error log message about epoll_wait() timeout.

The errno value is unset in case of epoll_wait() timeout.

10 years agoImproved EPOLLRDHUP handling.
Valentin Bartenev [Fri, 13 May 2016 14:19:23 +0000 (17:19 +0300)]
Improved EPOLLRDHUP handling.

When it's known that the kernel supports EPOLLRDHUP, there is no need in
additional recv() call to get EOF or error when the flag is absent in the
event generated by the kernel.  A special runtime test is done at startup
to detect if EPOLLRDHUP is actually supported by the kernel because
epoll_ctl() silently ignores unknown flags.

With this knowledge it's now possible to drop the "ready" flag for partial
read.  Previously, the "ready" flag was kept until the recv() returned EOF
or error.  In particular, this change allows the lingering close heuristics
(which relies on the "ready" flag state) to actually work on Linux, and not
wait for more data in most cases.

The "available" flag is now used in the read event with the semantics similar
to the corresponding counter in kqueue.

10 years agoMap: support of complex values in resulting strings.
Dmitry Volyntsev [Thu, 12 May 2016 13:43:19 +0000 (16:43 +0300)]
Map: support of complex values in resulting strings.

10 years agoRemoved a surplus condition from ngx_parse_inet6_url().
Ruslan Ermilov [Wed, 11 May 2016 14:55:30 +0000 (17:55 +0300)]
Removed a surplus condition from ngx_parse_inet6_url().

No functional changes, since the condition was always true.

10 years agoCore: fixed port handling in ngx_parse_inet6_url().
Valentin Bartenev [Wed, 11 May 2016 14:55:20 +0000 (17:55 +0300)]
Core: fixed port handling in ngx_parse_inet6_url().

This fixes buffer over-read when no port is specified in cases
similar to 5df5d7d771f6, and catches missing port separator.

10 years agoRemoved unused flag unexpected_eof from ngx_connection_t.
Ruslan Ermilov [Thu, 28 Apr 2016 13:30:19 +0000 (16:30 +0300)]
Removed unused flag unexpected_eof from ngx_connection_t.

10 years agoVariable $request_id.
Vladimir Homutov [Tue, 26 Apr 2016 16:31:46 +0000 (19:31 +0300)]
Variable $request_id.

The variable contains text representation based on random data, usable as
a unique request identifier.

10 years agoUpstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan [Fri, 18 Dec 2015 16:05:27 +0000 (19:05 +0300)]
Upstream: the "transparent" parameter of proxy_bind and friends.

This parameter lets binding the proxy connection to a non-local address.
Upstream will see the connection as coming from that address.
When used with $remote_addr, upstream will accept the connection from real
client address.

Example:

    proxy_bind $remote_addr transparent;

10 years agoStream: prepared proxy_bind to accept parameters.
Roman Arutyunyan [Wed, 13 Apr 2016 12:42:47 +0000 (15:42 +0300)]
Stream: prepared proxy_bind to accept parameters.

10 years agoUpstream: prepared proxy_bind to accept parameters.
Roman Arutyunyan [Wed, 13 Apr 2016 12:42:46 +0000 (15:42 +0300)]
Upstream: prepared proxy_bind to accept parameters.

In addition, errors occurred while setting bind address are no longer ignored.

10 years agoRemoved some bitrot.
Ruslan Ermilov [Tue, 26 Apr 2016 15:26:43 +0000 (18:26 +0300)]
Removed some bitrot.

Removed NGX_CONF_MULTI unused since 1.3.4.
Removed ngx_url_t.one_addr unused since 1.3.10.

10 years agoVersion bump.
Ruslan Ermilov [Tue, 26 Apr 2016 15:26:18 +0000 (18:26 +0300)]
Version bump.

10 years agorelease-1.9.15 tag
Maxim Dounin [Tue, 19 Apr 2016 16:02:37 +0000 (19:02 +0300)]
release-1.9.15 tag

10 years agonginx-1.9.15-RELEASE release-1.9.15
Maxim Dounin [Tue, 19 Apr 2016 16:02:37 +0000 (19:02 +0300)]
nginx-1.9.15-RELEASE

10 years agoHTTP/2: send the output queue after emitting WINDOW_UPDATE.
Valentin Bartenev [Tue, 19 Apr 2016 14:38:49 +0000 (17:38 +0300)]
HTTP/2: send the output queue after emitting WINDOW_UPDATE.

The WINDOW_UPDATE frame could be left in the output queue for an indefinite
period of time resulting in the request timeout.

This might happen if reading of the body was triggered by an event unrelated
to client connection, e.g. by the limit_req timer.

10 years agoHTTP/2: skip data frames in case of internal errors.
Valentin Bartenev [Tue, 19 Apr 2016 14:38:49 +0000 (17:38 +0300)]
HTTP/2: skip data frames in case of internal errors.

This prevents possible processing of such frames and triggering
rb->post_handler if an error occurred during r->request_body
initialization.

10 years agoHTTP/2: don't send WINDOW_UPDATE for an empty request body.
Valentin Bartenev [Tue, 19 Apr 2016 14:38:49 +0000 (17:38 +0300)]
HTTP/2: don't send WINDOW_UPDATE for an empty request body.

Particularly this prevents sending WINDOW_UPDATE with zero delta
which can result in PROTOCOL_ERROR.

Also removed surplus setting of no_flow_control to 0.

10 years agoThread pools: memory barriers in task completion notifications.
Maxim Dounin [Tue, 19 Apr 2016 14:18:28 +0000 (17:18 +0300)]
Thread pools: memory barriers in task completion notifications.

The ngx_thread_pool_done object isn't volatile, and at least some
compilers assume that it is permitted to reorder modifications of
volatile and non-volatile objects.  Added appropriate ngx_memory_barrier()
calls to make sure all modifications will happen before the lock is released.

Reported by Mindaugas Rasiukevicius,
http://mailman.nginx.org/pipermail/nginx-devel/2016-April/008160.html.

10 years agoHTTP/2: write logs when refusing streams with data.
Maxim Dounin [Mon, 18 Apr 2016 18:18:24 +0000 (21:18 +0300)]
HTTP/2: write logs when refusing streams with data.

Refusing streams is known to be incorrectly handled at least by IE, Edge
and Safari.  Make sure to provide appropriate logging to simplify fixing
this in the affected browsers.

10 years agoHTTP/2: send WINDOW_UPDATE instead of RST_STREAM with NO_ERROR.
Valentin Bartenev [Thu, 14 Apr 2016 12:14:15 +0000 (15:14 +0300)]
HTTP/2: send WINDOW_UPDATE instead of RST_STREAM with NO_ERROR.

After the 92464ebace8e change, it has been discovered that not all
clients follow the RFC and handle RST_STREAM with NO_ERROR properly.

Notably, Chrome currently interprets it as INTERNAL_ERROR and discards
the response.

As a workaround, instead of RST_STREAM the maximum stream window update
will be sent, which will let client to send up to 2 GB of a request body
data before getting stuck on flow control.  All the received data will
be silently discarded.

See for details:
http://mailman.nginx.org/pipermail/nginx-devel/2016-April/008143.html
https://bugs.chromium.org/p/chromium/issues/detail?id=603182

10 years agoHTTP/2: refuse streams with data until SETTINGS is acknowledged.
Valentin Bartenev [Thu, 14 Apr 2016 12:14:15 +0000 (15:14 +0300)]
HTTP/2: refuse streams with data until SETTINGS is acknowledged.

A client is allowed to send requests before receiving and acknowledging
the SETTINGS frame.  Such a client having a wrong idea about the stream's
could send the request body that nginx isn't ready to process.

The previous behavior was to send RST_STREAM with FLOW_CONTROL_ERROR in
such case, but it didn't allow retrying requests that have been rejected.

10 years agoHTTP/2: deduplicated some code in ngx_http_v2_state_headers().
Valentin Bartenev [Thu, 14 Apr 2016 12:14:15 +0000 (15:14 +0300)]
HTTP/2: deduplicated some code in ngx_http_v2_state_headers().

No functional changes.

10 years agoFastCGI: skip special bufs in buffered request body chain.
Valentin Bartenev [Mon, 11 Apr 2016 15:42:34 +0000 (18:42 +0300)]
FastCGI: skip special bufs in buffered request body chain.

This prevents forming empty records out of such buffers.  Particularly it fixes
double end-of-stream records with chunked transfer encoding, or when HTTP/2 is
used and the END_STREAM flag has been sent without data.  In both cases there
is an empty buffer at the end of the request body chain with the "last_buf"
flag set.

The canonical libfcgi, as well as php implementation, tolerates such records,
while the HHVM parser is more strict and drops the connection (ticket #950).

10 years agoFixed NGX_CONF_TAKE1/NGX_CONF_FLAG misuse (as in e444e8f6538b).
Ruslan Ermilov [Tue, 12 Apr 2016 16:01:56 +0000 (19:01 +0300)]
Fixed NGX_CONF_TAKE1/NGX_CONF_FLAG misuse (as in e444e8f6538b).

10 years agoFixed typos.
Alessandro Ghedini [Mon, 11 Apr 2016 15:47:11 +0000 (16:47 +0100)]
Fixed typos.

10 years agoRemoved redundant "u" format specifier.
Ruslan Ermilov [Fri, 8 Apr 2016 12:03:38 +0000 (15:03 +0300)]
Removed redundant "u" format specifier.

It is implied for "x" and "X".

10 years agoSimplified ngx_unix_recv() and ngx_readv_chain().
Ruslan Ermilov [Fri, 8 Apr 2016 13:49:35 +0000 (16:49 +0300)]
Simplified ngx_unix_recv() and ngx_readv_chain().

This makes ngx_unix_recv() and ngx_udp_unix_recv() differ minimally.

10 years agoMerged implementations of ngx_unix_recv().
Valentin Bartenev [Fri, 8 Apr 2016 13:41:45 +0000 (16:41 +0300)]
Merged implementations of ngx_unix_recv().

There's no real need in two separate implementations,
with and without kqueue support.

10 years agoFixed small inconsistency in handling EOF among receive functions.
Valentin Bartenev [Fri, 8 Apr 2016 13:39:49 +0000 (16:39 +0300)]
Fixed small inconsistency in handling EOF among receive functions.

Now all functions always drop the ready flag in this case.

10 years agoMerged implementations of ngx_udp_unix_recv().
Valentin Bartenev [Fri, 8 Apr 2016 13:38:42 +0000 (16:38 +0300)]
Merged implementations of ngx_udp_unix_recv().

There's no real need in two separate implementations,
with and without kqueue support.

10 years agoFixed spelling.
Josh Soref [Thu, 7 Apr 2016 08:50:13 +0000 (11:50 +0300)]
Fixed spelling.

10 years agoVersion bump.
Ruslan Ermilov [Thu, 7 Apr 2016 16:09:42 +0000 (19:09 +0300)]
Version bump.

10 years agorelease-1.9.14 tag
Maxim Dounin [Tue, 5 Apr 2016 14:57:08 +0000 (17:57 +0300)]
release-1.9.14 tag

10 years agonginx-1.9.14-RELEASE release-1.9.14
Maxim Dounin [Tue, 5 Apr 2016 14:57:08 +0000 (17:57 +0300)]
nginx-1.9.14-RELEASE

10 years agoCompatibility with FreeBSD 2.2.9.
Maxim Dounin [Fri, 1 Apr 2016 13:38:31 +0000 (16:38 +0300)]
Compatibility with FreeBSD 2.2.9.

Added (RTLD_NOW | RTLD_GLOBAL) to dlopen() test.  There is no RTLD_GLOBAL
on FreeBSD 2.2.9.

Added uint32_t test, with fallback to u_int32_t, similar to uint64_t one.
Added fallback to u_int32_t in in_addr_t test.

With these changes it is now possible to compile nginx on FreeBSD 2.2.9
with only few minor warnings (assuming -Wno-error).

10 years agoConfigure: improved multiple types handling in auto/types/typedef.
Maxim Dounin [Fri, 1 Apr 2016 13:38:30 +0000 (16:38 +0300)]
Configure: improved multiple types handling in auto/types/typedef.

10 years agoConfigure: fixed autotest source code logging.
Maxim Dounin [Fri, 1 Apr 2016 13:38:28 +0000 (16:38 +0300)]
Configure: fixed autotest source code logging.

Fixed a regression introduced in rev. 434548349838 that prevented
auto/types/sizeof and auto/types/typedef properly reporting autotest
source code to autoconf.err in case of test failure.

10 years agoHTTP/2: support for unbuffered upload of request body.
Valentin Bartenev [Fri, 1 Apr 2016 12:57:10 +0000 (15:57 +0300)]
HTTP/2: support for unbuffered upload of request body.

10 years agoHTTP/2: rewritten handling of request body.
Valentin Bartenev [Fri, 1 Apr 2016 12:56:03 +0000 (15:56 +0300)]
HTTP/2: rewritten handling of request body.

There are two improvements:

  1. Support for request body filters;

  2. Receiving of request body is started only after
     the ngx_http_read_client_request_body() call.

The last one fixes the problem when the client_max_body_size value might not be
respected from the right location if the location was changed either during the
process of receiving body or after the whole body had been received.

10 years agoHTTP/2: sending RST_STREAM with NO_ERROR to discard request body.
Valentin Bartenev [Fri, 1 Apr 2016 12:56:03 +0000 (15:56 +0300)]
HTTP/2: sending RST_STREAM with NO_ERROR to discard request body.

RFC 7540 states that "A server can send a complete response prior to the client
sending an entire request if the response does not depend on any portion of the
request that has not been sent and received.  When this is true, a server MAY
request that the client abort transmission of a request without error by sending
a RST_STREAM with an error code of NO_ERROR after sending a complete response
(i.e., a frame with the END_STREAM flag)."

This should prevent a client from blocking on the stream window, since it isn't
maintained for closed streams.  Currently, quite big initial stream windows are
used, so such blocking is very unlikly, but that will be changed in the further
patches.

10 years agoCore: removed incorrect GCC 2.7 check.
Maxim Dounin [Fri, 1 Apr 2016 10:17:12 +0000 (13:17 +0300)]
Core: removed incorrect GCC 2.7 check.

It was broken since introduction (__GNU__ instead of __GNUC__) and did
nothing.  Moreover, GCC 2.7 is happy with the normal version of the code.

Reported by Joel Cunningham,
http://mailman.nginx.org/pipermail/nginx-devel/2016-March/007964.html.

10 years agoTrailing space fix.
Maxim Dounin [Fri, 1 Apr 2016 01:17:00 +0000 (04:17 +0300)]
Trailing space fix.

10 years agoSSL: SSLeay_version() is deprecated in OpenSSL 1.1.0.
Maxim Dounin [Thu, 31 Mar 2016 20:38:38 +0000 (23:38 +0300)]
SSL: SSLeay_version() is deprecated in OpenSSL 1.1.0.

SSLeay_version() and SSLeay() are no longer available if OPENSSL_API_COMPAT
is set to 0x10100000L.  Switched to using OpenSSL_version() instead.

Additionally, we now compare version strings instead of version numbers,
and this correctly works for LibreSSL as well.

10 years agoSSL: X509 was made opaque in OpenSSL 1.1.0.
Sergey Kandaurov [Thu, 31 Mar 2016 20:38:37 +0000 (23:38 +0300)]
SSL: X509 was made opaque in OpenSSL 1.1.0.

To increment reference counters we now use newly introduced X509_up_ref()
function.

10 years agoSSL: EVP_MD_CTX was made opaque in OpenSSL 1.1.0.
Sergey Kandaurov [Thu, 31 Mar 2016 20:38:36 +0000 (23:38 +0300)]
SSL: EVP_MD_CTX was made opaque in OpenSSL 1.1.0.

10 years agoSSL: RSA_generate_key() is deprecated in OpenSSL 1.1.0.
Maxim Dounin [Thu, 31 Mar 2016 20:38:34 +0000 (23:38 +0300)]
SSL: RSA_generate_key() is deprecated in OpenSSL 1.1.0.

OpenSSL removed support for all 40 and 56 bit ciphers.

10 years agoSSL: initialization changes for OpenSSL 1.1.0.
Maxim Dounin [Thu, 31 Mar 2016 20:38:33 +0000 (23:38 +0300)]
SSL: initialization changes for OpenSSL 1.1.0.

OPENSSL_config() deprecated in OpenSSL 1.1.0.  Additionally,
SSL_library_init(), SSL_load_error_strings() and OpenSSL_add_all_algorithms()
are no longer available if OPENSSL_API_COMPAT is set to 0x10100000L.

The OPENSSL_init_ssl() function is now used instead with appropriate
arguments to trigger the same behaviour.  The configure test changed to
use SSL_CTX_set_options().

Deinitialization now happens automatically in OPENSSL_cleanup() called
via atexit(3), so we no longer call EVP_cleanup() and ENGINE_cleanup()
directly.

10 years agoSSL: get_session callback changed in OpenSSL 1.1.0.
Maxim Dounin [Thu, 31 Mar 2016 20:38:32 +0000 (23:38 +0300)]
SSL: get_session callback changed in OpenSSL 1.1.0.

10 years agoSSL: guarded error codes not present in OpenSSL 1.1.0.
Maxim Dounin [Thu, 31 Mar 2016 20:38:31 +0000 (23:38 +0300)]
SSL: guarded error codes not present in OpenSSL 1.1.0.

10 years agoSSL: reasonable version for LibreSSL.
Maxim Dounin [Thu, 31 Mar 2016 20:38:29 +0000 (23:38 +0300)]
SSL: reasonable version for LibreSSL.

LibreSSL defines OPENSSL_VERSION_NUMBER to 0x20000000L, but uses an old
API derived from OpenSSL at the time LibreSSL forked.  As a result, every
version check we use to test for new API elements in newer OpenSSL versions
requires an explicit check for LibreSSL.

To reduce clutter, redefine OPENSSL_VERSION_NUMBER to 0x1000107fL if
LibreSSL is used.  The same is done by FreeBSD port of LibreSSL.

10 years agoRemoved the prototype mysql module.
Ruslan Ermilov [Thu, 31 Mar 2016 19:33:26 +0000 (22:33 +0300)]
Removed the prototype mysql module.

10 years agoFixed ngx_os_signal_process() prototype.
Ruslan Ermilov [Thu, 31 Mar 2016 19:00:33 +0000 (22:00 +0300)]
Fixed ngx_os_signal_process() prototype.

10 years agoFixed ngx_pid_t formatting in ngx_sprintf() and logging.
Sergey Kandaurov [Wed, 30 Mar 2016 23:34:04 +0000 (02:34 +0300)]
Fixed ngx_pid_t formatting in ngx_sprintf() and logging.

10 years agoFixed format specifiers in ngx_sprintf().
Sergey Kandaurov [Wed, 30 Mar 2016 23:34:00 +0000 (02:34 +0300)]
Fixed format specifiers in ngx_sprintf().

10 years agoFixed logging.
Sergey Kandaurov [Wed, 30 Mar 2016 23:33:57 +0000 (02:33 +0300)]
Fixed logging.

10 years agoEvents: fixed logging.
Sergey Kandaurov [Wed, 30 Mar 2016 23:33:55 +0000 (02:33 +0300)]
Events: fixed logging.

10 years agoFixed logging with variable field width.
Sergey Kandaurov [Wed, 30 Mar 2016 23:33:53 +0000 (02:33 +0300)]
Fixed logging with variable field width.

10 years agoFixed logging in close error handling.
Sergey Kandaurov [Wed, 30 Mar 2016 23:33:50 +0000 (02:33 +0300)]
Fixed logging in close error handling.

10 years agoFixed mistranslated phrase.
Ruslan Ermilov [Wed, 30 Mar 2016 09:07:19 +0000 (12:07 +0300)]
Fixed mistranslated phrase.

10 years agoEvents: fixed test building with eventport on OS X.
Ruslan Ermilov [Wed, 30 Mar 2016 08:57:28 +0000 (11:57 +0300)]
Events: fixed test building with eventport on OS X.

Broken in d17f0584006f (1.9.13).

10 years agoStyle.
Ruslan Ermilov [Wed, 30 Mar 2016 08:52:16 +0000 (11:52 +0300)]
Style.

10 years agoVersion bump.
Ruslan Ermilov [Wed, 30 Mar 2016 08:52:07 +0000 (11:52 +0300)]
Version bump.

10 years agorelease-1.9.13 tag
Maxim Dounin [Tue, 29 Mar 2016 15:09:30 +0000 (18:09 +0300)]
release-1.9.13 tag

10 years agonginx-1.9.13-RELEASE release-1.9.13
Maxim Dounin [Tue, 29 Mar 2016 15:09:30 +0000 (18:09 +0300)]
nginx-1.9.13-RELEASE

10 years agoUpdated OpenSSL used for win32 builds.
Maxim Dounin [Tue, 29 Mar 2016 06:54:11 +0000 (09:54 +0300)]
Updated OpenSSL used for win32 builds.

10 years agoWin32: replaced NGX_EXDEV with more appropriate error code.
Maxim Dounin [Tue, 29 Mar 2016 06:52:15 +0000 (09:52 +0300)]
Win32: replaced NGX_EXDEV with more appropriate error code.

Correct error code for NGX_EXDEV on Windows is ERROR_NOT_SAME_DEVICE,
"The system cannot move the file to a different disk drive".

Previously used ERROR_WRONG_DISK is about wrong diskette in the drive and
is not appropriate.

There is no real difference though, as MoveFile() is able to copy files
between disk drives, and will fail with ERROR_ACCESS_DENIED when asked
to copy directories.  The ERROR_NOT_SAME_DEVICE error is only used
by MoveFileEx() when called without the MOVEFILE_COPY_ALLOWED flag.

10 years agoWin32: additional error code NGX_EEXIST_FILE (ticket #910).
Maxim Dounin [Tue, 29 Mar 2016 06:51:46 +0000 (09:51 +0300)]
Win32: additional error code NGX_EEXIST_FILE (ticket #910).

On Windows there are two possible error codes which correspond to
the EEXIST error code: ERROR_FILE_EXISTS used by CreateFile(CREATE_NEW),
and ERROR_ALREADY_EXISTS used by CreateDirectory().

MoveFile() seems to use both: ERROR_ALREADY_EXISTS when moving within
one filesystem, and ERROR_FILE_EXISTS when copying a file to a different
drive.

10 years agoUpstream: proxy_next_upstream non_idempotent.
Maxim Dounin [Mon, 28 Mar 2016 16:50:19 +0000 (19:50 +0300)]
Upstream: proxy_next_upstream non_idempotent.

By default, requests with non-idempotent methods (POST, LOCK, PATCH)
are no longer retried in case of errors if a request was already sent
to a backend.  Previous behaviour can be restored by using
"proxy_next_upstream ... non_idempotent".

10 years agoUpstream: cached connections now tested against next_upstream.
Maxim Dounin [Mon, 28 Mar 2016 16:49:52 +0000 (19:49 +0300)]
Upstream: cached connections now tested against next_upstream.

Much like normal connections, cached connections are now tested against
u->conf->next_upstream, and u->state->status is now always set.

This allows to disable additional tries even with upstream keepalive
by using "proxy_next_upstream off".

10 years agoFixed --test-build-*.
Ruslan Ermilov [Mon, 28 Mar 2016 16:29:18 +0000 (19:29 +0300)]
Fixed --test-build-*.

Fixes various aspects of --test-build-devpoll, --test-build-eventport, and
--test-build-epoll.

In particular, if --test-build-devpoll was used on Linux, then "devpoll"
event method would be preferred over "epoll".  Also, wrong definitions of
event macros were chosen.

10 years agoSub filter: fixed allocation alignment.
Roman Arutyunyan [Mon, 28 Mar 2016 10:35:25 +0000 (13:35 +0300)]
Sub filter: fixed allocation alignment.

10 years agoCore: allow strings without null-termination in ngx_parse_url().
Piotr Sikora [Sat, 27 Feb 2016 01:30:27 +0000 (17:30 -0800)]
Core: allow strings without null-termination in ngx_parse_url().

This fixes buffer over-read while using variables in the "proxy_pass",
"fastcgi_pass", "scgi_pass", and "uwsgi_pass" directives, where result
of string evaluation isn't null-terminated.

Found with MemorySanitizer.

Signed-off-by: Piotr Sikora <piotrsikora@google.com>
10 years agoFixed socket inheritance on reload and binary upgrade.
Roman Arutyunyan [Fri, 25 Mar 2016 11:10:38 +0000 (14:10 +0300)]
Fixed socket inheritance on reload and binary upgrade.

On nginx reload or binary upgrade, an attempt is made to inherit listen sockets
from the previous configuration.  Previously, no check for socket type was made
and the inherited socket could have the wrong type.  On binary upgrade, socket
type was not detected at all.  Wrong socket type could lead to errors on that
socket due to different logic and unsupported syscalls.  For example, a UDP
socket, inherited as TCP, lead to the following error after arrival of a
datagram: "accept() failed (102: Operation not supported on socket)".

10 years agoStream: additional logging for UDP.
Vladimir Homutov [Fri, 18 Mar 2016 16:53:22 +0000 (19:53 +0300)]
Stream: additional logging for UDP.

10 years agoWin32: fixed build after 384154fc634f.
Dmitry Volyntsev [Wed, 23 Mar 2016 15:34:05 +0000 (18:34 +0300)]
Win32: fixed build after 384154fc634f.

10 years agoStream: detect port absence in proxy_pass with IP literal.
Roman Arutyunyan [Wed, 23 Mar 2016 14:45:15 +0000 (17:45 +0300)]
Stream: detect port absence in proxy_pass with IP literal.

This is a clone of http commit 26c127bab5ef.

10 years agoResolver: added support for SRV records.
Dmitry Volyntsev [Wed, 23 Mar 2016 14:44:36 +0000 (17:44 +0300)]
Resolver: added support for SRV records.

10 years agoResolver: do not enable resolve timer if provided timeout is zero.
Dmitry Volyntsev [Wed, 23 Mar 2016 14:44:36 +0000 (17:44 +0300)]
Resolver: do not enable resolve timer if provided timeout is zero.