]> git.kaiwu.me - nginx.git/log
nginx.git
10 years agonginx-1.9.9-RELEASE release-1.9.9
Maxim Dounin [Wed, 9 Dec 2015 14:47:20 +0000 (17:47 +0300)]
nginx-1.9.9-RELEASE

10 years agoFixed fastcgi_pass with UNIX socket and variables (ticket #855).
Ruslan Ermilov [Wed, 9 Dec 2015 13:26:59 +0000 (16:26 +0300)]
Fixed fastcgi_pass with UNIX socket and variables (ticket #855).

This was broken in a93345ee8f52 (1.9.8).

10 years agoVersion bump.
Ruslan Ermilov [Wed, 9 Dec 2015 11:41:16 +0000 (14:41 +0300)]
Version bump.

10 years agorelease-1.9.8 tag
Maxim Dounin [Tue, 8 Dec 2015 15:16:52 +0000 (18:16 +0300)]
release-1.9.8 tag

10 years agonginx-1.9.8-RELEASE release-1.9.8
Maxim Dounin [Tue, 8 Dec 2015 15:16:51 +0000 (18:16 +0300)]
nginx-1.9.8-RELEASE

10 years agoSlice filter: terminate first slice with last_in_chain flag.
Roman Arutyunyan [Tue, 8 Dec 2015 14:39:56 +0000 (17:39 +0300)]
Slice filter: terminate first slice with last_in_chain flag.

This flag makes sub filter flush buffered data and optimizes allocation in copy
filter.

10 years agoSlice filter: never run subrequests when main request is buffered.
Roman Arutyunyan [Tue, 8 Dec 2015 14:39:56 +0000 (17:39 +0300)]
Slice filter: never run subrequests when main request is buffered.

With main request buffered, it's possible, that a slice subrequest will send
output before it.  For example, while main request is waiting for aio read to
complete, a slice subrequest can start an aio operation as well.  The order
in which aio callbacks are called is undetermined.

10 years agoSSL: fixed possible segfault on renegotiation (ticket #845).
Sergey Kandaurov [Tue, 8 Dec 2015 13:59:43 +0000 (16:59 +0300)]
SSL: fixed possible segfault on renegotiation (ticket #845).

Skip SSL_CTX_set_tlsext_servername_callback in case of renegotiation.
Do nothing in SNI callback as in this case it will be supplied with
request in c->data which isn't expected and doesn't work this way.

This was broken by b40af2fd1c16 (1.9.6) with OpenSSL master branch and LibreSSL.

10 years agoUpdated OpenSSL and PCRE used for win32 builds.
Maxim Dounin [Mon, 7 Dec 2015 17:09:34 +0000 (20:09 +0300)]
Updated OpenSSL and PCRE used for win32 builds.

10 years agoAdded slice module to win32 builds.
Maxim Dounin [Mon, 7 Dec 2015 17:08:13 +0000 (20:08 +0300)]
Added slice module to win32 builds.

10 years agoSlice filter.
Roman Arutyunyan [Mon, 7 Dec 2015 13:30:48 +0000 (16:30 +0300)]
Slice filter.

Splits a request into subrequests, each providing a specific range of response.
The variable "$slice_range" must be used to set subrequest range and proper
cache key.  The directive "slice" sets slice size.

The following example splits requests into 1-megabyte cacheable subrequests.

server {
    listen 8000;

    location / {
        slice 1m;

        proxy_cache cache;
        proxy_cache_key $uri$is_args$args$slice_range;
        proxy_set_header Range $slice_range;
        proxy_cache_valid 200 206 1h;
        proxy_pass http://127.0.0.1:9000;
    }
}

10 years agoUpstream: fill r->headers_out.content_range from upstream response.
Roman Arutyunyan [Mon, 7 Dec 2015 13:30:47 +0000 (16:30 +0300)]
Upstream: fill r->headers_out.content_range from upstream response.

10 years agoCore: fix typo in error message.
Piotr Sikora [Thu, 3 Dec 2015 03:17:19 +0000 (19:17 -0800)]
Core: fix typo in error message.

Signed-off-by: Piotr Sikora <piotrsikora@google.com>
10 years agoStyle: NGX_PTR_SIZE replaced with sizeof(void *).
Maxim Dounin [Thu, 3 Dec 2015 17:06:45 +0000 (20:06 +0300)]
Style: NGX_PTR_SIZE replaced with sizeof(void *).

The NGX_PTR_SIZE macro is only needed in preprocessor directives where
it's not possible to use sizeof().

10 years agoStyle.
Maxim Dounin [Tue, 1 Dec 2015 22:06:54 +0000 (01:06 +0300)]
Style.

10 years agoStop emulating a space character after r->method_name.
Ruslan Ermilov [Mon, 30 Nov 2015 09:54:01 +0000 (12:54 +0300)]
Stop emulating a space character after r->method_name.

This is an API change.

The proxy module was modified to not depend on this in 44122bddd9a1.
No known third-party modules seem to depend on this.

10 years agoProxy: improved code readability.
Ruslan Ermilov [Fri, 6 Nov 2015 12:21:51 +0000 (15:21 +0300)]
Proxy: improved code readability.

Do not assume that space character follows the method name, just pass it
explicitly.

The fuss around it has already proved to be unsafe, see bbdb172f0927 and
http://mailman.nginx.org/pipermail/nginx-ru/2013-January/049692.html for
details.

10 years agoReduced the number of GET method constants.
Ruslan Ermilov [Mon, 30 Nov 2015 09:04:35 +0000 (12:04 +0300)]
Reduced the number of GET method constants.

10 years agoIncreased the default "connection_pool_size" on 64-bit platforms.
Valentin Bartenev [Mon, 30 Nov 2015 13:27:33 +0000 (16:27 +0300)]
Increased the default "connection_pool_size" on 64-bit platforms.

The previous default of 256 bytes isn't enough and results in two
allocations on each accepted connection, which is suboptimal.

10 years agoConfigure: improved workaround for system perl on OS X.
Ruslan Ermilov [Mon, 30 Nov 2015 09:04:29 +0000 (12:04 +0300)]
Configure: improved workaround for system perl on OS X.

The workaround from baf2816d556d stopped to work because the order of
"-arch x86_64" and "-arch i386" has changed.

10 years agoConfigure: removed comment obsolete in 3b763d36e055.
Ruslan Ermilov [Mon, 30 Nov 2015 16:01:53 +0000 (19:01 +0300)]
Configure: removed comment obsolete in 3b763d36e055.

10 years agoStyle: unified request method checks.
Ruslan Ermilov [Fri, 6 Nov 2015 12:22:43 +0000 (15:22 +0300)]
Style: unified request method checks.

10 years agoCore: enabled "include" inside http upstreams (ticket #635).
Ruslan Ermilov [Mon, 23 Nov 2015 09:40:19 +0000 (12:40 +0300)]
Core: enabled "include" inside http upstreams (ticket #635).

The directive already works inside stream upstream blocks.

10 years agoConfigure: fixed using OpenSSL include paths.
Maxim Dounin [Mon, 23 Nov 2015 19:48:31 +0000 (22:48 +0300)]
Configure: fixed using OpenSSL include paths.

10 years agoUpstream: fixed "no port" detection in evaluated upstreams.
Ruslan Ermilov [Sat, 21 Nov 2015 07:44:07 +0000 (10:44 +0300)]
Upstream: fixed "no port" detection in evaluated upstreams.

If an upstream with variables evaluated to address without a port,
then instead of a "no port in upstream" error an attempt was made
to connect() which failed with EADDRNOTAVAIL.

10 years agoMissing "variable" word added.
Maxim Dounin [Tue, 17 Nov 2015 16:41:39 +0000 (19:41 +0300)]
Missing "variable" word added.

10 years agoUsed the pwritev() syscall for writing files where possible.
Valentin Bartenev [Tue, 17 Nov 2015 16:01:41 +0000 (19:01 +0300)]
Used the pwritev() syscall for writing files where possible.

It is more effective, because it doesn't require a separate lseek().

10 years agoMoved file writev() handling code to a separate function.
Valentin Bartenev [Tue, 17 Nov 2015 16:01:41 +0000 (19:01 +0300)]
Moved file writev() handling code to a separate function.

No functional changes.

10 years agoHandled EINTR from write() and pwrite() syscalls.
Valentin Bartenev [Tue, 17 Nov 2015 16:01:41 +0000 (19:01 +0300)]
Handled EINTR from write() and pwrite() syscalls.

This is in addition to 6fce16b1fc10.

10 years agoAdjusted file->sys_offset after the write() syscall.
Valentin Bartenev [Tue, 17 Nov 2015 16:01:41 +0000 (19:01 +0300)]
Adjusted file->sys_offset after the write() syscall.

This fixes suboptimal behavior caused by surplus lseek() for sequential writes
on systems without pwrite().  A consecutive read after write might result in an
error on systems without pread() and pwrite().

Fortunately, at the moment there are no widely used systems without these
syscalls.

10 years agoVersion bump.
Valentin Bartenev [Tue, 17 Nov 2015 16:01:41 +0000 (19:01 +0300)]
Version bump.

10 years agorelease-1.9.7 tag
Maxim Dounin [Tue, 17 Nov 2015 14:50:57 +0000 (17:50 +0300)]
release-1.9.7 tag

10 years agonginx-1.9.7-RELEASE release-1.9.7
Maxim Dounin [Tue, 17 Nov 2015 14:50:56 +0000 (17:50 +0300)]
nginx-1.9.7-RELEASE

10 years agoRealip: the $realip_remote_addr variable.
Ruslan Ermilov [Mon, 16 Nov 2015 13:02:02 +0000 (16:02 +0300)]
Realip: the $realip_remote_addr variable.

10 years agoHTTP/2: reused HEADERS and CONTINUATION frames buffers.
Valentin Bartenev [Fri, 13 Nov 2015 17:10:50 +0000 (20:10 +0300)]
HTTP/2: reused HEADERS and CONTINUATION frames buffers.

10 years agoHTTP/2: fixed handling of output HEADERS frames.
Valentin Bartenev [Fri, 13 Nov 2015 17:10:50 +0000 (20:10 +0300)]
HTTP/2: fixed handling of output HEADERS frames.

The HEADERS frame is always represented by more than one buffer since
b930e598a199, but the handling code hasn't been adjusted.

Only the first buffer of HEADERS frame was checked and if it had been
sent while others had not, the rest of the frame was dropped, resulting
in broken connection.

Before b930e598a199, the problem could only be seen in case of HEADERS
frame with CONTINUATION.

10 years agoHTTP/2: fixed invalid headers handling (ticket #831).
Valentin Bartenev [Fri, 13 Nov 2015 17:10:50 +0000 (20:10 +0300)]
HTTP/2: fixed invalid headers handling (ticket #831).

The r->invalid_header flag wasn't reset once an invalid header appeared in a
request, resulting in all subsequent headers in the request were also marked
as invalid.

10 years agoUpstream: proxy_cache_convert_head directive.
Roman Arutyunyan [Wed, 11 Nov 2015 12:47:30 +0000 (15:47 +0300)]
Upstream: proxy_cache_convert_head directive.

The directive toggles conversion of HEAD to GET for cacheable proxy requests.
When disabled, $request_method must be added to cache key for consistency.
By default, HEAD is converted to GET as before.

10 years agoSSL: only select HTTP/2 using NPN if "http2" is enabled.
Valentin Bartenev [Thu, 5 Nov 2015 12:01:09 +0000 (15:01 +0300)]
SSL: only select HTTP/2 using NPN if "http2" is enabled.

OpenSSL doesn't check if the negotiated protocol has been announced.
As a result, the client might force using HTTP/2 even if it wasn't
enabled in configuration.

10 years agoHTTP/2: backed out 16905ecbb49e (ticket #822).
Valentin Bartenev [Thu, 5 Nov 2015 12:01:01 +0000 (15:01 +0300)]
HTTP/2: backed out 16905ecbb49e (ticket #822).

It caused inconsistency between setting "in_closed" flag and the moment when
the last DATA frame was actually read.  As a result, the body buffer might not
be initialized properly in ngx_http_v2_init_request_body(), which led to a
segmentation fault in ngx_http_v2_state_read_data().  Also it might cause
start processing of incomplete body.

This issue could be triggered when the processing of a request was delayed,
e.g. in the limit_req or auth_request modules.

10 years agoFixed ngx_parse_time() out of bounds access (ticket #821).
Maxim Dounin [Fri, 30 Oct 2015 18:43:30 +0000 (21:43 +0300)]
Fixed ngx_parse_time() out of bounds access (ticket #821).

The code failed to ensure that "s" is within the buffer passed for
parsing when checking for "ms", and this resulted in unexpected errors when
parsing non-null-terminated strings with trailing "m".  The bug manifested
itself when the expires directive was used with variables.

Found by Roman Arutyunyan.

10 years agoSyslog: added "nohostname" option.
Vladimir Homutov [Mon, 26 Oct 2015 16:06:42 +0000 (19:06 +0300)]
Syslog: added "nohostname" option.

The option disables sending hostname in the syslog message header.  This is
useful with syslog daemons that do not expect it (tickets #677 and #783).

10 years agoHTTP/2: changed behavior of the "http2_max_field_size" directive.
Valentin Bartenev [Tue, 27 Oct 2015 20:16:35 +0000 (23:16 +0300)]
HTTP/2: changed behavior of the "http2_max_field_size" directive.

Now it limits only the maximum length of literal string (either raw or
compressed) in HPACK request header fields.  It's easier to understand
and to describe in the documentation.

10 years agoHTTP/2: fixed spelling.
Valentin Bartenev [Tue, 27 Oct 2015 20:16:35 +0000 (23:16 +0300)]
HTTP/2: fixed spelling.

10 years agoVersion bump.
Valentin Bartenev [Tue, 27 Oct 2015 20:16:29 +0000 (23:16 +0300)]
Version bump.

10 years agorelease-1.9.6 tag
Maxim Dounin [Tue, 27 Oct 2015 13:47:30 +0000 (16:47 +0300)]
release-1.9.6 tag

10 years agonginx-1.9.6-RELEASE release-1.9.6
Maxim Dounin [Tue, 27 Oct 2015 13:47:29 +0000 (16:47 +0300)]
nginx-1.9.6-RELEASE

10 years agoHTTP/2: simplified checking the END_STREAM flag.
Valentin Bartenev [Mon, 26 Oct 2015 14:46:28 +0000 (17:46 +0300)]
HTTP/2: simplified checking the END_STREAM flag.

No functional changes.

10 years agoHTTP/2: improved the ngx_http_v2_integer_octets(v) macro.
Valentin Bartenev [Mon, 26 Oct 2015 14:46:16 +0000 (17:46 +0300)]
HTTP/2: improved the ngx_http_v2_integer_octets(v) macro.

Previously, it didn't work well for 0, 127, and 128, returning less than needed.

10 years agoHTTP/2: fixed the NGX_HTTP_V2_MAX_FIELD macro.
Valentin Bartenev [Mon, 26 Oct 2015 14:46:13 +0000 (17:46 +0300)]
HTTP/2: fixed the NGX_HTTP_V2_MAX_FIELD macro.

10 years agoHTTP/2: fixed splitting of response headers on CONTINUATION frames.
Valentin Bartenev [Sun, 27 Sep 2015 23:32:44 +0000 (02:32 +0300)]
HTTP/2: fixed splitting of response headers on CONTINUATION frames.

Previous code has been based on assumption that the header block can only be
splitted at the borders of individual headers.  That wasn't the case and might
result in emitting frames bigger than the frame size limit.

The current approach is to split header blocks by the frame size limit.

10 years agoHTTP/2: introduced NGX_HTTP_V2_ENCODE_* macros.
Valentin Bartenev [Mon, 26 Oct 2015 14:43:08 +0000 (17:43 +0300)]
HTTP/2: introduced NGX_HTTP_V2_ENCODE_* macros.

No functional changes.

10 years agoHTTP/2: simplified producing of the Last-Modified header.
Valentin Bartenev [Mon, 26 Oct 2015 14:43:08 +0000 (17:43 +0300)]
HTTP/2: simplified producing of the Last-Modified header.

10 years agoHTTP/2: fixed header block size calculation.
Valentin Bartenev [Mon, 26 Oct 2015 14:43:08 +0000 (17:43 +0300)]
HTTP/2: fixed header block size calculation.

10 years agoHTTP/2: fix handling of connection errors.
Piotr Sikora [Fri, 2 Oct 2015 03:25:55 +0000 (20:25 -0700)]
HTTP/2: fix handling of connection errors.

Previously, nginx worker would crash because of a double free
if client disconnected or timed out before sending all headers.

Found with afl-fuzz.

Signed-off-by: Piotr Sikora <piotrsikora@google.com>
10 years agoHTTP/2: fix indirect reprioritization.
Piotr Sikora [Fri, 2 Oct 2015 03:25:55 +0000 (20:25 -0700)]
HTTP/2: fix indirect reprioritization.

Previously, streams that were indirectly reprioritized (either because of
a new exclusive dependency on their parent or because of removal of their
parent from the dependency tree), didn't have their pointer to the parent
node updated.

This broke detection of circular dependencies and, as a result, nginx
worker would crash due to stack overflow whenever such dependency was
introduced.

Found with afl-fuzz.

Signed-off-by: Piotr Sikora <piotrsikora@google.com>
10 years agoHTTP/2: reject self-dependent streams.
Piotr Sikora [Fri, 2 Oct 2015 03:25:55 +0000 (20:25 -0700)]
HTTP/2: reject self-dependent streams.

Per RFC7540, a stream cannot depend on itself.

Previously, this requirement was enforced on PRIORITY frames, but not on
HEADERS frames and due to the implementation details nginx worker would
crash (stack overflow) while opening self-dependent stream.

Found with afl-fuzz.

Signed-off-by: Piotr Sikora <piotrsikora@google.com>
10 years agoCore: read/write locks are also required by the Stream module.
Piotr Sikora [Sat, 24 Oct 2015 01:21:33 +0000 (18:21 -0700)]
Core: read/write locks are also required by the Stream module.

Signed-off-by: Piotr Sikora <piotrsikora@google.com>
10 years agoConfigure: style fixes for autoconf.err.
Piotr Sikora [Sat, 24 Oct 2015 01:21:33 +0000 (18:21 -0700)]
Configure: style fixes for autoconf.err.

Signed-off-by: Piotr Sikora <piotrsikora@google.com>
10 years agoHTTP/2: improved error handling while parsing integers.
Valentin Bartenev [Tue, 20 Oct 2015 18:28:38 +0000 (21:28 +0300)]
HTTP/2: improved error handling while parsing integers.

The case when an integer is out of frame bounds should be checked first
as a more accurate error.

10 years agoHTTP/2: improved HPACK integer parsing code readability.
Ruslan Ermilov [Tue, 20 Oct 2015 18:26:38 +0000 (21:26 +0300)]
HTTP/2: improved HPACK integer parsing code readability.

No functional changes.

10 years agoWin32: timer_resolution now ignored with select.
Maxim Dounin [Tue, 20 Oct 2015 15:16:18 +0000 (18:16 +0300)]
Win32: timer_resolution now ignored with select.

As setitimer() isn't available on Windows, time wasn't updated at all
if timer_resolution was used with the select event method.  Fix is
to ignore timer_resolution in such cases.

10 years agoWin32: fixed build with MinGW and MinGW-w64 gcc.
Kouhei Sutou [Sat, 17 Oct 2015 12:41:02 +0000 (21:41 +0900)]
Win32: fixed build with MinGW and MinGW-w64 gcc.

This change fixes the "comparison between signed and unsigned integer
expressions" warning, introduced in 5e6142609e48 (1.9.4).

10 years agoStyle: unneeded casts of cf->args->elts removed.
Maxim Dounin [Mon, 19 Oct 2015 20:04:49 +0000 (23:04 +0300)]
Style: unneeded casts of cf->args->elts removed.

10 years agoFixed variables prefix comparison.
Maxim Dounin [Mon, 19 Oct 2015 18:28:17 +0000 (21:28 +0300)]
Fixed variables prefix comparison.

Variable names are not null-terminated, so using ngx_strncmp() without
extra length checks is wrong.

Reported by Markus Linnala,
http://mailman.nginx.org/pipermail/nginx-devel/2015-August/007211.html.

10 years agoFixed handling of empty root.
Maxim Dounin [Mon, 19 Oct 2015 18:28:02 +0000 (21:28 +0300)]
Fixed handling of empty root.

Previously, a configuration with "root" set to an empty string tried test
a character at clcf->root.data[-1].  Additional test added to make sure
this won't happen.

Reported by Markus Linnala, see
http://mailman.nginx.org/pipermail/nginx-devel/2015-August/007210.html.

10 years agoSSL: preserve default server context in connection (ticket #235).
Maxim Dounin [Mon, 19 Oct 2015 18:22:38 +0000 (21:22 +0300)]
SSL: preserve default server context in connection (ticket #235).

This context is needed for shared sessions cache to work in configurations
with multiple virtual servers sharing the same port.  Unfortunately, OpenSSL
does not provide an API to access the session context, thus storing it
separately.

In collaboration with Vladimir Homutov.

10 years agoHTTP/2: fixed parsing of literal header fields without indexing.
Valentin Bartenev [Mon, 19 Oct 2015 13:16:47 +0000 (16:16 +0300)]
HTTP/2: fixed parsing of literal header fields without indexing.

10 years agoSSL: handled long string truncation in ngx_ssl_error().
Vladimir Homutov [Wed, 7 Oct 2015 19:19:42 +0000 (22:19 +0300)]
SSL: handled long string truncation in ngx_ssl_error().

If no space left in buffer after adding formatting symbols, error message
could be left without terminating null.  The fix is to output message using
actual length.

10 years agoStream: delete proxy connection timer after SSL handshake.
Ruslan Ermilov [Tue, 6 Oct 2015 05:57:09 +0000 (08:57 +0300)]
Stream: delete proxy connection timer after SSL handshake.

The timer remained active and could drop active SSL connection.

10 years agoExtract out version info function.
Kurtis Nusbaum [Sun, 12 Jul 2015 15:31:38 +0000 (08:31 -0700)]
Extract out version info function.

The code for displaying version info and configuration info seemed to be
cluttering up the main function. I was finding it hard to read main. This
extracts out all of the logic for displaying version and configuration info
into its own function, thus making main easier to read.

10 years agoHTTP/2: fixed $server_protocol value (ticket #800).
Valentin Bartenev [Mon, 28 Sep 2015 17:02:05 +0000 (20:02 +0300)]
HTTP/2: fixed $server_protocol value (ticket #800).

10 years agoSSL: compatibility with OpenSSL master branch.
Maxim Dounin [Thu, 24 Sep 2015 14:19:08 +0000 (17:19 +0300)]
SSL: compatibility with OpenSSL master branch.

RAND_pseudo_bytes() is deprecated in the OpenSSL master branch, so the only
use was changed to RAND_bytes().  Access to internal structures is no longer
possible, so now we don't try to set SSL3_FLAGS_NO_RENEGOTIATE_CIPHERS even
if it's defined.

10 years agoVersion bump.
Maxim Dounin [Thu, 24 Sep 2015 14:18:42 +0000 (17:18 +0300)]
Version bump.

10 years agorelease-1.9.5 tag
Maxim Dounin [Tue, 22 Sep 2015 14:36:22 +0000 (17:36 +0300)]
release-1.9.5 tag

10 years agonginx-1.9.5-RELEASE release-1.9.5
Maxim Dounin [Tue, 22 Sep 2015 14:36:21 +0000 (17:36 +0300)]
nginx-1.9.5-RELEASE

10 years agoStyle.
Maxim Dounin [Tue, 22 Sep 2015 14:09:50 +0000 (17:09 +0300)]
Style.

10 years agoIncreased the default number of output buffers.
Valentin Bartenev [Tue, 15 Sep 2015 14:49:15 +0000 (17:49 +0300)]
Increased the default number of output buffers.

Since an output buffer can only be used for either reading or sending, small
amounts of data left from the previous operation (due to some limits) must be
sent before nginx will be able to read further into the buffer.  Using only
one output buffer can result in suboptimal behavior that manifests itself in
forming and sending too small chunks of data.  This is particularly painful
with SPDY (or HTTP/2) where each such chunk needs to be prefixed with some
header.

The default flow-control window in HTTP/2 is 64k minus one bytes.  With one
32k output buffer this results is one byte left after exhausting the window.
With two 32k buffers the data will be read into the second free buffer before
sending, thus the minimum output is increased to 32k + 1 bytes which is much
better.

10 years agoHTTP/2: fixed header block parsing with CONTINUATION frames (#792).
Valentin Bartenev [Mon, 21 Sep 2015 22:40:04 +0000 (01:40 +0300)]
HTTP/2: fixed header block parsing with CONTINUATION frames (#792).

It appears that the CONTINUATION frames don't need to be aligned to bounds of
individual headers.

10 years agoHTTP/2: fixed HPACK header field parsing.
Valentin Bartenev [Mon, 21 Sep 2015 22:40:04 +0000 (01:40 +0300)]
HTTP/2: fixed HPACK header field parsing.

10 years agoSub filter: fixed initialization in http{} level (ticket #791).
Roman Arutyunyan [Mon, 21 Sep 2015 20:08:34 +0000 (23:08 +0300)]
Sub filter: fixed initialization in http{} level (ticket #791).

If sub_filter directive was only specified at http{} level, sub filter
internal data remained uninitialized.  That would lead to a crash in runtime.

10 years agoThe HTTP/2 implementation (RFC 7240, 7241).
Valentin Bartenev [Fri, 11 Sep 2015 17:13:06 +0000 (20:13 +0300)]
The HTTP/2 implementation (RFC 7240, 7241).

The SPDY support is removed, as it's incompatible with the new module.

10 years agoCore: fixed segfault with null in wildcard hash names.
Maxim Dounin [Fri, 11 Sep 2015 14:04:40 +0000 (17:04 +0300)]
Core: fixed segfault with null in wildcard hash names.

A configuration like

    server { server_name .foo^@; }
    server { server_name .foo; }

resulted in a segmentation fault during construction of server names hash.

Reported by Markus Linnala.
Found with afl-fuzz.

10 years agoFixed segfault with incorrect location nesting.
Maxim Dounin [Fri, 11 Sep 2015 14:04:04 +0000 (17:04 +0300)]
Fixed segfault with incorrect location nesting.

A configuration with a named location inside a zero-length prefix
or regex location used to trigger a segmentation fault, as
ngx_http_core_location() failed to properly detect if a nested location
was created.  Example configuration to reproduce the problem:

    location "" {
        location @foo {}
    }

Fix is to not rely on a parent location name length, but rather check
command type we are currently parsing.

Identical fix is also applied to ngx_http_rewrite_if(), which used to
incorrectly assume the "if" directive is on server{} level in such
locations.

Reported by Markus Linnala.
Found with afl-fuzz.

10 years agoCache: check the whole cache key in addition to hashes.
Maxim Dounin [Fri, 11 Sep 2015 14:03:56 +0000 (17:03 +0300)]
Cache: check the whole cache key in addition to hashes.

This prevents a potential attack that discloses cached data if an attacker
will be able to craft a hash collision between some cache key the attacker
is allowed to access and another cache key with protected data.

See http://mailman.nginx.org/pipermail/nginx-devel/2015-September/007288.html.

Thanks to Gena Makhomed and Sergey Brester.

10 years agoUpstream: fixed cache send error handling.
Roman Arutyunyan [Thu, 3 Sep 2015 12:09:21 +0000 (15:09 +0300)]
Upstream: fixed cache send error handling.

The value of NGX_ERROR, returned from filter handlers, was treated as a generic
upstream error and changed to NGX_HTTP_INTERNAL_SERVER_ERROR before calling
ngx_http_finalize_request().  This resulted in "header already sent" alert
if header was already sent in filter handlers.

The problem appeared in 54e9b83d00f0 (1.7.5).

10 years agoFixed building --with-debug, broken by 6fce16b1fc10.
Valentin Bartenev [Wed, 2 Sep 2015 16:45:40 +0000 (19:45 +0300)]
Fixed building --with-debug, broken by 6fce16b1fc10.

10 years agoWriting to some file systems can be interrupted.
Valentin Bartenev [Wed, 2 Sep 2015 16:26:40 +0000 (19:26 +0300)]
Writing to some file systems can be interrupted.

At least such behavior was observed with CephFS, see:
http://mailman.nginx.org/pipermail/nginx/2015-July/048188.html.

10 years agoDecreased the NGX_HTTP_MAX_SUBREQUESTS limit.
Valentin Bartenev [Mon, 31 Aug 2015 20:26:33 +0000 (23:26 +0300)]
Decreased the NGX_HTTP_MAX_SUBREQUESTS limit.

There is no much sense in such a big value since its semantics
has been changed in 06e850859a26 to limit recursive subrequests.

10 years agoAdded protection against r->main->count overflow by subrequests.
Valentin Bartenev [Mon, 31 Aug 2015 20:25:16 +0000 (23:25 +0300)]
Added protection against r->main->count overflow by subrequests.

This overflow has become possible after the change in 06e850859a26,
since concurrent subrequests are not limited now and each of them is
counted in r->main->count.

10 years agoLimit recursive subrequests instead of simultaneous.
Valentin Bartenev [Sun, 23 Aug 2015 18:03:32 +0000 (21:03 +0300)]
Limit recursive subrequests instead of simultaneous.

10 years agoVersion bump.
Valentin Bartenev [Sun, 23 Aug 2015 18:03:29 +0000 (21:03 +0300)]
Version bump.

10 years agorelease-1.9.4 tag
Maxim Dounin [Tue, 18 Aug 2015 15:16:17 +0000 (18:16 +0300)]
release-1.9.4 tag

10 years agonginx-1.9.4-RELEASE release-1.9.4
Maxim Dounin [Tue, 18 Aug 2015 15:16:17 +0000 (18:16 +0300)]
nginx-1.9.4-RELEASE

10 years agoPerl: prototyping behavior explicitly specified.
Maxim Dounin [Tue, 18 Aug 2015 13:26:18 +0000 (16:26 +0300)]
Perl: prototyping behavior explicitly specified.

When prototyping behavior is not explicitly specified, xsubpp emits
a message to stderr asking to do so (see ticket #608).

10 years agoPerl: fixed warning about "sep" may be used uninitialized.
Maxim Dounin [Tue, 18 Aug 2015 13:26:05 +0000 (16:26 +0300)]
Perl: fixed warning about "sep" may be used uninitialized.

10 years agoUpdated OpenSSL used for win32 builds.
Maxim Dounin [Mon, 17 Aug 2015 15:09:20 +0000 (18:09 +0300)]
Updated OpenSSL used for win32 builds.

Note that as of OpenSSL 1.0.0, the "ms\do_ms" script (previously documented
to be used if one doesn't want to use the assembly language files) tries to
use MASM.  Additionally, OpenSSL 1.0.2 finally broke MASM support.  To fix
this, we now explicitly use "no-asm" in OpenSSL options.

10 years agoWin32: MSVC 2015 compatibility.
Maxim Dounin [Mon, 17 Aug 2015 15:09:17 +0000 (18:09 +0300)]
Win32: MSVC 2015 compatibility.

Resolved warnings about declarations that hide previous local declarations.
Warnings about WSASocketA() being deprecated resolved by explicit use of
WSASocketW() instead of WSASocket().  When compiling without IPv6 support,
WinSock deprecated warnings are disabled to allow use of gethostbyname().

10 years agoSub filter: support of variables in the strings to replace.
Dmitry Volyntsev [Mon, 17 Aug 2015 14:42:02 +0000 (17:42 +0300)]
Sub filter: support of variables in the strings to replace.

10 years agoSub filter: support of multiple strings to replace.
Dmitry Volyntsev [Mon, 17 Aug 2015 14:42:02 +0000 (17:42 +0300)]
Sub filter: support of multiple strings to replace.