]> git.kaiwu.me - nginx.git/log
nginx.git
11 years agoRenamed ngx_handle_sent_chain() to ngx_chain_update_sent().
Valentin Bartenev [Wed, 19 Nov 2014 18:16:19 +0000 (21:16 +0300)]
Renamed ngx_handle_sent_chain() to ngx_chain_update_sent().

No functional changes.

11 years agoCache: add support for Cache-Control's s-maxage response directive.
Piotr Sikora [Wed, 19 Nov 2014 01:07:14 +0000 (17:07 -0800)]
Cache: add support for Cache-Control's s-maxage response directive.

Signed-off-by: Piotr Sikora <piotr@cloudflare.com>
11 years agoProxy: renamed and rearranged fields in proxy configuration.
Roman Arutyunyan [Wed, 19 Nov 2014 14:33:24 +0000 (17:33 +0300)]
Proxy: renamed and rearranged fields in proxy configuration.

No functional changes.

11 years agoUpstream: different header lists for cached and uncached requests.
Roman Arutyunyan [Wed, 19 Nov 2014 14:33:23 +0000 (17:33 +0300)]
Upstream: different header lists for cached and uncached requests.

The upstream modules remove and alter a number of client headers
before sending the request to upstream.  This set of headers is
smaller or even empty when cache is disabled.

It's still possible that a request in a cache-enabled location is
uncached, for example, if cache entry counter is below min_uses.
In this case it's better to alter a smaller set of headers and
pass more client headers to backend unchanged.  One of the benefits
is enabling server-side byte ranges in such requests.

11 years agoUpstream: moved header lists to separate structures.
Roman Arutyunyan [Wed, 19 Nov 2014 14:33:22 +0000 (17:33 +0300)]
Upstream: moved header lists to separate structures.

No functional changes.

11 years agoUpstream: moved header initializations to separate functions.
Roman Arutyunyan [Wed, 19 Nov 2014 14:33:21 +0000 (17:33 +0300)]
Upstream: moved header initializations to separate functions.

No functional changes.

11 years agoScgi: do not push redundant NULL element into conf->params.
Roman Arutyunyan [Wed, 19 Nov 2014 14:33:21 +0000 (17:33 +0300)]
Scgi: do not push redundant NULL element into conf->params.

11 years agoCache: proxy_cache_lock_age and friends.
Roman Arutyunyan [Tue, 18 Nov 2014 17:41:12 +0000 (20:41 +0300)]
Cache: proxy_cache_lock_age and friends.

Once this age is reached, the cache lock is discarded and another
request can acquire the lock.  Requests which failed to acquire
the lock are not allowed to cache the response.

11 years agoSPDY: fixed check for too long header name or value.
Valentin Bartenev [Fri, 7 Nov 2014 14:22:19 +0000 (17:22 +0300)]
SPDY: fixed check for too long header name or value.

For further progress a new buffer must be at least two bytes larger than
the remaining unparsed data.  One more byte is needed for null-termination
and another one for further progress.  Otherwise inflate() fails with
Z_BUF_ERROR.

11 years agoSPDY: improved debug logging of inflate() calls.
Valentin Bartenev [Fri, 7 Nov 2014 14:19:12 +0000 (17:19 +0300)]
SPDY: improved debug logging of inflate() calls.

11 years agoSSL: logging level of "inappropriate fallback" (ticket #662).
Maxim Dounin [Mon, 17 Nov 2014 13:38:48 +0000 (16:38 +0300)]
SSL: logging level of "inappropriate fallback" (ticket #662).

Patch by Erik Dubbelboer.

11 years agoUpstream: support named location for X-Accel-Redirect.
Toshikuni Fukaya [Tue, 4 Nov 2014 10:56:23 +0000 (19:56 +0900)]
Upstream: support named location for X-Accel-Redirect.

11 years agoUpstream: add "proxy_ssl_certificate" and friends.
Piotr Sikora [Thu, 30 Oct 2014 11:30:41 +0000 (04:30 -0700)]
Upstream: add "proxy_ssl_certificate" and friends.

Signed-off-by: Piotr Sikora <piotr@cloudflare.com>
11 years agoSPDY: fixed "too long header line" logging.
Maxim Dounin [Fri, 7 Nov 2014 14:38:55 +0000 (17:38 +0300)]
SPDY: fixed "too long header line" logging.

This fixes possible one byte buffer overrun and makes sure ellipsis are
always added, see 21043ce2a005.

11 years agoCache: removed dead store in ngx_http_file_cache_vary_header().
Maxim Dounin [Wed, 5 Nov 2014 15:53:26 +0000 (18:53 +0300)]
Cache: removed dead store in ngx_http_file_cache_vary_header().

Found by Clang Static Analyzer.

11 years agoAccess log: cancel the flush timer on graceful shutdown.
Valentin Bartenev [Mon, 25 Aug 2014 09:41:31 +0000 (13:41 +0400)]
Access log: cancel the flush timer on graceful shutdown.

Previously, it could prevent a worker process from exiting
for up to the configured flush timeout.

11 years agoEvents: introduced cancelable timers.
Valentin Bartenev [Wed, 13 Aug 2014 18:45:04 +0000 (22:45 +0400)]
Events: introduced cancelable timers.

11 years agoEvents: simplified cycle in ngx_event_expire_timers().
Valentin Bartenev [Mon, 25 Aug 2014 09:37:06 +0000 (13:37 +0400)]
Events: simplified cycle in ngx_event_expire_timers().

11 years agoEvents: removed broken thread support from event timers.
Valentin Bartenev [Mon, 25 Aug 2014 09:34:39 +0000 (13:34 +0400)]
Events: removed broken thread support from event timers.

It's mostly dead code.  And the idea of thread support for this task has
been deprecated.

11 years agoContrib: add more directives to vim syntax.
Peter Wu [Wed, 22 Oct 2014 13:31:19 +0000 (15:31 +0200)]
Contrib: add more directives to vim syntax.

uwsgi is not a third-party module anymore. 'split_clients' is a new
block directive type. The directives were automatically extracted from
the ngx_command_t arrays, sorted in the C locale and inserted.

Trailing spaces got removed at some places.

11 years agoSSL: simplified ssl_password_file error handling.
Sergey Kandaurov [Fri, 24 Oct 2014 11:28:00 +0000 (04:28 -0700)]
SSL: simplified ssl_password_file error handling.

Instead of collecting a number of the possible SSL_CTX_use_PrivateKey_file()
error codes that becomes more and more difficult with the rising variety of
OpenSSL versions and its derivatives, just continue with the next password.

Multiple passwords in a single ssl_password_file feature was broken after
recent OpenSSL changes (commit 4aac102f75b517bdb56b1bcfd0a856052d559f6e).

Affected OpenSSL releases: 0.9.8zc, 1.0.0o, 1.0.1j and 1.0.2-beta3.

Reported by Piotr Sikora.

11 years agoSPDY: stop emitting multiple empty header values.
Piotr Sikora [Mon, 27 Oct 2014 21:25:56 +0000 (14:25 -0700)]
SPDY: stop emitting multiple empty header values.

Previously, nginx would emit empty values in a header with multiple,
NULL-separated values.

This is forbidden by the SPDY specification, which requires headers to
have either a single (possibly empty) value or multiple, NULL-separated
non-empty values.

Signed-off-by: Piotr Sikora <piotr@cloudflare.com>
11 years agoVersion bump.
Valentin Bartenev [Tue, 28 Oct 2014 18:58:49 +0000 (21:58 +0300)]
Version bump.

11 years agorelease-1.7.7 tag
Maxim Dounin [Tue, 28 Oct 2014 15:04:46 +0000 (18:04 +0300)]
release-1.7.7 tag

11 years agonginx-1.7.7-RELEASE release-1.7.7
Maxim Dounin [Tue, 28 Oct 2014 15:04:46 +0000 (18:04 +0300)]
nginx-1.7.7-RELEASE

11 years agoUpdated OpenSSL used for win32 builds.
Maxim Dounin [Tue, 28 Oct 2014 14:35:00 +0000 (17:35 +0300)]
Updated OpenSSL used for win32 builds.

11 years agoWin32: made build-able with MinGW-w64 gcc.
Kouhei Sutou [Wed, 15 Oct 2014 12:15:01 +0000 (21:15 +0900)]
Win32: made build-able with MinGW-w64 gcc.

11 years agoUpstream: limited next_upstream time and tries when resolving DNS.
Gu Feng [Mon, 27 Oct 2014 11:52:03 +0000 (19:52 +0800)]
Upstream: limited next_upstream time and tries when resolving DNS.

When got multiple upstream IP addresses using DNS resolving, the number of
upstreams tries and the maxinum time spent for these tries were not affected.
This patch fixed it.

11 years agoWrite filter: stored delay in a variable, no functional changes.
Roman Arutyunyan [Tue, 28 Oct 2014 09:29:59 +0000 (12:29 +0300)]
Write filter: stored delay in a variable, no functional changes.

The code is now similar to ngx_event_pipe_read_upstream().

11 years agoUpstream: proxy_limit_rate and friends.
Roman Arutyunyan [Tue, 28 Oct 2014 09:29:59 +0000 (12:29 +0300)]
Upstream: proxy_limit_rate and friends.

The directives limit the upstream read rate.  For example,
"proxy_limit_rate 42" limits proxy upstream read rate to
42 bytes per second.

11 years agoCore: added limit to recv_chain().
Roman Arutyunyan [Tue, 28 Oct 2014 09:29:58 +0000 (12:29 +0300)]
Core: added limit to recv_chain().

11 years agoCache: normalization of some Vary headers.
Maxim Dounin [Mon, 27 Oct 2014 18:14:12 +0000 (21:14 +0300)]
Cache: normalization of some Vary headers.

Spaces in Accept-Charset, Accept-Encoding, and Accept-Language headers
are now ignored.  As per syntax of these headers spaces can only appear
in places where they are optional.

11 years agoCache: multiple variants of a resource now can be stored.
Maxim Dounin [Mon, 27 Oct 2014 18:14:10 +0000 (21:14 +0300)]
Cache: multiple variants of a resource now can be stored.

If a variant stored can't be used to respond to a request, the variant
hash is used as a secondary key.

Additionally, if we previously switched to a secondary key, while storing
a response to cache we check if the variant hash still apply.  If not, we
switch back to the original key, to handle cases when Vary changes.

11 years agoCache: c->reading flag introduced.
Maxim Dounin [Mon, 27 Oct 2014 18:14:07 +0000 (21:14 +0300)]
Cache: c->reading flag introduced.

It replaces c->buf in checks in ngx_http_file_cache_open(), making it possible
to reopen the file without clearing c->buf.  No functional changes.

11 years agoCache: hash of Vary headers now stored in cache.
Maxim Dounin [Mon, 27 Oct 2014 18:13:58 +0000 (21:13 +0300)]
Cache: hash of Vary headers now stored in cache.

To cache responses with Vary, we now calculate hash of headers listed
in Vary, and return the response from cache only if new request headers
match.

As of now, only one variant of the same resource can be stored in cache.

11 years agoCache: disable caching of responses with Vary (ticket #118).
Maxim Dounin [Mon, 27 Oct 2014 18:13:39 +0000 (21:13 +0300)]
Cache: disable caching of responses with Vary (ticket #118).

The "proxy_ignore_header" directive now undersands the "Vary" parameter
to ignore the header as needed.

11 years agoGzip, gunzip: flush busy buffers if any.
Maxim Dounin [Wed, 15 Oct 2014 18:57:23 +0000 (22:57 +0400)]
Gzip, gunzip: flush busy buffers if any.

Previous code resulted in transfer stalls when client happened
to read all the data in buffers at once, while all gzip buffers
were exhausted (but ctx->nomem wasn't set).  Make sure to call
next body filter at least once per call if there are busy buffers.

Additionally, handling of calls with NULL chain was changed to follow
the same logic, i.e., next body filter is only called with NULL chain
if there are busy buffers.  This is expected to fix "output chain is empty"
alerts as reported by some users after c52a761a2029 (1.5.7).

11 years agoStyle.
Maxim Dounin [Tue, 14 Oct 2014 16:19:36 +0000 (20:19 +0400)]
Style.

11 years agoUpstream: proxy_force_ranges and friends.
Roman Arutyunyan [Tue, 14 Oct 2014 14:32:01 +0000 (18:32 +0400)]
Upstream: proxy_force_ranges and friends.

The directives enable byte ranges for both cached and uncached
responses regardless of backend headers.

11 years agoWin32: suppressed warnings by "-Werror=sign-compare".
Kouhei Sutou [Sat, 11 Oct 2014 12:09:29 +0000 (21:09 +0900)]
Win32: suppressed warnings by "-Werror=sign-compare".

11 years agoWin32: fixed wrong type cast.
Kouhei Sutou [Sat, 11 Oct 2014 11:56:35 +0000 (20:56 +0900)]
Win32: fixed wrong type cast.

GetQueuedCompletionStatus() document on MSDN says the
following signature:

    http://msdn.microsoft.com/en-us/library/windows/desktop/aa364986.aspx

    BOOL WINAPI GetQueuedCompletionStatus(
      _In_   HANDLE CompletionPort,
      _Out_  LPDWORD lpNumberOfBytes,
      _Out_  PULONG_PTR lpCompletionKey,
      _Out_  LPOVERLAPPED *lpOverlapped,
      _In_   DWORD dwMilliseconds
    );

In the latest specification, the type of the third argument
(lpCompletionKey) is PULONG_PTR not LPDWORD.

11 years agoFixed possible buffer overrun in "too long header line" logging.
Maxim Dounin [Wed, 8 Oct 2014 13:16:04 +0000 (17:16 +0400)]
Fixed possible buffer overrun in "too long header line" logging.

Additionally, ellipsis now always added to make it clear that
the header logged is incomplete.

Reported by Daniil Bondarev.

11 years agoCore: fixed buffer overrun when hash max_size reached.
Yichun Zhang [Thu, 2 Oct 2014 19:00:17 +0000 (12:00 -0700)]
Core: fixed buffer overrun when hash max_size reached.

11 years agoUpstream: fix $upstream_cache_last_modified variable.
Piotr Sikora [Wed, 1 Oct 2014 22:48:53 +0000 (15:48 -0700)]
Upstream: fix $upstream_cache_last_modified variable.

Due to the u->headers_in.last_modified_time not being correctly initialized,
this variable was evaluated to "Thu, 01 Jan 1970 00:00:00 GMT" for responses
cached without the "Last-Modified" header which resulted in subsequent proxy
requests being sent with "If-Modified-Since: Thu, 01 Jan 1970 00:00:00 GMT"
header.

Signed-off-by: Piotr Sikora <piotr@cloudflare.com>
11 years agoFixed counting of sent bytes in the send chain functions on EINTR.
Valentin Bartenev [Wed, 27 Aug 2014 16:51:01 +0000 (20:51 +0400)]
Fixed counting of sent bytes in the send chain functions on EINTR.

Previously, a value of the "send" variable wasn't properly adjusted
in a rare case when syscall was interrupted by a signal.  As a result,
these functions could send less data than the limit allows.

11 years agoVersion bump.
Valentin Bartenev [Thu, 2 Oct 2014 18:36:27 +0000 (22:36 +0400)]
Version bump.

11 years agorelease-1.7.6 tag
Maxim Dounin [Tue, 30 Sep 2014 13:20:33 +0000 (17:20 +0400)]
release-1.7.6 tag

11 years agonginx-1.7.6-RELEASE release-1.7.6
Maxim Dounin [Tue, 30 Sep 2014 13:20:32 +0000 (17:20 +0400)]
nginx-1.7.6-RELEASE

11 years agoUpstream keepalive: reset c->sent on cached connections.
Maxim Dounin [Mon, 29 Sep 2014 18:27:45 +0000 (22:27 +0400)]
Upstream keepalive: reset c->sent on cached connections.

The c->sent is reset to 0 on each request by server-side http code,
so do the same on client side.  This allows to count number of bytes
sent in a particular request.

11 years agoLimit req: reduced number of parameters in the lookup function.
Valentin Bartenev [Wed, 24 Sep 2014 17:55:19 +0000 (21:55 +0400)]
Limit req: reduced number of parameters in the lookup function.

No functional changes.

11 years agoLimit req: use complex value in limit_req_zone.
Valentin Bartenev [Wed, 24 Sep 2014 17:55:19 +0000 (21:55 +0400)]
Limit req: use complex value in limit_req_zone.

One intentional side effect of this change is that key is allowed only
in the first position.  Previously, it was possible to specify the key
variable at any position, but that was never documented, and is contrary
with nginx configuration practice for positional parameters.

11 years agoLimit conn: aligned field names in structures.
Valentin Bartenev [Wed, 24 Sep 2014 17:55:19 +0000 (21:55 +0400)]
Limit conn: aligned field names in structures.

No functional changes.

11 years agoLimit conn: use complex value in limit_conn_zone (ticket #121).
Valentin Bartenev [Wed, 24 Sep 2014 17:55:19 +0000 (21:55 +0400)]
Limit conn: use complex value in limit_conn_zone (ticket #121).

One intentional side effect of this change is that key is allowed only
in the first position.  Previously, it was possible to specify the key
variable at any position, but that was never documented, and is contrary
to nginx configuration practice for positional parameters.

11 years agoLimit conn: removed deprecated "limit_zone" directive.
Valentin Bartenev [Wed, 24 Sep 2014 17:55:19 +0000 (21:55 +0400)]
Limit conn: removed deprecated "limit_zone" directive.

It's deprecated since 260d591cb6a3 (1.1.8).  The "limit_conn_zone" directive
should be used instead.

11 years agoSyslog: improved error handling of unix domain sockets.
Vladimir Homutov [Tue, 26 Aug 2014 10:56:54 +0000 (14:56 +0400)]
Syslog: improved error handling of unix domain sockets.

If a syslog daemon is restarted and the unix socket is used, further logging
might stop to work.  In case of send error, socket is closed, forcing
a reconnection at the next logging attempt.

11 years agoSyslog: enabled logging of send errors.
Vladimir Homutov [Mon, 1 Sep 2014 13:55:07 +0000 (17:55 +0400)]
Syslog: enabled logging of send errors.

The ngx_cycle->log is used when sending the message.  This allows to log syslog
send errors in another log.

Logging to syslog after its cleanup handler has been executed was prohibited.
Previously, this was possible from ngx_destroy_pool(), which resulted in error
messages caused by attempts to write into the closed socket.

The "processing" flag is renamed to "busy" to better match its semantics.

11 years agoAvoided to add duplicate hash key in ngx_http_types_slot().
Gu Feng [Wed, 17 Sep 2014 14:52:02 +0000 (22:52 +0800)]
Avoided to add duplicate hash key in ngx_http_types_slot().

11 years agoRemoved duplicate initialization of the "rev" variable.
Valentin Bartenev [Mon, 22 Sep 2014 15:48:23 +0000 (19:48 +0400)]
Removed duplicate initialization of the "rev" variable.

11 years agoGeneralized definitions of the number of preallocated iovec's.
Valentin Bartenev [Wed, 13 Aug 2014 11:11:45 +0000 (15:11 +0400)]
Generalized definitions of the number of preallocated iovec's.

No functional changes.

11 years agoReduced difference between the send chain functions.
Valentin Bartenev [Wed, 13 Aug 2014 11:11:45 +0000 (15:11 +0400)]
Reduced difference between the send chain functions.

No functional changes.  This follows the change from ad137a80919f.

11 years agoMerged implementations of ngx_readv_chain().
Valentin Bartenev [Wed, 13 Aug 2014 11:11:45 +0000 (15:11 +0400)]
Merged implementations of ngx_readv_chain().

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

11 years agoRemoved the "complete" variable from various send chain functions.
Valentin Bartenev [Wed, 13 Aug 2014 11:11:45 +0000 (15:11 +0400)]
Removed the "complete" variable from various send chain functions.

It was made redundant by the previous change, since the "sent" variable
is no longer modified.

11 years agoMoved the code for adjusting sent buffers in a separate function.
Valentin Bartenev [Wed, 13 Aug 2014 11:11:45 +0000 (15:11 +0400)]
Moved the code for adjusting sent buffers in a separate function.

11 years agoFixed writev() debug log message in ngx_darwin_sendfile_chain().
Valentin Bartenev [Wed, 13 Aug 2014 11:11:45 +0000 (15:11 +0400)]
Fixed writev() debug log message in ngx_darwin_sendfile_chain().

11 years agoUpstream: fixed file buffers reinit in ngx_http_upstream_reinit().
Roman Arutyunyan [Thu, 18 Sep 2014 12:37:16 +0000 (16:37 +0400)]
Upstream: fixed file buffers reinit in ngx_http_upstream_reinit().

Previously, a file buffer start position was reset to the file start.
Now it's reset to the previous file buffer end.  This fixes
reinitialization of requests having multiple successive parts of a
single file.  Such requests are generated by fastcgi module.

11 years agoFastCGI: fixed start pointers in request buffers.
Roman Arutyunyan [Thu, 18 Sep 2014 12:37:14 +0000 (16:37 +0400)]
FastCGI: fixed start pointers in request buffers.

The start pointers are used in ngx_http_upstream_reinit() to
reinit FastCGI requests.

11 years agoLimit req: don't truncate key value to 255 bytes.
Valentin Bartenev [Tue, 16 Sep 2014 17:12:51 +0000 (21:12 +0400)]
Limit req: don't truncate key value to 255 bytes.

While the module allows to use values up to 65535 bytes as a key,
that actually never worked properly.

11 years agoVersion bump.
Valentin Bartenev [Wed, 17 Sep 2014 08:04:47 +0000 (12:04 +0400)]
Version bump.

11 years agorelease-1.7.5 tag
Maxim Dounin [Tue, 16 Sep 2014 12:19:03 +0000 (16:19 +0400)]
release-1.7.5 tag

11 years agonginx-1.7.5-RELEASE release-1.7.5
Maxim Dounin [Tue, 16 Sep 2014 12:19:03 +0000 (16:19 +0400)]
nginx-1.7.5-RELEASE

11 years agoUpdated OpenSSL used for win32 builds.
Maxim Dounin [Mon, 15 Sep 2014 14:03:49 +0000 (18:03 +0400)]
Updated OpenSSL used for win32 builds.

11 years agoSSL: session id context now includes certificate hash.
Maxim Dounin [Mon, 15 Sep 2014 13:59:47 +0000 (17:59 +0400)]
SSL: session id context now includes certificate hash.

This prevents inappropriate session reuse in unrelated server{}
blocks, while preserving ability to restore sessions on other servers
when using TLS Session Tickets.

Additionally, session context is now set even if there is no session cache
configured.  This is needed as it's also used for TLS Session Tickets.

Thanks to Antoine Delignat-Lavaud and Piotr Sikora.

11 years agoAccess log: fixed the "if=" parameter with buffering (ticket #625).
Valentin Bartenev [Sat, 13 Sep 2014 17:47:13 +0000 (21:47 +0400)]
Access log: fixed the "if=" parameter with buffering (ticket #625).

It might not work if there were more than one "access_log" directives
pointed to the same file and duplicate buffer parameters.

11 years agoUpstream: limited next_upstream time and tries (ticket #544).
Roman Arutyunyan [Fri, 12 Sep 2014 14:50:47 +0000 (18:50 +0400)]
Upstream: limited next_upstream time and tries (ticket #544).

The new directives {proxy,fastcgi,scgi,uwsgi,memcached}_next_upstream_tries
and {proxy,fastcgi,scgi,uwsgi,memcached}_next_upstream_timeout limit
the number of upstreams tried and the maximum time spent for these tries
when searching for a valid upstream.

11 years agoUpstream: included backup peers into peer.tries.
Roman Arutyunyan [Fri, 12 Sep 2014 14:50:46 +0000 (18:50 +0400)]
Upstream: included backup peers into peer.tries.

Since peer.tries is never reset it can now be limited if required.

11 years agoUpstream keepalive: removed "single" parameter remnants.
Maxim Dounin [Thu, 11 Sep 2014 16:09:04 +0000 (20:09 +0400)]
Upstream keepalive: removed "single" parameter remnants.

The "single" parameter is deprecated and ignored since 5b5c07dee156 (1.3.2).

11 years agoAdded warning about unset cache keys.
Maxim Dounin [Thu, 11 Sep 2014 16:08:52 +0000 (20:08 +0400)]
Added warning about unset cache keys.

In fastcgi, scgi and uwsgi modules there are no default cache keys, and
using a cache without a cache key set is likely meaningless.

11 years agoStyle.
Maxim Dounin [Thu, 11 Sep 2014 16:08:45 +0000 (20:08 +0400)]
Style.

11 years agoUpstream: avoided directly terminating the connection.
FengGu [Wed, 13 Aug 2014 06:53:55 +0000 (14:53 +0800)]
Upstream: avoided directly terminating the connection.

When memory allocation failed in ngx_http_upstream_cache(), the connection
would be terminated directly in ngx_http_upstream_init_request().
Return a INTERNAL_SERVER_ERROR response instead.

11 years agoAdded ngx_init_setproctitle() return code check.
Maxim Dounin [Mon, 8 Sep 2014 17:36:09 +0000 (21:36 +0400)]
Added ngx_init_setproctitle() return code check.

The ngx_init_setproctitle() function, as used on systems without
setproctitle(3), may fail due to memory allocation errors, and
therefore its return code needs to be checked.

Reported by Markus Linnala.

11 years agoFixed ETag memory allocation error handling.
Maxim Dounin [Mon, 8 Sep 2014 17:36:03 +0000 (21:36 +0400)]
Fixed ETag memory allocation error handling.

The etag->hash must be set to 0 to avoid an empty ETag header being
returned with the 500 Internal Server Error page after the memory
allocation failure.

Reported by Markus Linnala.

11 years agoCore: ngx_regex_compile() error handling fixes.
Maxim Dounin [Mon, 8 Sep 2014 17:35:53 +0000 (21:35 +0400)]
Core: ngx_regex_compile() error handling fixes.

Now we actually return NGX_ERROR on errors, and provide an error
string for memory allocation errors.

Reported by Markus Linnala.

11 years agoSSL: guard use of all SSL options for bug workarounds.
Piotr Sikora [Wed, 3 Sep 2014 21:49:55 +0000 (14:49 -0700)]
SSL: guard use of all SSL options for bug workarounds.

Some of the OpenSSL forks (read: BoringSSL) started removing unused,
no longer necessary and/or not really working bug workarounds along
with the SSL options and defines for them.

Instead of fixing nginx build after each removal, be proactive
and guard use of all SSL options for bug workarounds.

Signed-off-by: Piotr Sikora <piotr@cloudflare.com>
11 years agoUpstream: suppressed the file cache slab allocator error messages.
Roman Arutyunyan [Fri, 5 Sep 2014 14:14:59 +0000 (18:14 +0400)]
Upstream: suppressed the file cache slab allocator error messages.

The messages "ngx_slab_alloc() failed: no memory in cache keys zone"
from the file cache slab allocator are suppressed since the allocation
is likely to succeed after the forced expiration of cache nodes.
The second allocation failure is reported.

11 years agoEvents: processing of posted events changed from LIFO to FIFO.
Valentin Bartenev [Mon, 1 Sep 2014 14:20:18 +0000 (18:20 +0400)]
Events: processing of posted events changed from LIFO to FIFO.

In theory, this can provide a bit better distribution of latencies.

Also it simplifies the code, since ngx_queue_t is now used instead
of custom implementation.

11 years agoEvents: removed broken thread support from posted events.
Valentin Bartenev [Mon, 1 Sep 2014 14:20:03 +0000 (18:20 +0400)]
Events: removed broken thread support from posted events.

It's mostly dead code.  And the idea of thread support for this task has
been deprecated.

11 years agoMail: initialize the "signature" field of ngx_mail_session_t.
Valentin Bartenev [Mon, 1 Sep 2014 13:50:59 +0000 (17:50 +0400)]
Mail: initialize the "signature" field of ngx_mail_session_t.

Currently it isn't used, but it can be suitable to distinguish
objects stored in c->data.

11 years agoUpstream: improved configuration parser diagnostics.
Ruslan Ermilov [Mon, 1 Sep 2014 08:27:38 +0000 (12:27 +0400)]
Upstream: improved configuration parser diagnostics.

Made it clear when the selected balancing method does not
support certain parameters of the "server" directive.

11 years agoHeaders filter: "add_header" with "always" parameter (ticket #98).
Sergey Kandaurov [Fri, 29 Aug 2014 14:00:10 +0000 (18:00 +0400)]
Headers filter: "add_header" with "always" parameter (ticket #98).

If specified, the header field is set regardless of the status code.

11 years agoVariables: updated list of prefixes in ngx_http_rewrite_set().
Maxim Dounin [Wed, 27 Aug 2014 17:38:08 +0000 (21:38 +0400)]
Variables: updated list of prefixes in ngx_http_rewrite_set().

11 years agoVariables: fixed non-indexed access of prefix vars (ticket #600).
Maxim Dounin [Wed, 27 Aug 2014 17:38:04 +0000 (21:38 +0400)]
Variables: fixed non-indexed access of prefix vars (ticket #600).

Previously, a configuration like

    location / {
        ssi on;
        ssi_types *;
        set $http_foo "bar";
        return 200 '<!--#echo var="http_foo" -->\n';
    }

resulted in NULL pointer dereference in ngx_http_get_variable() as
the variable was explicitly added to the variables hash, but its
get_handler wasn't properly set in the hash.  Fix is to make sure
that get_handler is properly set by ngx_http_variables_init_vars().

11 years agoSPDY: added a comment about handling stream with the timer set.
Valentin Bartenev [Mon, 18 Aug 2014 09:23:45 +0000 (13:23 +0400)]
SPDY: added a comment about handling stream with the timer set.

11 years agoSPDY: avoid setting timeout on stream events in ngx_http_writer().
Valentin Bartenev [Wed, 27 Aug 2014 16:44:11 +0000 (20:44 +0400)]
SPDY: avoid setting timeout on stream events in ngx_http_writer().

The SPDY module doesn't expect timers can be set on stream events for reasons
other than delaying output.  But ngx_http_writer() could add timer on write
event if the delayed flag wasn't set and nginx is waiting for AIO completion.
That could cause delays in sending response over SPDY when file AIO was used.

11 years agoResolver: notify all waiting requests on timeout.
Ruslan Ermilov [Tue, 19 Aug 2014 11:43:26 +0000 (15:43 +0400)]
Resolver: notify all waiting requests on timeout.

If a "resolver_timeout" occurs, only the first waiting request
was notified.  Other requests may hang forever.

11 years agoStub status: corrected the "stub_status" directive.
Ruslan Ermilov [Tue, 26 Aug 2014 13:35:23 +0000 (17:35 +0400)]
Stub status: corrected the "stub_status" directive.

The "stub_status" directive does not require an argument.

11 years agoSub filter: fixed matching for a single character.
Valentin Bartenev [Mon, 25 Aug 2014 12:08:55 +0000 (16:08 +0400)]
Sub filter: fixed matching for a single character.

11 years agoMail: fixed number of arguments allowed in the listen directive.
Valentin Bartenev [Wed, 20 Aug 2014 09:13:27 +0000 (13:13 +0400)]
Mail: fixed number of arguments allowed in the listen directive.

11 years agoMail: fixed a comment.
Valentin Bartenev [Wed, 20 Aug 2014 09:13:27 +0000 (13:13 +0400)]
Mail: fixed a comment.

There's no loc_conf in the mail module.

11 years agoMp4: use trak->smhd_size in ngx_http_mp4_read_smhd_atom().
Roman Arutyunyan [Tue, 19 Aug 2014 10:13:39 +0000 (14:13 +0400)]
Mp4: use trak->smhd_size in ngx_http_mp4_read_smhd_atom().

Reported by Gang Li.

11 years agoImage filter: downgrade strong etags to weak ones as needed.
Sergey Kandaurov [Mon, 18 Aug 2014 08:03:41 +0000 (12:03 +0400)]
Image filter: downgrade strong etags to weak ones as needed.