]> git.kaiwu.me - nginx.git/log
nginx.git
12 years agoSPDY: the SETTINGS frame should be allocated from sc->pool.
Valentin Bartenev [Wed, 15 Jan 2014 13:16:38 +0000 (17:16 +0400)]
SPDY: the SETTINGS frame should be allocated from sc->pool.

There is no reason to allocate it from connection pool that more like just
a bug especially since ngx_http_spdy_settings_frame_handler() already uses
sc->pool to free a chain.

12 years agoSPDY: fixed possible uninitialized memory access.
Valentin Bartenev [Wed, 15 Jan 2014 13:16:38 +0000 (17:16 +0400)]
SPDY: fixed possible uninitialized memory access.

The frame->stream pointer should always be initialized for control frames since
the check against it can be performed in ngx_http_spdy_filter_cleanup().

12 years agoSPDY: fixed off_t/size_t type conversions on 32 bits platforms.
Valentin Bartenev [Wed, 15 Jan 2014 09:23:31 +0000 (13:23 +0400)]
SPDY: fixed off_t/size_t type conversions on 32 bits platforms.

Parameters of ngx_http_spdy_filter_get_shadow() are changed from size_t to off_t
since the last call of the function may get size and offset from the rest of a
file buffer.  This fixes possible data loss rightfully complained by MSVC on 32
bits systems where off_t is 8 bytes long while size_t is only 4 bytes.

The other two type casts are needed just to suppress warnings about possible
data loss also complained by MSVC but false positive in these cases.

12 years agoSPDY: fixed build, broken by b7ee1bae0ffa.
Valentin Bartenev [Tue, 14 Jan 2014 21:44:52 +0000 (01:44 +0400)]
SPDY: fixed build, broken by b7ee1bae0ffa.

False positive warning about the "cl" variable may be uninitialized in
the ngx_http_spdy_filter_get_data_frame() call was suppressed.

It is always initialized either in the "while" cycle or in the following
"if" condition since frame_size cannot be zero.

12 years agoSPDY: added the "spdy_chunk_size" directive.
Valentin Bartenev [Tue, 14 Jan 2014 12:24:45 +0000 (16:24 +0400)]
SPDY: added the "spdy_chunk_size" directive.

12 years agoSPDY: implemented buffers chain splitting.
Valentin Bartenev [Tue, 14 Jan 2014 12:24:45 +0000 (16:24 +0400)]
SPDY: implemented buffers chain splitting.

It fixes "chain too big in spdy filter" alerts, and adds full support for rate
limiting of SPDY streams.

12 years agoSPDY: body filter was replaced by c->send_chain() function.
Valentin Bartenev [Tue, 14 Jan 2014 12:24:45 +0000 (16:24 +0400)]
SPDY: body filter was replaced by c->send_chain() function.

It allows to use ngx_http_write_filter() and all its rate limiting logic.

12 years agoSPDY: fixed possible premature close of stream.
Valentin Bartenev [Tue, 14 Jan 2014 12:24:45 +0000 (16:24 +0400)]
SPDY: fixed possible premature close of stream.

The "delayed" flag always should be set if there are unsent frames,
but this might not be the case if ngx_http_spdy_body_filter() was
called with NULL chain.

As a result, the "send_timeout" timer could be set on a stream in
ngx_http_writer().  And if the timeout occurred before all the stream
data has been sent, then the request was finalized with the "client
timed out" error.

12 years agoSPDY: refactored ngx_http_spdy_body_filter().
Valentin Bartenev [Tue, 14 Jan 2014 12:24:45 +0000 (16:24 +0400)]
SPDY: refactored ngx_http_spdy_body_filter().

A local pointer to fake connection is introduced
to slightly reduce further patches.

No functional changes.

12 years agoSPDY: elimination of r->blocked counter usage for queuing frames.
Valentin Bartenev [Tue, 14 Jan 2014 12:24:45 +0000 (16:24 +0400)]
SPDY: elimination of r->blocked counter usage for queuing frames.

It was used to prevent destroying of request object when there are unsent
frames in queue for the stream.  Since it was incremented for each frame
and is only 8 bits long, so it was not very hard to overflow the counter.

Now the stream->queued counter is checked instead.

12 years agoSPDY: better name for flag that indicates incomplete frame state.
Valentin Bartenev [Tue, 14 Jan 2014 12:24:45 +0000 (16:24 +0400)]
SPDY: better name for flag that indicates incomplete frame state.

No functional changes.

12 years agoSPDY: better name for queued frames counter.
Valentin Bartenev [Tue, 14 Jan 2014 12:24:45 +0000 (16:24 +0400)]
SPDY: better name for queued frames counter.

No functional changes.

12 years agoSPDY: fixed format specifiers in logging.
Valentin Bartenev [Tue, 14 Jan 2014 12:24:45 +0000 (16:24 +0400)]
SPDY: fixed format specifiers in logging.

12 years agoYear 2014.
Valentin Bartenev [Tue, 14 Jan 2014 12:24:02 +0000 (16:24 +0400)]
Year 2014.

12 years agoResolver: added support for domain names with a trailing dot.
Yichun Zhang [Fri, 10 Jan 2014 19:22:14 +0000 (11:22 -0800)]
Resolver: added support for domain names with a trailing dot.

12 years agoSSL: fixed ssl_verify_depth to take only one argument.
Maxim Dounin [Tue, 14 Jan 2014 11:56:40 +0000 (15:56 +0400)]
SSL: fixed ssl_verify_depth to take only one argument.

12 years agoSSL: ssl_session_tickets directive.
Dirkjan Bussink [Fri, 10 Jan 2014 15:12:40 +0000 (16:12 +0100)]
SSL: ssl_session_tickets directive.

This adds support so it's possible to explicitly disable SSL Session
Tickets. In order to have good Forward Secrecy support either the
session ticket key has to be reloaded by using nginx' binary upgrade
process or using an external key file and reloading the configuration.
This directive adds another possibility to have good support by
disabling session tickets altogether.

If session tickets are enabled and the process lives for a long a time,
an attacker can grab the session ticket from the process and use that to
decrypt any traffic that occured during the entire lifetime of the
process.

12 years agoFixed "zero size buf in output" alerts.
Maxim Dounin [Fri, 3 Jan 2014 23:32:22 +0000 (03:32 +0400)]
Fixed "zero size buf in output" alerts.

If a request had an empty request body (with Content-Length: 0), and there
were preread data available (e.g., due to a pipelined request in the buffer),
the "zero size buf in output" alert might be logged while proxying the
request to an upstream.

Similar alerts appeared with client_body_in_file_only if a request had an
empty request body.

12 years agoWin32: support for UTF-16 surrogate pairs (ticket #457).
Maxim Dounin [Fri, 3 Jan 2014 23:32:15 +0000 (03:32 +0400)]
Win32: support for UTF-16 surrogate pairs (ticket #457).

12 years agoUpstream: Cache-Control preferred over Expires.
Maxim Dounin [Fri, 3 Jan 2014 23:32:10 +0000 (03:32 +0400)]
Upstream: Cache-Control preferred over Expires.

Not really a strict check (as X-Accel-Expires might be ignored or
contain invalid value), but quite simple to implement and better
than what we have now.

12 years agoAdded per-process random seeding (ticket #456).
Maxim Dounin [Fri, 3 Jan 2014 23:32:06 +0000 (03:32 +0400)]
Added per-process random seeding (ticket #456).

12 years agoAllowed up to two EBUSY errors from sendfile().
Maxim Dounin [Fri, 3 Jan 2014 23:31:58 +0000 (03:31 +0400)]
Allowed up to two EBUSY errors from sendfile().

Fallback to synchronous sendfile() now only done on 3rd EBUSY without
any progress in a row.  Not falling back is believed to be better
in case of occasional EBUSY, though protection is still needed to
make sure there will be no infinite loop.

12 years agoFixed setting of content type in some cases.
Ruslan Ermilov [Fri, 27 Dec 2013 15:40:04 +0000 (19:40 +0400)]
Fixed setting of content type in some cases.

This fixes content type set in stub_status and autoindex responses
to be usable in content type checks made by filter modules, such
as charset and sub filters.

12 years agoStyle: removed surplus semicolons.
Valentin Bartenev [Fri, 27 Dec 2013 14:47:42 +0000 (18:47 +0400)]
Style: removed surplus semicolons.

12 years agoSPDY: a bit smarter ngx_http_spdy_filter_get_data_frame().
Valentin Bartenev [Thu, 26 Dec 2013 13:03:16 +0000 (17:03 +0400)]
SPDY: a bit smarter ngx_http_spdy_filter_get_data_frame().

There is no need to pass FLAG_FIN as a separate argument since it can always be
detected from the last_buf flag of the last frame buffer.

No functional changes.

12 years agoSPDY: refactored loop in ngx_http_spdy_body_filter().
Valentin Bartenev [Thu, 26 Dec 2013 13:03:16 +0000 (17:03 +0400)]
SPDY: refactored loop in ngx_http_spdy_body_filter().

No functional changes.

12 years agoSPDY: fixed possible request hang.
Valentin Bartenev [Thu, 26 Dec 2013 13:03:16 +0000 (17:03 +0400)]
SPDY: fixed possible request hang.

Processing events from upstream connection can result in sending queued frames
from other streams.  In this case such streams were not added to handling queue
and properly handled.

A global per connection flag was replaced by a per stream flag that indicates
currently sending stream while all other streams can be added to handling
queue.

12 years agoDav: emit a warning about unsafe URI.
Ruslan Ermilov [Mon, 23 Dec 2013 14:12:03 +0000 (18:12 +0400)]
Dav: emit a warning about unsafe URI.

12 years agoTeach ngx_http_parse_unsafe_uri() how to unescape URIs.
Ruslan Ermilov [Mon, 23 Dec 2013 14:12:00 +0000 (18:12 +0400)]
Teach ngx_http_parse_unsafe_uri() how to unescape URIs.

This fixes handling of escaped URIs in X-Accel-Redirect (ticket #316),
SSI (ticket #240), and DAV.

12 years agoDetect more unsafe URIs in ngx_http_parse_unsafe_uri().
Ruslan Ermilov [Mon, 23 Dec 2013 14:11:56 +0000 (18:11 +0400)]
Detect more unsafe URIs in ngx_http_parse_unsafe_uri().

The following URIs were considered safe: "..", "../foo", and "/foo/..".

12 years agoUpstream: keep $upstream_http_x_accel_redirect intact.
Ruslan Ermilov [Mon, 23 Dec 2013 14:11:46 +0000 (18:11 +0400)]
Upstream: keep $upstream_http_x_accel_redirect intact.

When processing the X-Accel-Redirect header, the value of the
$upstream_http_x_accel_redirect variable was also overwritten.

12 years agoFixed the first argument to getsockopt().
Ruslan Ermilov [Thu, 19 Dec 2013 09:43:18 +0000 (13:43 +0400)]
Fixed the first argument to getsockopt().

While here, always initialize the last argument.

12 years agoSSL: ssl_buffer_size directive.
Maxim Dounin [Fri, 20 Dec 2013 12:18:25 +0000 (16:18 +0400)]
SSL: ssl_buffer_size directive.

12 years agoUpstream: simplified peer selection loop in the "ip_hash" module.
Vladimir Homutov [Mon, 9 Dec 2013 09:43:27 +0000 (13:43 +0400)]
Upstream: simplified peer selection loop in the "ip_hash" module.

Conditions for skipping ineligible peers are rewritten to make adding of new
conditions simpler and be in line with the "round_robin" and "least_conn"
modules.  No functional changes.

12 years agoResolver: use minimum TTL for caching (ticket #329).
Ruslan Ermilov [Mon, 16 Dec 2013 15:12:23 +0000 (19:12 +0400)]
Resolver: use minimum TTL for caching (ticket #329).

12 years agoTypo fixed.
Maxim Dounin [Thu, 19 Dec 2013 09:50:23 +0000 (13:50 +0400)]
Typo fixed.

12 years agoSPDY: use predefined constant for size of the Stream-ID field.
Valentin Bartenev [Wed, 18 Dec 2013 14:39:29 +0000 (18:39 +0400)]
SPDY: use predefined constant for size of the Stream-ID field.

No functional changes.

12 years agoVersion bump.
Valentin Bartenev [Wed, 18 Dec 2013 14:37:48 +0000 (18:37 +0400)]
Version bump.

12 years agorelease-1.5.8 tag
Maxim Dounin [Tue, 17 Dec 2013 13:46:26 +0000 (17:46 +0400)]
release-1.5.8 tag

12 years agonginx-1.5.8-RELEASE release-1.5.8
Maxim Dounin [Tue, 17 Dec 2013 13:46:26 +0000 (17:46 +0400)]
nginx-1.5.8-RELEASE

12 years agoResolver: lookups are case-insensitive.
Ruslan Ermilov [Fri, 13 Dec 2013 16:49:52 +0000 (20:49 +0400)]
Resolver: lookups are case-insensitive.

12 years agoThe "ipv6=" boolean parameter of the "resolver" directive.
Ruslan Ermilov [Mon, 9 Dec 2013 06:53:30 +0000 (10:53 +0400)]
The "ipv6=" boolean parameter of the "resolver" directive.

When set to "off", only IPv4 addresses will be resolved,
and no AAAA queries are ever sent.

12 years agoResolver: implemented IPv6 name to address resolving.
Ruslan Ermilov [Mon, 9 Dec 2013 06:53:28 +0000 (10:53 +0400)]
Resolver: implemented IPv6 name to address resolving.

12 years agoResolver: implemented IPv6 address to name resolving.
Ruslan Ermilov [Fri, 6 Dec 2013 10:30:28 +0000 (14:30 +0400)]
Resolver: implemented IPv6 address to name resolving.

12 years agoChanged resolver API to use ngx_addr_t.
Ruslan Ermilov [Fri, 6 Dec 2013 10:30:27 +0000 (14:30 +0400)]
Changed resolver API to use ngx_addr_t.

12 years agoResolver: fixed indentation.
Ruslan Ermilov [Fri, 13 Dec 2013 15:22:44 +0000 (19:22 +0400)]
Resolver: fixed indentation.

12 years agoCore: externalized ngx_cmp_sockaddr().
Ruslan Ermilov [Fri, 6 Dec 2013 10:30:27 +0000 (14:30 +0400)]
Core: externalized ngx_cmp_sockaddr().

It's also extended with the "cmp_port" argument to indicate
whether ports should be compared as well, or only addresses.

12 years agoResolver: fixes in PTR processing.
Ruslan Ermilov [Fri, 6 Dec 2013 10:30:27 +0000 (14:30 +0400)]
Resolver: fixes in PTR processing.

Verify that class of RR is "IN".
Verify that RR data length is non-zero.

12 years agoResolver: fixes in A processing.
Ruslan Ermilov [Fri, 6 Dec 2013 10:30:27 +0000 (14:30 +0400)]
Resolver: fixes in A processing.

Verify that class of RR is "IN".
Verify that RR data length is exactly four octets.
Correctly shift to the next RR if RR type is unknown.

12 years agoResolver: fixed response processing.
Ruslan Ermilov [Fri, 6 Dec 2013 10:30:27 +0000 (14:30 +0400)]
Resolver: fixed response processing.

Stricten response header checks: ensure that reserved bits are zeroes,
and that the opcode is "standard query".

Fixed the "zero-length domain name in DNS response" condition.

12 years agoResolver: removed unnecessary casts.
Ruslan Ermilov [Fri, 6 Dec 2013 10:30:27 +0000 (14:30 +0400)]
Resolver: removed unnecessary casts.

12 years agoResolver: improved code readability.
Ruslan Ermilov [Fri, 6 Dec 2013 10:30:27 +0000 (14:30 +0400)]
Resolver: improved code readability.

Renamed ngx_resolver_query_t to ngx_resolver_hdr_t as it describes
the header that is common to DNS queries and answers.

Replaced the magic number 12 by the size of the header structure.

The other changes are self-explanatory.

12 years agoTrailing whitespace fix.
Maxim Dounin [Thu, 12 Dec 2013 16:28:48 +0000 (20:28 +0400)]
Trailing whitespace fix.

12 years agoUse ngx_chain_get_free_buf() in pipe input filters.
Valentin Bartenev [Wed, 11 Dec 2013 17:30:38 +0000 (21:30 +0400)]
Use ngx_chain_get_free_buf() in pipe input filters.

No functional changes.

12 years agoSPDY: drop the "delayed" flag when finalizing connection.
Valentin Bartenev [Tue, 10 Dec 2013 16:27:33 +0000 (20:27 +0400)]
SPDY: drop the "delayed" flag when finalizing connection.

This flag in SPDY fake write events serves the same purposes as the "ready"
flag in real events, and it must be dropped if request needs to be handled.
Otherwise, it can prevent the request from finalization if ngx_http_writer()
was set, which results in a connection leak.

Found by Xiaochen Wang.

12 years agoFixed handling of UNIX-domain sockets.
Ruslan Ermilov [Mon, 9 Dec 2013 06:16:44 +0000 (10:16 +0400)]
Fixed handling of UNIX-domain sockets.

When evaluating $local_port, $server_port, and $server_addr,
UNIX-domain sockets were mistakenly interpreted as IPv4 sockets.

12 years agoCore: keep the length of the local sockaddr.
Ruslan Ermilov [Mon, 9 Dec 2013 06:14:51 +0000 (10:14 +0400)]
Core: keep the length of the local sockaddr.

12 years agoFixed incorrect ngx_str_set() usage, broken in c82b2e020b9f.
Piotr Sikora [Sat, 7 Dec 2013 00:00:49 +0000 (16:00 -0800)]
Fixed incorrect ngx_str_set() usage, broken in c82b2e020b9f.

Found by Coverity Scan CID 1135525.

Signed-off-by: Piotr Sikora <piotr@cloudflare.com>
12 years agoContrib: added vim to README.
Maxim Dounin [Fri, 6 Dec 2013 15:58:27 +0000 (19:58 +0400)]
Contrib: added vim to README.

12 years agoContrib: add vim scripts to contrib/ directory.
Evan Miller [Wed, 4 Dec 2013 22:45:44 +0000 (14:45 -0800)]
Contrib: add vim scripts to contrib/ directory.

I've been maintaining these scripts independently for a while now, even though
I'm no longer active in the community. Seems to me that contrib/ is a good
long-term home for the scripts.

12 years agoConfigure: enable -Wconditional-uninitialized with clang.
Ruslan Ermilov [Fri, 6 Dec 2013 09:16:56 +0000 (13:16 +0400)]
Configure: enable -Wconditional-uninitialized with clang.

12 years agoFixed build without SSL, broken by c82b2e020b9f.
Maxim Dounin [Wed, 4 Dec 2013 19:13:13 +0000 (23:13 +0400)]
Fixed build without SSL, broken by c82b2e020b9f.

12 years agoSSL support in the uwsgi module.
Maxim Dounin [Wed, 4 Dec 2013 19:01:27 +0000 (23:01 +0400)]
SSL support in the uwsgi module.

Based on patch by Roberto De Ioris.

12 years agoAdded support for TCP_FASTOPEN supported in Linux >= 3.7.1.
Mathew Rodley [Tue, 3 Dec 2013 18:07:03 +0000 (22:07 +0400)]
Added support for TCP_FASTOPEN supported in Linux >= 3.7.1.
---
 auto/unix                       | 12 ++++++++++++
 src/core/ngx_connection.c       | 32 ++++++++++++++++++++++++++++++++
 src/core/ngx_connection.h       |  4 ++++
 src/http/ngx_http.c             |  4 ++++
 src/http/ngx_http_core_module.c | 21 +++++++++++++++++++++
 src/http/ngx_http_core_module.h |  3 +++
 6 files changed, 76 insertions(+)

12 years agoFixed "setfib=" on non-first listening socket.
Maxim Dounin [Tue, 3 Dec 2013 17:44:08 +0000 (21:44 +0400)]
Fixed "setfib=" on non-first listening socket.

12 years agoImproved code readablity in ngx_http_upstream_init_round_robin().
Vladimir Homutov [Tue, 3 Dec 2013 13:12:16 +0000 (17:12 +0400)]
Improved code readablity in ngx_http_upstream_init_round_robin().

Changed initialization order of the peer structure in one of the
cases to be in line with the rest.

No functional changes.

12 years agoFixed null pointer dereference with $upstream_cache_last_modified.
Ruslan Ermilov [Tue, 3 Dec 2013 11:11:24 +0000 (15:11 +0400)]
Fixed null pointer dereference with $upstream_cache_last_modified.

12 years agoWin32: fixed init_process without master process (ticket #453).
Maxim Dounin [Fri, 29 Nov 2013 13:23:47 +0000 (17:23 +0400)]
Win32: fixed init_process without master process (ticket #453).

Init process callbacks are called by ngx_worker_thread(), there is no
need to call them in ngx_single_process_cycle().

12 years agoUpstream: skip empty cache headers.
Maxim Dounin [Fri, 29 Nov 2013 13:23:38 +0000 (17:23 +0400)]
Upstream: skip empty cache headers.

Notably this fixes HTTP_IF_MODIFIED_SINCE which was always sent with
cache enabled in fastcgi/scgi/uwsgi after 43ccaf8e8728.

12 years agoSSL: fixed c->read->ready handling in ngx_ssl_recv().
Maxim Dounin [Fri, 29 Nov 2013 13:16:06 +0000 (17:16 +0400)]
SSL: fixed c->read->ready handling in ngx_ssl_recv().

If c->read->ready was reset, but later some data were read from a socket
buffer due to a call to ngx_ssl_recv(), the c->read->ready flag should
be restored if not all data were read from OpenSSL buffers (as kernel
won't notify us about the data anymore).

More details are available here:
http://mailman.nginx.org/pipermail/nginx/2013-November/041178.html

12 years agoVersion bump.
Maxim Dounin [Fri, 29 Nov 2013 13:11:36 +0000 (17:11 +0400)]
Version bump.

12 years agorelease-1.5.7 tag
Maxim Dounin [Tue, 19 Nov 2013 10:03:47 +0000 (14:03 +0400)]
release-1.5.7 tag

12 years agonginx-1.5.7-RELEASE release-1.5.7
Maxim Dounin [Tue, 19 Nov 2013 10:03:47 +0000 (14:03 +0400)]
nginx-1.5.7-RELEASE

12 years agoProper backtracking after space in a request line.
Ruslan Ermilov [Tue, 19 Nov 2013 02:57:58 +0000 (06:57 +0400)]
Proper backtracking after space in a request line.

12 years agoUpstream: cache revalidation with conditional requests.
Maxim Dounin [Mon, 18 Nov 2013 16:48:22 +0000 (20:48 +0400)]
Upstream: cache revalidation with conditional requests.

The following new directives are introduced: proxy_cache_revalidate,
fastcgi_cache_revalidate, scgi_cache_revalidate, uwsgi_cache_revalidate.
Default is off.  When set to on, they enable cache revalidation using
conditional requests with If-Modified-Since for expired cache items.

As of now, no attempts are made to merge headers given in a 304 response
during cache revalidation with headers previously stored in a cache item.
Headers in a 304 response are only used to calculate new validity time
of a cache item.

12 years agoSPDY: fixed request hang with the auth request module.
Valentin Bartenev [Mon, 11 Nov 2013 14:49:35 +0000 (18:49 +0400)]
SPDY: fixed request hang with the auth request module.

We should just call post_handler() when subrequest wants to read body, like
it happens for HTTP since rev. f458156fd46a.  An attempt to init request body
for subrequests results in hang if the body was not already read.

12 years agoConfigure: call "make distclean" for libatomic.
Piotr Sikora [Mon, 11 Nov 2013 09:59:47 +0000 (01:59 -0800)]
Configure: call "make distclean" for libatomic.

Signed-off-by: Piotr Sikora <piotr@cloudflare.com>
12 years agoConfigure: call "make clean" for OpenSSL only if Makefile exists.
Piotr Sikora [Tue, 5 Nov 2013 01:00:25 +0000 (17:00 -0800)]
Configure: call "make clean" for OpenSSL only if Makefile exists.

This change allows to build nginx against git checkout of OpenSSL.

Signed-off-by: Piotr Sikora <piotr@cloudflare.com>
12 years agoWin32: plugged memory leak.
Maxim Dounin [Thu, 31 Oct 2013 14:23:49 +0000 (18:23 +0400)]
Win32: plugged memory leak.

12 years agoGunzip: proper error handling on gunzipping an empty response.
Maxim Dounin [Thu, 31 Oct 2013 00:16:20 +0000 (04:16 +0400)]
Gunzip: proper error handling on gunzipping an empty response.

With previous code, an empty (malformed) response resulted in a request
finalized without sending anything to a client.

12 years agoGunzip: "error" logging level on inflate() errors.
Maxim Dounin [Thu, 31 Oct 2013 00:12:53 +0000 (04:12 +0400)]
Gunzip: "error" logging level on inflate() errors.

Errors can easily happen due to broken upstream responses, there is no
need to log them at "alert" level.

12 years agoRemoved extra allocation for $sent_http_last_modified.
Maxim Dounin [Thu, 31 Oct 2013 00:02:59 +0000 (04:02 +0400)]
Removed extra allocation for $sent_http_last_modified.

There is no need to allocate memory for "Last-Modified: " string,
the variable only contains date itself.

12 years agoAuth basic: "info" logging level on no user/password.
Maxim Dounin [Thu, 31 Oct 2013 00:02:21 +0000 (04:02 +0400)]
Auth basic: "info" logging level on no user/password.

This isn't an exceptional condition and normally happens on
first request from a client.

12 years agoGzip, gunzip: flush pending data when incoming chain is NULL.
Yichun Zhang [Mon, 28 Oct 2013 22:01:36 +0000 (15:01 -0700)]
Gzip, gunzip: flush pending data when incoming chain is NULL.

12 years agoCore: handling of getsockopt(TCP_DEFER_ACCEPT) failures.
Maxim Dounin [Thu, 31 Oct 2013 00:00:37 +0000 (04:00 +0400)]
Core: handling of getsockopt(TCP_DEFER_ACCEPT) failures.

Recent Linux versions started to return EOPNOTSUPP to getsockopt() calls
on unix sockets, resulting in log pollution on binary upgrade.  Such errors
are silently ignored now.

12 years agoCore: apply missed options to sockets added during binary upgrade.
Piotr Sikora [Thu, 24 Oct 2013 21:18:37 +0000 (14:18 -0700)]
Core: apply missed options to sockets added during binary upgrade.

The accept_filter and deferred options were not applied to sockets
that were added to configuration during binary upgrade cycle.

Signed-off-by: Piotr Sikora <piotr@cloudflare.com>
12 years agoUpstream: optimize loops in ngx_http_upstream_init_round_robin().
Xiaochen Wang [Mon, 21 Oct 2013 10:20:32 +0000 (18:20 +0800)]
Upstream: optimize loops in ngx_http_upstream_init_round_robin().

12 years agoFixed "satisfy any" if 403 is returned after 401 (ticket #285).
Maxim Dounin [Fri, 18 Oct 2013 14:13:49 +0000 (18:13 +0400)]
Fixed "satisfy any" if 403 is returned after 401 (ticket #285).

The 403 (Forbidden) should not overwrite 401 (Unauthorized) as the
latter should be returned with the WWW-Authenticate header to request
authentication by a client.

The problem could be triggered with 3rd party modules and the "deny"
directive, or with auth_basic and auth_request which returns 403
(in 1.5.4+).

Patch by Jan Marc Hoffmann.

12 years agoHeaders filter: empty Cache-Control is no longer added.
Maxim Dounin [Fri, 18 Oct 2013 14:13:44 +0000 (18:13 +0400)]
Headers filter: empty Cache-Control is no longer added.

Much like with other headers, "add_header Cache-Control $value;" no longer
results in anything added to response headers if $value evaluates to an
empty string.

12 years agoStyle.
Maxim Dounin [Fri, 18 Oct 2013 14:13:35 +0000 (18:13 +0400)]
Style.

12 years agoSSL: added ability to set keys used for Session Tickets (RFC5077).
Piotr Sikora [Fri, 11 Oct 2013 23:05:24 +0000 (16:05 -0700)]
SSL: added ability to set keys used for Session Tickets (RFC5077).

In order to support key rollover, ssl_session_ticket_key can be defined
multiple times. The first key will be used to issue and resume Session
Tickets, while the rest will be used only to resume them.

    ssl_session_ticket_key  session_tickets/current.key;
    ssl_session_ticket_key  session_tickets/prev-1h.key;
    ssl_session_ticket_key  session_tickets/prev-2h.key;

Please note that nginx supports Session Tickets even without explicit
configuration of the keys and this feature should be only used in setups
where SSL traffic is distributed across multiple nginx servers.

Signed-off-by: Piotr Sikora <piotr@cloudflare.com>
12 years agoSSL: SSL_CTX_set_timeout() now always called.
Maxim Dounin [Mon, 14 Oct 2013 09:59:35 +0000 (13:59 +0400)]
SSL: SSL_CTX_set_timeout() now always called.

The timeout set is used by OpenSSL as a hint for clients in TLS Session
Tickets.  Previous code resulted in a default timeout (5m) used for TLS
Sessions Tickets if there was no session cache configured.

Prodded by Piotr Sikora.

12 years agoSSL: fixed build with OpenSSL 0.9.7.
Maxim Dounin [Mon, 14 Oct 2013 09:44:09 +0000 (13:44 +0400)]
SSL: fixed build with OpenSSL 0.9.7.

SSL_get_rbio() and SSL_get_wbio() functions used to get non-const pointer
in OpenSSL 0.9.7, hence an explicit cast added to drop const qualifier.

12 years agoLimit req: fixed "nodelay" parsing.
Maxim Dounin [Wed, 2 Oct 2013 11:07:17 +0000 (15:07 +0400)]
Limit req: fixed "nodelay" parsing.

Previously arguments starting with "nodelay" were considered valid,
e.g. "limit_req ... nodelayFOO;".

12 years agoUpstream: fixed "down" and "backup" parsing.
Maxim Dounin [Wed, 2 Oct 2013 11:07:15 +0000 (15:07 +0400)]
Upstream: fixed "down" and "backup" parsing.

Previously arguments starting with "down" or "backup" were considered
valid, e.g. "server ... downFOO;".

12 years agoUnused macro and variable removed.
Sergey Kandaurov [Wed, 2 Oct 2013 07:51:04 +0000 (11:51 +0400)]
Unused macro and variable removed.

The macro NGX_HTTP_DAV_COPY_BLOCK is not used since 8101d9101ed8 (0.8.9).
The variable ngx_accept_mutex_lock_file was never used.

12 years agoVersion bump.
Sergey Kandaurov [Wed, 2 Oct 2013 07:50:56 +0000 (11:50 +0400)]
Version bump.

12 years agorelease-1.5.6 tag
Maxim Dounin [Tue, 1 Oct 2013 13:44:51 +0000 (17:44 +0400)]
release-1.5.6 tag

12 years agonginx-1.5.6-RELEASE release-1.5.6
Maxim Dounin [Tue, 1 Oct 2013 13:44:51 +0000 (17:44 +0400)]
nginx-1.5.6-RELEASE

12 years agoSPDY: ignore priority when queuing blocked frames.
Valentin Bartenev [Mon, 30 Sep 2013 20:14:37 +0000 (00:14 +0400)]
SPDY: ignore priority when queuing blocked frames.

With this change all such frames will be added in front of the output queue, and
will be sent first.  It prevents HOL blocking when response with higher priority
is blocked by response with lower priority in the middle of the queue because
the order of their SYN_REPLY frames cannot be changed.

Proposed by Yury Kirpichev.