]> git.kaiwu.me - nginx.git/log
nginx.git
11 years agoVersion bump.
Ruslan Ermilov [Wed, 18 Jun 2014 09:39:20 +0000 (13:39 +0400)]
Version bump.

11 years agorelease-1.7.2 tag
Maxim Dounin [Tue, 17 Jun 2014 12:51:25 +0000 (16:51 +0400)]
release-1.7.2 tag

11 years agonginx-1.7.2-RELEASE release-1.7.2
Maxim Dounin [Tue, 17 Jun 2014 12:51:25 +0000 (16:51 +0400)]
nginx-1.7.2-RELEASE

11 years agoConfigure: workaround for system perl on OS X (ticket #576).
Maxim Dounin [Tue, 17 Jun 2014 08:07:06 +0000 (12:07 +0400)]
Configure: workaround for system perl on OS X (ticket #576).

11 years agoUpdated OpenSSL used for win32 builds.
Maxim Dounin [Tue, 17 Jun 2014 07:38:55 +0000 (11:38 +0400)]
Updated OpenSSL used for win32 builds.

11 years agoUpstream: simplified some code that accesses peers.
Ruslan Ermilov [Thu, 12 Jun 2014 17:13:24 +0000 (21:13 +0400)]
Upstream: simplified some code that accesses peers.

No functional changes.

11 years agoAccess log: fix default value, broken by cb308813b453.
Piotr Sikora [Tue, 3 Jun 2014 17:53:48 +0000 (10:53 -0700)]
Access log: fix default value, broken by cb308813b453.

log->filter ("if" parameter) was uninitialized when the default value
was being used, which would lead to a crash (SIGSEGV) when access_log
directive wasn't specified in the configuration.

Zero-fill the whole structure instead of zeroing fields one-by-one
in order to prevent similar issues in the future.

Signed-off-by: Piotr Sikora <piotr@cloudflare.com>
11 years agoCore: slab allocator free pages defragmentation.
Maxim Dounin [Tue, 3 Jun 2014 13:53:03 +0000 (17:53 +0400)]
Core: slab allocator free pages defragmentation.

Large allocations from a slab pool result in free page blocks being fragmented,
eventually leading to a situation when no further allocation larger than a page
size are possible from the pool.  While this isn't a problem for nginx itself,
it is known to be bad for various 3rd party modules.  Fix is to merge adjacent
blocks of free pages in the ngx_slab_free_pages() function.

Prodded by Wandenberg Peixoto and Yichun Zhang.

11 years agoUpstream: generic hash module.
Roman Arutyunyan [Mon, 2 Jun 2014 12:16:22 +0000 (16:16 +0400)]
Upstream: generic hash module.

11 years agoSPDY: fixed operator precedence in uint16/uint32 write macros.
Valentin Bartenev [Thu, 29 May 2014 17:15:19 +0000 (21:15 +0400)]
SPDY: fixed operator precedence in uint16/uint32 write macros.

Since the type cast has precedence higher than the bit shift operator,
all values were truncated to 8 bits.

These macros are used to construct header block for SYN_REPLY frame on
platforms with strict alignment requirements.  As a result, any response
that contains a header with name or value longer than 255 bytes was
corrupted on such platforms.

11 years agoFixed config parsing of the last try_files parameter.
Sergey Kandaurov [Wed, 28 May 2014 16:18:05 +0000 (20:18 +0400)]
Fixed config parsing of the last try_files parameter.

Do not taste the last parameter against directory, as otherwise it would
result in the trailing slash being cut from the parameter value.

Notably, this prevents an internal redirect to an empty URI
if the parameter is set to the literal slash:

    location / { try_files $uri /; }

11 years agoConfigure: added -Wno-deprecated-declarations on OS X.
Maxim Dounin [Wed, 28 May 2014 13:41:44 +0000 (17:41 +0400)]
Configure: added -Wno-deprecated-declarations on OS X.

Previous workaround to avoid warnings on OS X due to deprecated system
OpenSSL library (introduced in a3870ea96ccd) no longer works, as
the MAC_OS_X_VERSION_MIN_REQUIRED macro is ignored on OS X 10.9
if a compiler used supports __attribute__(availability).

11 years agoVersion bump.
Maxim Dounin [Wed, 28 May 2014 13:41:33 +0000 (17:41 +0400)]
Version bump.

11 years agorelease-1.7.1 tag
Maxim Dounin [Tue, 27 May 2014 13:58:09 +0000 (17:58 +0400)]
release-1.7.1 tag

11 years agonginx-1.7.1-RELEASE release-1.7.1
Maxim Dounin [Tue, 27 May 2014 13:58:08 +0000 (17:58 +0400)]
nginx-1.7.1-RELEASE

11 years agoSub filter: fixed subrequests handling.
Maxim Dounin [Tue, 27 May 2014 12:37:35 +0000 (16:37 +0400)]
Sub filter: fixed subrequests handling.

In particular, properly output partial match at the end of a subrequest
response (much like we do at the end of a response), and reset/set the
last_in_chain flag as appropriate.

Reported by KAWAHARA Masashi.

11 years agoSyslog: fixed message sending on win32.
Vladimir Homutov [Tue, 27 May 2014 11:42:34 +0000 (15:42 +0400)]
Syslog: fixed message sending on win32.

11 years agoSyslog: fixed possible resource leak and more verbose logging.
Vladimir Homutov [Mon, 26 May 2014 19:34:44 +0000 (23:34 +0400)]
Syslog: fixed possible resource leak and more verbose logging.

Found by Coverity (CID 1215646).

11 years agoEvents: use eventfd() instead of syscall(SYS_eventfd) if possible.
Ruslan Ermilov [Fri, 23 May 2014 12:37:05 +0000 (16:37 +0400)]
Events: use eventfd() instead of syscall(SYS_eventfd) if possible.

This fixes --with-file-aio support on systems that lack eventfd()
syscall, notably aarch64 Linux.

The syscall(SYS_eventfd) may still be necessary on systems that
have eventfd() syscall in the kernel but lack it in glibc, e.g.
as seen in the current CentOS 5 release.

11 years agoUpstream: fix tries check in ip_hash.
Roman Arutyunyan [Fri, 23 May 2014 09:47:05 +0000 (13:47 +0400)]
Upstream: fix tries check in ip_hash.

Make two checks for maximum number of tries consistent.
The other one checks '>' condition.

11 years agoMail: output client port number on client connects (ticket #531).
Ruslan Ermilov [Wed, 21 May 2014 20:16:17 +0000 (00:16 +0400)]
Mail: output client port number on client connects (ticket #531).

11 years agoCore: output client port number when logging accept event.
Ruslan Ermilov [Wed, 21 May 2014 20:16:09 +0000 (00:16 +0400)]
Core: output client port number when logging accept event.

11 years agoMail: added a check for the number of arguments in MAIL/RCPT.
Maxim Dounin [Wed, 21 May 2014 17:56:20 +0000 (21:56 +0400)]
Mail: added a check for the number of arguments in MAIL/RCPT.

Missed during introduction of the SMTP pipelining support (04e43d03e153,
1.5.6).  Previously, the check wasn't needed as s->buffer was used directly
and the number of arguments didn't matter.

Reported by Svyatoslav Nikolsky.

12 years agoAdded syslog support for error_log and access_log directives.
Vladimir Homutov [Mon, 12 May 2014 12:34:15 +0000 (16:34 +0400)]
Added syslog support for error_log and access_log directives.

11 years agoConfigure: the --build= option.
Ruslan Ermilov [Tue, 20 May 2014 12:10:07 +0000 (16:10 +0400)]
Configure: the --build= option.

If set, its value is output in "nginx -v" and in the error log.

11 years agoSSL: $ssl_client_fingerprint variable.
Sergey Budnevitch [Tue, 20 May 2014 10:03:03 +0000 (14:03 +0400)]
SSL: $ssl_client_fingerprint variable.

11 years agoSetting $args now invalidates unparsed uri.
Maxim Dounin [Mon, 19 May 2014 18:45:35 +0000 (22:45 +0400)]
Setting $args now invalidates unparsed uri.

Prodded by Yichun Zhang.

11 years agoCharset filter: fixed charset setting on encoded replies.
Maxim Dounin [Mon, 19 May 2014 18:45:34 +0000 (22:45 +0400)]
Charset filter: fixed charset setting on encoded replies.

If response is gzipped we can't recode response, but in case it's not
needed we still can add charset to Content-Type.

The r->ignore_content_encoding is dropped accordingly, charset with gzip_static
now properly works without any special flags.

11 years agoFixed alias in regex locations with limit_except/if.
Maxim Dounin [Fri, 16 May 2014 13:42:24 +0000 (17:42 +0400)]
Fixed alias in regex locations with limit_except/if.

The ngx_http_map_uri_to_path() function used clcf->regex to detect if
it's working within a location given by a regular expression and have
to replace full URI with alias (instead of a part matching the location
prefix).  This is incorrect due to clcf->regex being false in implicit
locations created by if and limit_except.

Fix is to preserve relevant information in clcf->alias instead, by setting
it to NGX_MAX_SIZE_T_VALUE if an alias was specified in a regex location.

12 years agoSPDY: added protection from overrun of the receive buffer.
Valentin Bartenev [Wed, 30 Apr 2014 16:34:20 +0000 (20:34 +0400)]
SPDY: added protection from overrun of the receive buffer.

12 years agoSPDY: added a debug point to the state buffer overflow protection.
Valentin Bartenev [Wed, 30 Apr 2014 16:34:20 +0000 (20:34 +0400)]
SPDY: added a debug point to the state buffer overflow protection.

12 years agoSPDY: refactored ngx_http_spdy_state_headers().
Valentin Bartenev [Wed, 30 Apr 2014 16:34:20 +0000 (20:34 +0400)]
SPDY: refactored ngx_http_spdy_state_headers().

This change is similar to d2ac5cf4056d.  Special flag of completeness looks
surplus when there is also a counter of frame bytes left.

12 years agoSPDY: improved logging.
Valentin Bartenev [Wed, 30 Apr 2014 16:34:20 +0000 (20:34 +0400)]
SPDY: improved logging.

12 years agoSPDY: set log action for PROXY protocol only while parsing it.
Valentin Bartenev [Thu, 15 May 2014 15:22:06 +0000 (19:22 +0400)]
SPDY: set log action for PROXY protocol only while parsing it.

Handling of PROXY protocol for SPDY connection is currently implemented as
a SPDY state.  And while nginx waiting for PROXY protocol data it continues
to process SPDY connection: initializes zlib context, sends control frames.

12 years agoSPDY: ngx_http_spdy_state_headers() error handling cleanup.
Valentin Bartenev [Wed, 30 Apr 2014 16:34:20 +0000 (20:34 +0400)]
SPDY: ngx_http_spdy_state_headers() error handling cleanup.

 - Specification-friendly handling of invalid header block or special headers.
   Such errors are not fatal for session and shouldn't lead to connection close;

 - Avoid mix of NGX_HTTP_PARSE_INVALID_REQUEST/NGX_HTTP_PARSE_INVALID_HEADER.

12 years agoSPDY: improved error handling of header block decompression.
Valentin Bartenev [Wed, 30 Apr 2014 16:34:20 +0000 (20:34 +0400)]
SPDY: improved error handling of header block decompression.

Now cases when decompression failed due to internal error
and when a client sent corrupted data are distinguished.

12 years agoSPDY: removed ngx_http_spdy_state_headers_error().
Valentin Bartenev [Wed, 30 Apr 2014 16:34:20 +0000 (20:34 +0400)]
SPDY: removed ngx_http_spdy_state_headers_error().

The function just calls ngx_http_spdy_state_headers_skip() most of the time.
There was also an attempt of optimization to stop parsing if the client already
closed connection, but it looks strange and unfinished anyway.

12 years agoSPDY: prevented creation of RST_STREAM in protocol error state.
Valentin Bartenev [Thu, 15 May 2014 15:18:26 +0000 (19:18 +0400)]
SPDY: prevented creation of RST_STREAM in protocol error state.

Previously, the frame wasn't sent anyway (and had a wrong status code).

12 years agoSPDY: improved ngx_http_spdy_state_protocol_error().
Valentin Bartenev [Wed, 30 Apr 2014 16:33:58 +0000 (20:33 +0400)]
SPDY: improved ngx_http_spdy_state_protocol_error().

Now ngx_http_spdy_state_protocol_error() is able to close stream,
so there is no need in a separate call for this.

Also fixed zero status code in logs for some cases.

12 years agoSPDY: fixed one case of improper memory allocation error handling.
Valentin Bartenev [Tue, 29 Apr 2014 22:16:21 +0000 (02:16 +0400)]
SPDY: fixed one case of improper memory allocation error handling.

Now ngx_http_spdy_construct_request_line() doesn't try to finalize request
in case of failed memory allocation.

12 years agoStyle: use %N instead of '\n' where appropriate.
Ruslan Ermilov [Wed, 14 May 2014 18:26:30 +0000 (22:26 +0400)]
Style: use %N instead of '\n' where appropriate.

12 years agoCore: use '\r' for CR and '\n' for LF definitions.
Ruslan Ermilov [Wed, 14 May 2014 18:26:05 +0000 (22:26 +0400)]
Core: use '\r' for CR and '\n' for LF definitions.

12 years agoOCSP stapling: missing OCSP request free call.
Filipe da Silva [Tue, 29 Apr 2014 20:22:38 +0000 (22:22 +0200)]
OCSP stapling: missing OCSP request free call.

12 years agoUpstream: restored workaround for "if".
Maxim Dounin [Wed, 30 Apr 2014 15:16:55 +0000 (19:16 +0400)]
Upstream: restored workaround for "if".

The 7022564a9e0e changeset made ineffective workaround from 2464ccebdb52
to avoid NULL pointer dereference with "if".  It is now restored by
moving the u->ssl_name initialization after the check.

Found by Coverity (CID 1210408).

12 years agoCore: improved ngx_conf_parse() error handling.
Maxim Dounin [Wed, 30 Apr 2014 15:16:49 +0000 (19:16 +0400)]
Core: improved ngx_conf_parse() error handling.

Previous code failed to properly restore cf->conf_file in case of
ngx_close_file() errors, potentially resulting in double free of
cf->conf_file->buffer->start.

Found by Coverity (CID 1087507).

12 years agoCore: fixed error handling in ngx_reopen_files().
Maxim Dounin [Wed, 30 Apr 2014 15:16:40 +0000 (19:16 +0400)]
Core: fixed error handling in ngx_reopen_files().

Found by Coverity (CID 1087509).

12 years agoCache: added ngx_quit check to ngx_http_file_cache_expire().
Maxim Dounin [Wed, 30 Apr 2014 15:16:35 +0000 (19:16 +0400)]
Cache: added ngx_quit check to ngx_http_file_cache_expire().

While managing big caches it is possible that expiring old cache items
in ngx_http_file_cache_expire() will take a while.  Added a check for
ngx_quit / ngx_terminate to make sure cache manager can be terminated
while in ngx_http_file_cache_expire().

12 years agoConfigure: typo fixed.
Maxim Dounin [Wed, 30 Apr 2014 15:16:30 +0000 (19:16 +0400)]
Configure: typo fixed.

12 years agoUpstream: added the "$upstream_cookie_<name>" variables.
Vladimir Homutov [Tue, 29 Apr 2014 08:28:41 +0000 (12:28 +0400)]
Upstream: added the "$upstream_cookie_<name>" variables.

12 years agoProxy: fixed possible uninitialized memory access.
Valentin Bartenev [Sun, 17 Nov 2013 23:06:45 +0000 (03:06 +0400)]
Proxy: fixed possible uninitialized memory access.

The ngx_http_proxy_rewrite_cookie() function expects the value of the
"Set-Cookie" header to be null-terminated, and for headers obtained
from proxied server it is usually true.

Now the ngx_http_proxy_rewrite() function preserves the null character
while rewriting headers.

This fixes accessing memory outside of rewritten value if both the
"proxy_cookie_path" and "proxy_cookie_domain" directives are used in
the same location.

12 years agoVersion bump.
Valentin Bartenev [Thu, 24 Apr 2014 16:50:10 +0000 (20:50 +0400)]
Version bump.

12 years agorelease-1.7.0 tag
Maxim Dounin [Thu, 24 Apr 2014 12:54:23 +0000 (16:54 +0400)]
release-1.7.0 tag

12 years agonginx-1.7.0-RELEASE release-1.7.0
Maxim Dounin [Thu, 24 Apr 2014 12:54:22 +0000 (16:54 +0400)]
nginx-1.7.0-RELEASE

12 years agoSSL: explicit handling of empty names.
Maxim Dounin [Wed, 23 Apr 2014 16:31:31 +0000 (20:31 +0400)]
SSL: explicit handling of empty names.

X509_check_host() can't handle non null-terminated names with zero length,
so make sure to fail before calling it.

12 years agoMissed comma fixed. A couple of Latin symbols plugged into
Maxim Konovalov [Wed, 23 Apr 2014 16:00:59 +0000 (16:00 +0000)]
Missed comma fixed.  A couple of Latin symbols plugged into
Russian text changed to Russian counterparts.

12 years agoUpstream: for ssl name, non-aligned memory allocation is enough.
Ruslan Ermilov [Tue, 22 Apr 2014 14:56:49 +0000 (18:56 +0400)]
Upstream: for ssl name, non-aligned memory allocation is enough.

12 years agoSSL: added explicit check for ngx_strlchr() result.
Maxim Dounin [Tue, 22 Apr 2014 10:02:45 +0000 (14:02 +0400)]
SSL: added explicit check for ngx_strlchr() result.

12 years agoSPDY: avoid sending RST_STREAM on WINDOW_UPDATE with unknown SID.
Valentin Bartenev [Mon, 21 Apr 2014 15:21:17 +0000 (19:21 +0400)]
SPDY: avoid sending RST_STREAM on WINDOW_UPDATE with unknown SID.

There's a race condition between closing a stream by one endpoint
and sending a WINDOW_UPDATE frame by another.  So it would be better
to just skip such frames for unknown streams, like is already done
for the DATA frames.

12 years agoSPDY: Stream-ID restrictions according to specification.
Valentin Bartenev [Mon, 21 Apr 2014 14:59:53 +0000 (18:59 +0400)]
SPDY: Stream-ID restrictions according to specification.

12 years agoDocumented the switch from java XSLScript to xslscript.pl.
Ruslan Ermilov [Mon, 21 Apr 2014 09:48:41 +0000 (13:48 +0400)]
Documented the switch from java XSLScript to xslscript.pl.

12 years agoUpstream: uwsgi_ssl_name, uwsgi_ssl_verify, and so on.
Maxim Dounin [Fri, 18 Apr 2014 16:13:32 +0000 (20:13 +0400)]
Upstream: uwsgi_ssl_name, uwsgi_ssl_verify, and so on.

Just a merge of proxy_ssl_name, proxy_ssl_verify commits into uwsgi module,
code is identical.

12 years agoUpstream: proxy_ssl_verify and friends.
Maxim Dounin [Fri, 18 Apr 2014 16:13:30 +0000 (20:13 +0400)]
Upstream: proxy_ssl_verify and friends.

12 years agoUpstream: proxy_ssl_name and proxy_ssl_server_name directives.
Maxim Dounin [Fri, 18 Apr 2014 16:13:28 +0000 (20:13 +0400)]
Upstream: proxy_ssl_name and proxy_ssl_server_name directives.

These directives allow to switch on Server Name Indication (SNI) while
connecting to upstream servers.

By default, proxy_ssl_server_name is currently off (that is, no SNI) and
proxy_ssl_name is set to a host used in the proxy_pass directive.

12 years agoUpstream: plugged potential memory leak on reload.
Maxim Dounin [Fri, 18 Apr 2014 16:13:24 +0000 (20:13 +0400)]
Upstream: plugged potential memory leak on reload.

The SSL_CTX_set_cipher_list() may fail if there are no valid ciphers
specified in proxy_ssl_ciphers / uwsgi_ssl_ciphers, resulting in
SSL context leak.

In theory, ngx_pool_cleanup_add() may fail too, but this case is
intentionally left out for now as it's almost impossible and proper fix
will require changes to http ssl and mail ssl code as well.

12 years agoSSL: $ssl_server_name variable.
Maxim Dounin [Fri, 18 Apr 2014 16:13:21 +0000 (20:13 +0400)]
SSL: $ssl_server_name variable.

12 years agoSSL: fixed misuse of NGX_LOG_DEBUG_HTTP.
Maxim Dounin [Fri, 18 Apr 2014 16:13:14 +0000 (20:13 +0400)]
SSL: fixed misuse of NGX_LOG_DEBUG_HTTP.

12 years agoVersion bump.
Maxim Dounin [Fri, 18 Apr 2014 16:12:53 +0000 (20:12 +0400)]
Version bump.

12 years agoAccess log: the "if" parameter of the "access_log" directive.
Sergey Kandaurov [Tue, 15 Apr 2014 17:32:56 +0000 (21:32 +0400)]
Access log: the "if" parameter of the "access_log" directive.

The parameter value specifies a condition under which the request is logged.

12 years agoSPDY: fixed typo in log message.
Valentin Bartenev [Wed, 16 Apr 2014 07:40:42 +0000 (11:40 +0400)]
SPDY: fixed typo in log message.

12 years agoFixed missing "static" in declaration of ngx_http_gzip_quantity().
Valentin Bartenev [Wed, 16 Apr 2014 07:40:38 +0000 (11:40 +0400)]
Fixed missing "static" in declaration of ngx_http_gzip_quantity().

12 years agoSPDY: moved a variable initialization near to its check.
Valentin Bartenev [Wed, 9 Apr 2014 14:15:32 +0000 (18:15 +0400)]
SPDY: moved a variable initialization near to its check.

This should prevent attempts of using pointer before it was checked, since
all modern compilers are able to spot access to uninitialized variable.

No functional changes.

12 years agoSPDY: fixed arguments supplied for an error message.
Valentin Bartenev [Tue, 8 Apr 2014 16:12:30 +0000 (20:12 +0400)]
SPDY: fixed arguments supplied for an error message.

12 years agoVersion bump.
Valentin Bartenev [Tue, 8 Apr 2014 16:11:31 +0000 (20:11 +0400)]
Version bump.

12 years agorelease-1.5.13 tag
Maxim Dounin [Tue, 8 Apr 2014 14:15:22 +0000 (18:15 +0400)]
release-1.5.13 tag

12 years agonginx-1.5.13-RELEASE release-1.5.13
Maxim Dounin [Tue, 8 Apr 2014 14:15:21 +0000 (18:15 +0400)]
nginx-1.5.13-RELEASE

12 years agoUpdated OpenSSL used for win32 builds.
Maxim Dounin [Tue, 8 Apr 2014 13:48:03 +0000 (17:48 +0400)]
Updated OpenSSL used for win32 builds.

12 years agoSPDY: avoid creating flush frames.
Valentin Bartenev [Mon, 7 Apr 2014 19:35:33 +0000 (23:35 +0400)]
SPDY: avoid creating flush frames.

Previously, an empty frame object was created for an output chain that contains
only sync or flush empty buffers.  But since 39d7eef2e332 every DATA frame has
the flush flag set on its last buffer, so there's no need any more in additional
flush buffers in the output queue and they can be skipped.

Note that such flush frames caused an incorrect $body_bytes_sent value.

12 years agoSPDY: consistently handle control frames with unknown type.
Valentin Bartenev [Mon, 7 Apr 2014 15:27:56 +0000 (19:27 +0400)]
SPDY: consistently handle control frames with unknown type.

The SPDY draft 2 specification requires that if an endpoint receives a
control frame for a type it does not recognize, it must ignore the frame.
But the 3 and 3.1 drafts don't seem to declare any behavior for such case.
Then sticking with the previous draft in this matter looks to be right.

But previously, only 8 least significant bits of the type field were
parsed while the rest of 16 bits of the field were checked against zero.
Though there are no known frame types bigger than 255, this resulted in
inconsistency in handling of such frames: they were not recognized as
valid frames at all, and the connection was closed.

12 years agoSPDY: refactored ngx_http_spdy_state_read_data().
Valentin Bartenev [Mon, 7 Apr 2014 15:27:56 +0000 (19:27 +0400)]
SPDY: refactored ngx_http_spdy_state_read_data().

There's no more need in a separate indicator of frame completeness
after d74889fbf06d.

12 years agoSPDY: better detect premature closing of stream.
Valentin Bartenev [Mon, 7 Apr 2014 15:27:56 +0000 (19:27 +0400)]
SPDY: better detect premature closing of stream.

Following a24f88eff684, now the case when the FIN flag is set in SYN_STREAM
is also covered.

12 years agoWin32: fixed shared ssl_session_cache (ticket #528).
Maxim Dounin [Mon, 7 Apr 2014 14:55:57 +0000 (18:55 +0400)]
Win32: fixed shared ssl_session_cache (ticket #528).

In a worker process shm_zone->data was set to NULL instead of a proper value
extracted from shared memory.

12 years agoWin32: fixed link flags with MSVC, broken by bfe536716dbf.
Maxim Dounin [Mon, 7 Apr 2014 14:29:05 +0000 (18:29 +0400)]
Win32: fixed link flags with MSVC, broken by bfe536716dbf.

Notably, "-debug" was omitted, resulting in an executable without debug
symbols.

12 years agoMp4: allow end values bigger than track duration.
Roman Arutyunyan [Tue, 1 Apr 2014 16:53:18 +0000 (20:53 +0400)]
Mp4: allow end values bigger than track duration.

If start time is within the track but end time is out of it, error
"end time is out mp4 stts samples" is generated.  However it's
better to ignore the error and output the track until its end.

12 years agoAdjusted default value of types_hash_bucket_size (ticket #352).
Maxim Dounin [Mon, 31 Mar 2014 18:47:42 +0000 (22:47 +0400)]
Adjusted default value of types_hash_bucket_size (ticket #352).

The ngx_cacheline_size may be too low on some platforms, resulting
in unexpected hash build problems (as no collisions are tolerated due
to low bucket_size, and max_size isn't big enough to build a hash without
collisions).  These problems aren't fatal anymore but nevertheless
need to be addressed.

12 years agoCore: fixed hash to actually try max_size.
Maxim Dounin [Mon, 31 Mar 2014 17:40:35 +0000 (21:40 +0400)]
Core: fixed hash to actually try max_size.

Previously, maximum size of a hash table built was (max_size - 1).

12 years agoCore: hash now ignores bucket_size if it hits max_size limit.
Maxim Dounin [Mon, 31 Mar 2014 17:40:31 +0000 (21:40 +0400)]
Core: hash now ignores bucket_size if it hits max_size limit.

12 years agoCore: slab log_nomem flag.
Maxim Dounin [Mon, 31 Mar 2014 17:38:30 +0000 (21:38 +0400)]
Core: slab log_nomem flag.

The flag allows to suppress "ngx_slab_alloc() failed: no memory" messages
from a slab allocator, e.g., if an LRU expiration is used by a consumer
and allocation failures aren't fatal.

The flag is now used in the SSL session cache code, and in the limit_req
module.

12 years agoWin32: fixed cpu hog by cache manager on exit (ticket #514).
Maxim Dounin [Mon, 31 Mar 2014 17:38:28 +0000 (21:38 +0400)]
Win32: fixed cpu hog by cache manager on exit (ticket #514).

The "ngx_quit" may be reset by the worker thread before it's seen
by a ngx_cache_manager_thread(), resulting in an infinite loop.  Make
sure to test ngx_exiting as well.

12 years agoMail: fixed ngx_mail_send() (ticket #519).
Maxim Dounin [Mon, 31 Mar 2014 17:38:27 +0000 (21:38 +0400)]
Mail: fixed ngx_mail_send() (ticket #519).

12 years agoAdded #ifndef around NGX_HAVE_CASELESS_FILESYSTEM define.
Maxim Dounin [Mon, 31 Mar 2014 17:38:25 +0000 (21:38 +0400)]
Added #ifndef around NGX_HAVE_CASELESS_FILESYSTEM define.

This brings Cygwin compilation in line with other case-insensitive
systems (notably win32 and OS X) where one can force case sensitivity
using -DNGX_HAVE_CASELESS_FILESYSTEM=0.

12 years agoMp4: improved logging after adding "end" support.
Roman Arutyunyan [Mon, 31 Mar 2014 16:05:53 +0000 (20:05 +0400)]
Mp4: improved logging after adding "end" support.

Despite introducing start and end crop operations existing log
messages still mostly refer only to start.  Logging is improved
to match both cases.

New debug logging is added to track entry count in atoms after
cropping.

Two format type mismatches are fixed as well.

12 years agoMp4: fixed seeking to a track end.
Roman Arutyunyan [Mon, 31 Mar 2014 15:52:17 +0000 (19:52 +0400)]
Mp4: fixed seeking to a track end.

When "start" value is equal to a track duration the request
fails with "time is out mp4 stts" like it did before track
duration check was added.  Now such tracks are considered
short and skipped.

12 years agoSPDY: detect premature closing of stream.
Valentin Bartenev [Fri, 28 Mar 2014 16:22:57 +0000 (20:22 +0400)]
SPDY: detect premature closing of stream.

The SPDY/3.1 specification requires that the server must respond with
a 400 "Bad request" error if the sum of the data frame payload lengths
does not equal the size of the Content-Length header.

This also fixes "zero size buf in output" alert, that might be triggered
if client sends a greater than zero Content-Length header and closes
stream using the FIN flag with an empty request body.

12 years agoSPDY: fixed the DATA frame length handling in case of some errors.
Valentin Bartenev [Fri, 28 Mar 2014 16:05:07 +0000 (20:05 +0400)]
SPDY: fixed the DATA frame length handling in case of some errors.

There are a few cases in ngx_http_spdy_state_read_data() related to error
handling when ngx_http_spdy_state_skip() might be called with an inconsistent
state between *pos and sc->length, that leads to violation of frame layout
parsing and resuted in corruption of spdy connection.

Based on a patch by Xiaochen Wang.

12 years agoSPDY: better detect if headers block has wrong entries count.
Valentin Bartenev [Wed, 26 Mar 2014 14:01:11 +0000 (18:01 +0400)]
SPDY: better detect if headers block has wrong entries count.

Previously, only one case was checked: if there's more data to parse
in a r->header_in buffer, but the buffer can be filled to the end by
the last parsed entry, so we also need to check that there's no more
data to inflate.

12 years agoSPDY: detect premature end of frame while start parsing headers.
Valentin Bartenev [Wed, 26 Mar 2014 13:43:39 +0000 (17:43 +0400)]
SPDY: detect premature end of frame while start parsing headers.

12 years agoApply underscores_in_headers also to the first character.
Piotr Sikora [Mon, 24 Mar 2014 23:35:44 +0000 (16:35 -0700)]
Apply underscores_in_headers also to the first character.

Signed-off-by: Piotr Sikora <piotr@cloudflare.com>
12 years agoIncreased default value of variables_hash_max_size.
Andrei Belov [Tue, 25 Mar 2014 14:49:28 +0000 (18:49 +0400)]
Increased default value of variables_hash_max_size.

12 years agoMp4: skipped empty stss atom table in output.
Sergey Kandaurov [Mon, 24 Mar 2014 13:55:10 +0000 (17:55 +0400)]
Mp4: skipped empty stss atom table in output.

The atom may have no data entries after cropping.

This fixes "zero size buf in output" alerts.

12 years agoRange filter: single_range flag in request.
Maxim Dounin [Fri, 21 Mar 2014 15:33:21 +0000 (19:33 +0400)]
Range filter: single_range flag in request.

If set, it means that response body is going to be in more than one buffer,
hence only range requests with a single range should be honored.

The flag is now used by mp4 and cacheable upstream responses, thus allowing
range requests of mp4 files with start/end, as well as range processing
on a first request to a not-yet-cached files with proxy_cache.

Notably this makes it possible to play mp4 files (with proxy_cache, or with
mp4 module) on iOS devices, as byte-range support is required by Apple.