]> git.kaiwu.me - nginx.git/log
nginx.git
14 years agoMerge of r4578, r4579, r4580, r4586: mp4 fixes.
Maxim Dounin [Thu, 12 Apr 2012 12:55:43 +0000 (12:55 +0000)]
Merge of r4578, r4579, r4580, r4586: mp4 fixes.

14 years agoVersion bump.
Maxim Dounin [Thu, 12 Apr 2012 12:47:36 +0000 (12:47 +0000)]
Version bump.

14 years agorelease-1.0.14 tag
Maxim Dounin [Thu, 15 Mar 2012 11:51:16 +0000 (11:51 +0000)]
release-1.0.14 tag

14 years agonginx-1.0.14-RELEASE release-1.0.14
Maxim Dounin [Thu, 15 Mar 2012 11:50:53 +0000 (11:50 +0000)]
nginx-1.0.14-RELEASE

14 years agoUpdated OpenSSL and PCRE used for win32 builds.
Maxim Dounin [Thu, 15 Mar 2012 11:46:29 +0000 (11:46 +0000)]
Updated OpenSSL and PCRE used for win32 builds.

14 years agoMerge of r4530, r4531: null character fixes.
Maxim Dounin [Thu, 15 Mar 2012 11:41:43 +0000 (11:41 +0000)]
Merge of r4530, r4531: null character fixes.

*) Fixed incorrect ngx_cpystrn() usage in ngx_http_*_process_header().

   This resulted in a disclosure of previously freed memory if upstream
   server returned specially crafted response, potentially exposing
   sensitive information.

   Reported by Matthew Daley.

*) Headers with null character are now rejected.

   Headers with NUL character aren't allowed by HTTP standard and may cause
   various security problems.  They are now unconditionally rejected.

14 years agoVersion bump.
Maxim Dounin [Thu, 15 Mar 2012 11:37:11 +0000 (11:37 +0000)]
Version bump.

14 years agorelease-1.0.13 tag
Maxim Dounin [Mon, 5 Mar 2012 15:20:15 +0000 (15:20 +0000)]
release-1.0.13 tag

14 years agonginx-1.0.13-RELEASE release-1.0.13
Maxim Dounin [Mon, 5 Mar 2012 15:19:49 +0000 (15:19 +0000)]
nginx-1.0.13-RELEASE

14 years agoMerge of r4500: fixed spelling in single-line comments.
Maxim Dounin [Mon, 5 Mar 2012 13:26:40 +0000 (13:26 +0000)]
Merge of r4500: fixed spelling in single-line comments.

14 years agoMerge of r4499: workaround for fs_size on ZFS (ticket #46).
Maxim Dounin [Mon, 5 Mar 2012 13:20:40 +0000 (13:20 +0000)]
Merge of r4499: workaround for fs_size on ZFS (ticket #46).

ZFS reports incorrect st_blocks until file settles on disk, and this
may take a while (i.e. just after creation of a file the st_blocks value
is incorrect).  As a workaround we now use st_blocks only if
st_blocks * 512 > st_size, this should fix ZFS problems while still
preserving accuracy for other filesystems.

The problem had appeared in r3900 (1.0.1).

14 years agoMerge of r4498:
Maxim Dounin [Mon, 5 Mar 2012 13:17:56 +0000 (13:17 +0000)]
Merge of r4498:

Fix of rbtree lookup on hash collisions.

Previous code incorrectly assumed that nodes with identical keys are linked
together.  This might not be true after tree rebalance.

Patch by Lanshun Zhou.

14 years agoMerge of r4497:
Maxim Dounin [Mon, 5 Mar 2012 13:06:29 +0000 (13:06 +0000)]
Merge of r4497:

Fixed null pointer dereference in resolver (ticket #91).

The cycle->new_log.file may not be set before config parsing finished if
there are no error_log directive defined at global level.  Fix is to
copy it after config parsing.

Patch by Roman Arutyunyan.

14 years agoMerge of r4491, r4492:
Maxim Dounin [Mon, 5 Mar 2012 13:03:39 +0000 (13:03 +0000)]
Merge of r4491, r4492:

*) Renamed constants and fixed off-by-one error in "msie_padding on"
   handling.

*) Added support for the 307 Temporary Redirect.

14 years agoMerge of r4474, r4493: configure/build fixes.
Maxim Dounin [Mon, 5 Mar 2012 12:58:10 +0000 (12:58 +0000)]
Merge of r4474, r4493: configure/build fixes.

*) Fixed build with embedded perl and --with-openssl.

*) Configure: moved icc detection before gcc.  New versions of icc
   confuse auto/cc/name due to introduced handling of a "icc -v".

14 years agoMerge of r4473:
Maxim Dounin [Mon, 5 Mar 2012 12:49:32 +0000 (12:49 +0000)]
Merge of r4473:

Core: protection from cycles with named locations and post_action.

Now redirects to named locations are counted against normal uri changes
limit, and post_action respects this limit as well.  As a result at least
the following (bad) configurations no longer trigger infinite cycles:

1. Post action which recursively triggers post action:

    location / {
        post_action /index.html;
    }

2. Post action pointing to nonexistent named location:

    location / {
        post_action @nonexistent;
    }

3. Recursive error page for 500 (Internal Server Error) pointing to
   a nonexistent named location:

    location / {
        recursive_error_pages on;
        error_page 500 @nonexistent;
        return 500;
    }

14 years agoMerge of r4471:
Maxim Dounin [Mon, 5 Mar 2012 12:36:51 +0000 (12:36 +0000)]
Merge of r4471:

Variables: honor no_cacheable for not_found variables.

Variables with the "not_found" flag set follow the same rules as ones with
the "valid" flag set.  Make sure ngx_http_get_flushed_variable() will flush
non-cacheable variables with the "not_found" flag set.

This fixes at least one known problem with $args not available in a subrequest
(with args) when there were no args in the main request and $args variable was
queried in the main request (reported by Laurence Rowe aka elro on irc).

Also this eliminates unneeded call to ngx_http_get_indexed_variable() in
cacheable case (as it will return cached value anyway).

14 years agoMerge of r4470:
Maxim Dounin [Mon, 5 Mar 2012 12:33:06 +0000 (12:33 +0000)]
Merge of r4470:

Fix for proxy_store leaving temporary files for subrequests.

Temporary files might not be removed if the "proxy_store" or "fastcgi_store"
directives were used for subrequests (e.g. ssi includes) and client closed
connection prematurely.

Non-active subrequests are finalized out of the control of the upstream
module when client closes a connection.  As a result, the code to remove
unfinished temporary files in ngx_http_upstream_process_request() wasn't
executed.

Fix is to move relevant code into ngx_http_upstream_finalize_request() which
is called in all cases, either directly or via the cleanup handler.

14 years agoMerge of r4468:
Maxim Dounin [Mon, 5 Mar 2012 12:24:18 +0000 (12:24 +0000)]
Merge of r4468:

Removed r->cache/r->cached dependencies in range filter.  This is
a layering violation, use correct offset calculations instead.

14 years agoMerge of r4461: upstream: fixed "too big header" check.
Maxim Dounin [Mon, 5 Mar 2012 12:15:02 +0000 (12:15 +0000)]
Merge of r4461: upstream: fixed "too big header" check.

If header filter postponed processing of a header by returning NGX_AGAIN
and not moved u->buffer->pos, previous check incorrectly assumed there
is additional space and did another recv() with zero-size buffer.  This
resulted in "upstream prematurely closed connection" error instead
of correct "upstream sent too big header" one.

Patch by Feibo Li.

14 years agoMerge of r4460: ngx_ncpu detection for most *nix platforms.
Maxim Dounin [Mon, 5 Mar 2012 12:10:09 +0000 (12:10 +0000)]
Merge of r4460: ngx_ncpu detection for most *nix platforms.

This inaccurate detection by using sysconf(_SC_NPROCESSORS_ONLN) can improve
usage of the mutex lock optimization on multicore systems.

14 years agoMerge of r4423: fixed proxy_redirect off inheritance.
Maxim Dounin [Mon, 5 Mar 2012 11:47:25 +0000 (11:47 +0000)]
Merge of r4423: fixed proxy_redirect off inheritance.

14 years agoVersion bump.
Maxim Dounin [Mon, 5 Mar 2012 11:36:21 +0000 (11:36 +0000)]
Version bump.

14 years agorelease-1.0.12 tag
Maxim Dounin [Mon, 6 Feb 2012 14:09:16 +0000 (14:09 +0000)]
release-1.0.12 tag

14 years agonginx-1.0.12-RELEASE release-1.0.12
Maxim Dounin [Mon, 6 Feb 2012 14:08:59 +0000 (14:08 +0000)]
nginx-1.0.12-RELEASE

14 years agoUpdated libs used for win32 builds.
Maxim Dounin [Mon, 6 Feb 2012 11:40:10 +0000 (11:40 +0000)]
Updated libs used for win32 builds.

14 years agoMerge of r4422:
Maxim Dounin [Sun, 5 Feb 2012 20:06:50 +0000 (20:06 +0000)]
Merge of r4422:

Fixed error handling in ngx_event_connect_peer().

Previously if ngx_add_event() failed a connection was freed two times (once
in the ngx_event_connect_peer(), and again by a caller) as pc->connection was
left set.  Fix is to always use ngx_close_connection() to close connection
properly and set pc->connection to NULL on errors.

Patch by Piotr Sikora.

14 years agoMerge of r4416:
Maxim Dounin [Sun, 5 Feb 2012 20:05:11 +0000 (20:05 +0000)]
Merge of r4416:

Fixed AIO error handling on FreeBSD.

The aio_return() must be called regardless of the error returned by
aio_error().  Not calling it resulted in various problems up to segmentation
faults (as AIO events are level-triggered and were reported again and again).

Additionally, in "aio sendfile" case r->blocked was incremented in case of
error returned from ngx_file_aio_read(), thus causing request hangs.

14 years agoMerge of r4406, r4413: copyrights updated.
Maxim Dounin [Sun, 5 Feb 2012 20:02:59 +0000 (20:02 +0000)]
Merge of r4406, r4413: copyrights updated.

14 years agoMerge of r4405:
Maxim Dounin [Sun, 5 Feb 2012 19:27:18 +0000 (19:27 +0000)]
Merge of r4405:

Fixed division by zero exception in ngx_hash_init().

The ngx_hash_init() function did not expect call with zero elements count,
which caused FPE error on configs with an empty "types" block in http context
and "types_hash_max_size" > 10000.

14 years agoMerge of r4404:
Maxim Dounin [Sun, 5 Feb 2012 19:25:24 +0000 (19:25 +0000)]
Merge of r4404:

Fixed sched_setaffinity(2) to correctly pass size.

Second argument (cpusetsize) is size in bytes, not in bits.  Previously
used constant 32 resulted in reading of uninitialized memory and caused
EINVAL to be returned on some Linux kernels.

14 years agoMerge of r4402:
Maxim Dounin [Sun, 5 Feb 2012 19:23:44 +0000 (19:23 +0000)]
Merge of r4402:

Fixed proxy_cache_use_stale in "no live upstreams" case.

14 years agoMerge of r4401, r4415:
Maxim Dounin [Sun, 5 Feb 2012 19:15:09 +0000 (19:15 +0000)]
Merge of r4401, r4415:

SSL changes:

*) Added support for TLSv1.1, TLSv1.2 in ssl_protocols directive.

   Support for TLSv1.1 and TLSv1.2 protocols was introduced in
   OpenSSL 1.0.1 (-beta1 was recently released).  This change makes it
   possible to disable these protocols and/or enable them without other
   protocols.

*) Removed ENGINE_load_builtin_engines() call.

   It's already called by OPENSSL_config().  Calling it again causes
   some openssl engines (notably GOST) to corrupt memory, as they don't
   expect to be created more than once.

14 years agoMerge of r4398:
Maxim Dounin [Sun, 5 Feb 2012 19:06:52 +0000 (19:06 +0000)]
Merge of r4398:

Changed ngx_log_debugN() macros to verify the number of arguments
when built with debugging.

14 years agoMerge of r4396:
Maxim Dounin [Sun, 5 Feb 2012 19:05:06 +0000 (19:05 +0000)]
Merge of r4396:

Some questionable optomizations flags for icc were removed
in order to simplify support of its future versions.

14 years agoMerge of r4393: zlib license file include fixed.
Maxim Dounin [Sun, 5 Feb 2012 19:03:21 +0000 (19:03 +0000)]
Merge of r4393: zlib license file include fixed.

14 years agoMerge of r4384, r4385:
Maxim Dounin [Sun, 5 Feb 2012 16:12:55 +0000 (16:12 +0000)]
Merge of r4384, r4385:

Fixes for limit_rate:

*) Fixed throughput problems with large limit_rate.

   Previous attempt to fix this was in r1658 (0.6.18), though that one
   wasn't enough (it was a noop).

*) Fixed interaction of limit_rate and sendfile_max_chunk.

   It's possible that configured limit_rate will permit more bytes per
   single operation than sendfile_max_chunk.  To protect disk from
   takeover by a single client it is necessary to apply sendfile_max_chunk
   as a limit regardless of configured limit_rate.

   See here for report (in Russian):
   http://mailman.nginx.org/pipermail/nginx-ru/2010-March/032806.html

14 years agoMerge of r4383, r4403:
Maxim Dounin [Sun, 5 Feb 2012 15:51:20 +0000 (15:51 +0000)]
Merge of r4383, r4403:

MP4 fixes:

*) Fixed mp4 if first entry in stsc was skipped (ticket #72).

   If first entry in stsc atom was skipped, and seek was to chunk
   boundary, than first_chunk in the generated stsc table wasn't
   set to 1.

*) Fixed handling of mp4 above 2G and 32bit offsets (ticket #84).

14 years agoMerge of r4381, r4400:
Maxim Dounin [Sun, 5 Feb 2012 15:47:58 +0000 (15:47 +0000)]
Merge of r4381, r4400:

Fixed limit_conn_log_level/limit_req_log_level inheritance.  The
directives did not work if there were no limit_conn/limit_req
specified on the same level.

The code for limit_conn is different in 1.0.x, conflict resolved
manually.

14 years agoMerge of r4379: duplicate words removed.
Maxim Dounin [Sun, 5 Feb 2012 15:34:20 +0000 (15:34 +0000)]
Merge of r4379: duplicate words removed.

14 years agoMerge of r4375, r4382:
Maxim Dounin [Sun, 5 Feb 2012 14:09:46 +0000 (14:09 +0000)]
Merge of r4375, r4382:

SSI changes:

*) The "if" command did not work inside the "block" command and
   produced parsing errors.

*) Added regex captures support in the expression of the "if" command.

14 years agoMerge of r4372, r4373, r4374:
Maxim Dounin [Sun, 5 Feb 2012 13:53:50 +0000 (13:53 +0000)]
Merge of r4372, r4373, r4374:

SCGI fixes:

*) Fixed incorrect use of r->http_version in scgi module.

   The r->http_version is a version of client's request, and modules
   must not set it unless they are really willing to downgrade protocol
   version used for a response (i.e. to HTTP/0.9 if no response headers
   are available).  In neither case r->http_version may be upgraded.

   The former code downgraded response from HTTP/1.1 to HTTP/1.0 for no
   reason, causing various problems (see ticket #66).  It was also
   possible that HTTP/0.9 requests were upgraded to HTTP/1.0.

*) Removed duplicate function declaration.

*) Removed error if there is no Status header.

   The SCGI specification doesn't specify format of the response, and
   assuming CGI specs should be used there is no reason to complain.
   RFC 3875 explicitly states that "A Status header field is optional,
   and status 200 'OK' is assumed if it is omitted".

14 years agoMerge of r4339, r4340, r4341:
Maxim Dounin [Sun, 5 Feb 2012 13:34:08 +0000 (13:34 +0000)]
Merge of r4339, r4340, r4341:

Cache fixes:

*) Obsolete code removed.

   The ngx_http_cache() and ngx_http_no_cache_set_slot() functions
   were replaced in 0.8.46 and no longer used since then.

*) Handling of cache files with long headers.

   There are two possible situations which can lead to this: response
   was cached with bigger proxy_buffer_size value (and nginx was
   restared since then, i.e. shared memory zone content was lost), or
   due to the race in the cache update code (see [1]) we've end up
   with fcn->body_start from a different response stored in shared
   memory zone.

*) Only complain on long locked entries.

   There have been multiple reports of cases where a real locked entry
   was removed, resulting in a segmentation fault later in a worker
   which locked the entry.  It looks like default inactive timeout isn't
   enough in real life.

   For now just ignore such locked entries, and move them to the top of
   the inactive queue to allow processing of other entries.

[1] http://mailman.nginx.org/pipermail/nginx-devel/2011-September/001287.html

14 years agoMerge of r4338:
Maxim Dounin [Sun, 5 Feb 2012 12:46:20 +0000 (12:46 +0000)]
Merge of r4338:

Renamed some constants to improve readability, no functional changes.

14 years agoMerge r4336:
Maxim Dounin [Sun, 5 Feb 2012 12:42:36 +0000 (12:42 +0000)]
Merge r4336:

Microoptimization of sendfile(2) usage under FreeBSD.

FreeBSD kernel checks headers/trailers pointer against NULL, not
corresponding count.  Passing NULL if there are no headers/trailers
helps to avoid unneeded work in kernel, as well as unexpected 0 bytes
GIO in traces.

14 years agoMerge of r4335:
Maxim Dounin [Sun, 5 Feb 2012 12:37:48 +0000 (12:37 +0000)]
Merge of r4335:

Fixed: some of $sent_http_* variables might contain header entries
which actually wasn't sent to a client.

The ngx_http_variable_headers() and ngx_http_variable_unknown_header()
functions did not ignore response header entries with zero "hash"
field.

Thanks to Yichun Zhang (agentzh).

14 years agoMerge of r4377: configure on Solaris fixed.
Maxim Dounin [Sun, 5 Feb 2012 12:28:35 +0000 (12:28 +0000)]
Merge of r4377: configure on Solaris fixed.

14 years agoMerge of r4327:
Maxim Dounin [Sat, 4 Feb 2012 23:28:10 +0000 (23:28 +0000)]
Merge of r4327:

Removed unused function ngx_regex_capture_count().  The function has
been unused since r3326 (0.8.25).

14 years agoMerge of r4306, r4320:
Maxim Dounin [Sat, 4 Feb 2012 23:18:12 +0000 (23:18 +0000)]
Merge of r4306, r4320:

Protection from stale write events in epoll.

Stale write event may happen if epoll_wait() reported both read and write
events, and processing of the read event closed descriptor.

14 years agoMerge of r4326:
Maxim Dounin [Sat, 4 Feb 2012 22:30:30 +0000 (22:30 +0000)]
Merge of r4326:

Fix for read_head with try_files and open_file_cache.

The of.read_ahead wasn't set in try_files code path, causing read_ahead
directive to be a nop if try_files and open_file_cache were used.

14 years agoVersion bump.
Maxim Dounin [Sat, 4 Feb 2012 22:23:12 +0000 (22:23 +0000)]
Version bump.

14 years agorelease-1.0.11 tag
Maxim Dounin [Thu, 15 Dec 2011 14:05:08 +0000 (14:05 +0000)]
release-1.0.11 tag

14 years agonginx-1.0.11-RELEASE release-1.0.11
Maxim Dounin [Thu, 15 Dec 2011 14:04:39 +0000 (14:04 +0000)]
nginx-1.0.11-RELEASE

14 years agoMerge of r4315:
Maxim Dounin [Wed, 14 Dec 2011 18:06:21 +0000 (18:06 +0000)]
Merge of r4315:

Allowed add_header for proxied 206 replies.

It was working for nginx's own 206 replies as they are seen as 200 in the
headers filter module (range filter goes later in the headers filter chain),
but not for proxied replies.

14 years agoMerge of r4313:
Maxim Dounin [Wed, 14 Dec 2011 18:04:06 +0000 (18:04 +0000)]
Merge of r4313:

Added escaping of double quotes in ngx_escape_html().

Patch by Zaur Abasmirzoev.

14 years agoMerge of r4307:
Maxim Dounin [Wed, 14 Dec 2011 18:02:37 +0000 (18:02 +0000)]
Merge of r4307:

Fix of mp4 module seeking.

14 years agoMerge of r4305:
Maxim Dounin [Wed, 14 Dec 2011 18:00:50 +0000 (18:00 +0000)]
Merge of r4305:

Fixed segfault on ssl servers without cert with SNI (ticket #54).

Non-default servers may not have ssl context created if there are no
certificate defined.  Make sure to check if ssl context present before
using it.

14 years agoMerge of r4298:
Maxim Dounin [Wed, 14 Dec 2011 15:30:02 +0000 (15:30 +0000)]
Merge of r4298:

Fixed flv header to match specification.

Used "\x5" in 5th byte to claim presence of both audio and video.  Used
previous tag size 0 in the beginning of the flv body (bytes 10 .. 13) as
required by specification (see http://www.adobe.com/devnet/f4v.html).

Patch by Piotr Sikora.

14 years agoMerge of r4295:
Maxim Dounin [Wed, 14 Dec 2011 15:28:13 +0000 (15:28 +0000)]
Merge of r4295:

Fixed incorrect counting the length of headers in a SCGI request.

14 years agoMerge of r4294:
Maxim Dounin [Wed, 14 Dec 2011 15:25:32 +0000 (15:25 +0000)]
Merge of r4294:

Fixed handling of SIGWINCH/NOACCEPT signal.

After first upgrade it was ignored since r4020 (1.1.1, 1.0.9) as
ngx_daemonized wasn't set.

14 years agoMerge of r4284:
Maxim Dounin [Wed, 14 Dec 2011 15:23:23 +0000 (15:23 +0000)]
Merge of r4284:

Introduction of simple ngx_write_stderr() instead of ngx_log_stderr()
for output of ./configure options, etc., since ngx_log_stderr() output
length is limited by 2048 characters defined as NGX_MAX_ERROR_STR.

14 years agoMerge of r4282, r4302:
Maxim Dounin [Wed, 14 Dec 2011 15:16:05 +0000 (15:16 +0000)]
Merge of r4282, r4302:

Added image/webp and video/webm MIME types.  Added svgz extension for
compressed SVG.

14 years agoMerge of r4275, r4276, r4278, r4279:
Maxim Dounin [Wed, 14 Dec 2011 15:13:25 +0000 (15:13 +0000)]
Merge of r4275, r4276, r4278, r4279:

Fixes for proxy_set_header, fastcgi/scgi/uwsgi_param inheritance:

*) Fixed proxy_set_header inheritance with proxy_cache (ticket #45).

   Headers cleared with cache enabled (If-Modified-Since etc.) might be
   cleared in unrelated servers/locations without proxy_cache enabled
   if proxy_cache was used in some server/location.

   Example config which triggered the problem:

       proxy_set_header X-Test "test";
       server { location /1 { proxy_cache name; proxy_pass ... } }
       server { location /2 { proxy_pass ... } }

   Another one:

       server {
           proxy_cache name;
           location /1 { proxy_pass ... }
           location /2 { proxy_cache off; proxy_pass ... }
       }

   In both cases If-Modified-Since header wasn't sent to backend in
   location /2.

   Fix is to not modify conf->headers_source, but instead merge user-supplied
   headers from conf->headers_source and default headers (either cache or not)
   into separate headers_merged array.

*) Fixed proxy_set_header inheritance with proxy_set_body.

*) Separate functions to merge fastcgi/scgi/uwsgi params.
   No functional changes.

*) Fixed fastcgi/scgi/uwsgi_param inheritance.  The following problems were
   fixed:

   1. Directive fastcgi_cache affected headers sent to backends in unrelated
      servers / locations (see ticket #45).

   2. If-Unmodified-Since, If-Match and If-Range headers were sent to
      backends if fastcgi_cache was used.

   3. Cache-related headers were sent to backends if there were no
      fastcgi_param directives and fastcgi_cache was used at server level.

14 years agoMerge of r4270, r4274:
Maxim Dounin [Wed, 14 Dec 2011 14:31:55 +0000 (14:31 +0000)]
Merge of r4270, r4274:

Minor cleanup:

*) Changed error message to be more appropriate in the imaginary
   "open_file_cache max=0" case.

*) Fixed NGX_CONF_TAKE1/NGX_CONF_FLAG misuse.

14 years agoMerge of r4267, r4301:
Maxim Dounin [Wed, 14 Dec 2011 13:40:25 +0000 (13:40 +0000)]
Merge of r4267, r4301:

Fix of the "keepalive_disable" directive.

14 years agoMerge of r4266, r4308, r4309:
Maxim Dounin [Wed, 14 Dec 2011 13:37:53 +0000 (13:37 +0000)]
Merge of r4266, r4308, r4309:

Image filter changes:

*) The "image_filter_sharpen" directive.

*) Cosmetics.

*) Fixed "rotate" to always work when combined with "resize/crop".

14 years agoMerge of r4231, r4300, r4303, r4304:
Maxim Dounin [Wed, 14 Dec 2011 13:34:16 +0000 (13:34 +0000)]
Merge of r4231, r4300, r4303, r4304:

Configure/build changes and fixes:

*) Revamped "configure --help" text.

*) FreeBSD 10-current has recently gotten POSIX_FADV_* macros.
   A fix for the broken build applied.

*) AIX 7 defines sys_nerr in errno.h, therefore <errno.h> included
   in the sys_nerr test.

   When sys_nerr and _sys_nerr are missed on a particular platform
   and our euristic for a maximum errno detection applied always
   print the maximum errno number we reached instead of printing void.

   This makes possible to build nginx on AIX 7.1.

*) Made it possible to build/install from the SVN checkout.

14 years agoMerge of r4227, r4228:
Maxim Dounin [Wed, 14 Dec 2011 13:06:45 +0000 (13:06 +0000)]
Merge of r4227, r4228:

Fixed range checking for the "somaxconn" sysctl.  Fixed port range checking.

14 years agoMerge of r4223:
Maxim Dounin [Tue, 13 Dec 2011 19:01:10 +0000 (19:01 +0000)]
Merge of r4223:

FreeBSD's MALLOC_OPTIONS must be set before any malloc() call.
The bug has been introduced in r3799.

14 years agoMerge of r4221, r4222:
Maxim Dounin [Tue, 13 Dec 2011 18:59:18 +0000 (18:59 +0000)]
Merge of r4221, r4222:

Fixed unix ngx_write_chain_to_file() to return total bytes written.

Previously result of last iteration's writev() was returned.  This was
unnoticed as return value was only used if chain contained only one or
two buffers.

14 years agoMerge of r4217, r4218:
Maxim Dounin [Tue, 13 Dec 2011 18:46:07 +0000 (18:46 +0000)]
Merge of r4217, r4218:

Fixed "expires @00h".  Fixed "expires @time" with unknown last modified
time (ticket #32).

14 years agoMerge of r4153:
Maxim Dounin [Tue, 13 Dec 2011 18:34:34 +0000 (18:34 +0000)]
Merge of r4153:

Better handling of late upstream creation.

Configuration with duplicate upstream blocks defined after first use, i.e.
like

    server {
        ...
        location / {
            proxy_pass http://backend;
        }
    }

    upstream backend { ... }
    upstream backend { ... }

now correctly results in "duplicate upstream" error.

Additionally, upstream blocks defined after first use now handle various
server directive parameters ("weight", "max_fails", etc.).  Previously
configuration like

    server {
        ...
        location / {
            proxy_pass http://backend;
        }
    }

    upstream backend {
        server 127.0.0.1 max_fails=5;
    }

incorrectly resulted in "invalid parameter "max_fails=5"" error.

14 years agoMerge of r4144:
Maxim Dounin [Tue, 13 Dec 2011 18:30:15 +0000 (18:30 +0000)]
Merge of r4144:

Upstream: clearing of u->peer.connection on close.

This fixes crashes observed with some 3rd party balancer modules.  Standard
balancer modules (round-robin and ip hash) explicitly set pc->connection
(aka u->peer.connection) to NULL and aren't affected.

14 years agoMerge of r4001, r4002, r4008:
Maxim Dounin [Tue, 13 Dec 2011 18:07:52 +0000 (18:07 +0000)]
Merge of r4001, r4002, r4008:

Manpage changes:

*) Support link.

*) Commented out reference to non-existing nginx.conf(5).

*) Rebuild manpage only if needed.

14 years agoMerge of r4000, r4014, r4265, r4321, r4342, r4343:
Maxim Dounin [Tue, 13 Dec 2011 17:58:18 +0000 (17:58 +0000)]
Merge of r4000, r4014, r4265, r4321, r4342, r4343:

Infrastructure changes:

*) Don't ignore xmllint errors.

*) Added missing dependencies for the CHANGES{,ru} targets.
   Pass string params to xsltproc.

*) Ancient incomplete ngx_http_status_module removal.

*) Compute the repository root from the checkout.

*) Fixed RELEASE target to correctly call "release" one.

14 years agoVersion bump.
Maxim Dounin [Tue, 13 Dec 2011 16:59:41 +0000 (16:59 +0000)]
Version bump.

14 years agorelease-1.0.10 tag
Igor Sysoev [Tue, 15 Nov 2011 08:24:10 +0000 (08:24 +0000)]
release-1.0.10 tag

14 years agonginx-1.0.10-RELEASE release-1.0.10
Igor Sysoev [Tue, 15 Nov 2011 08:24:03 +0000 (08:24 +0000)]
nginx-1.0.10-RELEASE

14 years agoMerge of r4283:
Igor Sysoev [Mon, 14 Nov 2011 16:14:11 +0000 (16:14 +0000)]
Merge of r4283:

Fix of "Content-Length" header of MP4 response if start argument was used.

Patch by Piotr Sikora.

14 years agoMerge of r4280:
Igor Sysoev [Mon, 14 Nov 2011 16:13:15 +0000 (16:13 +0000)]
Merge of r4280:

Reverted incorrect change in internal md5 (part of r3928).

14 years agoMerge of r4268:
Igor Sysoev [Mon, 14 Nov 2011 16:12:25 +0000 (16:12 +0000)]
Merge of r4268:

Fixed compression pointer processing in DNS response greater than 255 bytes.

Thanks to Ben Hawkes.

14 years agoVersion bump.
Igor Sysoev [Mon, 14 Nov 2011 15:53:35 +0000 (15:53 +0000)]
Version bump.

14 years agorelease-1.0.9 tag
Igor Sysoev [Tue, 1 Nov 2011 14:51:26 +0000 (14:51 +0000)]
release-1.0.9 tag

14 years agonginx-1.0.9-RELEASE release-1.0.9
Igor Sysoev [Tue, 1 Nov 2011 14:51:19 +0000 (14:51 +0000)]
nginx-1.0.9-RELEASE

14 years agoSurplus CHANGES line removal.
Igor Sysoev [Tue, 1 Nov 2011 14:39:36 +0000 (14:39 +0000)]
Surplus CHANGES line removal.

14 years agoMerging r4236:
Igor Sysoev [Tue, 1 Nov 2011 14:21:22 +0000 (14:21 +0000)]
Merging r4236:

Fixed documentation pointer.

14 years agoMerging r4210:
Igor Sysoev [Tue, 1 Nov 2011 14:20:43 +0000 (14:20 +0000)]
Merging r4210:

Fixed utf8 decode (ticket #25).

Patch by Alexey Kuts.

14 years agoMerging r4209:
Igor Sysoev [Tue, 1 Nov 2011 14:19:13 +0000 (14:19 +0000)]
Merging r4209:

Skipping location rewrite phase for server null location.

14 years agoMerging r4198:
Igor Sysoev [Tue, 1 Nov 2011 14:18:10 +0000 (14:18 +0000)]
Merging r4198:

Additional headers for proxy/fastcgi/uwsgi/scgi_ignore_headers.

Now the following headers may be ignored as well: X-Accel-Limit-Rate,
X-Accel-Buffering, X-Accel-Charset.

14 years agoMerging r4189, r4197:
Igor Sysoev [Tue, 1 Nov 2011 14:15:42 +0000 (14:15 +0000)]
Merging r4189, r4197:

Perl related fixes:

*) Handling of Content-Encoding set from perl.

   This fixes double gzipping in case of gzip filter being enabled while perl
   returns already gzipped response.

*) Fixed macro name.

14 years agoMerging r4195, r4196:
Igor Sysoev [Tue, 1 Nov 2011 14:13:25 +0000 (14:13 +0000)]
Merging r4195, r4196:

AIO related fixes:

*) Fix for connection drops with AIO.

   Connections serving content with AIO to fast clients were dropped with
   "client timed out" messages after send_timeout from response start.

*) Fix for socket leak with "aio sendfile" and "limit_rate".

   Second aio post happened when timer set by limit_rate expired while we have
   aio request in flight, resulting in "second aio post" alert and socket leak.

   The patch adds actual protection from aio calls with r->aio already set to
   aio sendfile code in ngx_http_copy_filter().  This should fix other cases
   as well, e.g. when sending buffered to disk upstream replies while still
   talking to upstream.

   The ngx_http_writer() is also fixed to handle the above case (though it's
   mostly optimization now).

14 years agoMerging r4193, r4194:
Igor Sysoev [Tue, 1 Nov 2011 14:09:15 +0000 (14:09 +0000)]
Merging r4193, r4194:

Autoindex fixes:

*) Autoindex: escape '?' in file names.

   For files with '?' in their names autoindex generated links with '?' not
   escaped.  This resulted in effectively truncated links as '?' indicates
   query string start.

   This is an updated version of the patch originally posted at [1].  It
   introduces generic NGX_ESCAPE_URI_COMPONENT which escapes everything but
   unreserved characters as per RFC 3986.  This approach also renders unneeded
   special colon processing (as colon is percent-encoded now), it's dropped
   accordingly.

   [1] http://nginx.org/pipermail/nginx-devel/2010-February/000112.html

*) Autoindex: escape html in file names.

14 years agoMerging r4158:
Igor Sysoev [Tue, 1 Nov 2011 14:04:23 +0000 (14:04 +0000)]
Merging r4158:

Added uwsgi_buffering and scgi_buffering directives.

Patch by Peter Smit.

14 years agoMerging r4190, r4232:
Igor Sysoev [Tue, 1 Nov 2011 14:02:07 +0000 (14:02 +0000)]
Merging r4190, r4232:

MP4 related fixes:

*) Fixing mp4 module seeking on 32-bit platforms.

*) Adding m4a and m4v MIME types (ticket #42).

14 years agoMerging r4179, r4182, r4212:
Igor Sysoev [Tue, 1 Nov 2011 14:00:04 +0000 (14:00 +0000)]
Merging r4179, r4182, r4212:

Adding RELEASE procedure in GNUmakefile.

14 years agoMerging r4155, r4219, r4220, r4230:
Igor Sysoev [Tue, 1 Nov 2011 13:56:26 +0000 (13:56 +0000)]
Merging r4155, r4219, r4220, r4230:

Windows related fixes:

*) Fixed segmentation fault with empty config on Windows.
   See here for report:
   http://mailman.nginx.org/pipermail/nginx-ru/2011-September/043288.html

*) Recent SDKs allow to build IPV6 only for Windows XP or above.

*) Fixing conflict with SDK off_t definition.

*) Fix of building by Microsoft Visual C++ 10 compiler.

14 years agoMerging r4151, r4152, r4177:
Igor Sysoev [Tue, 1 Nov 2011 13:49:31 +0000 (13:49 +0000)]
Merging r4151, r4152, r4177:

HTTP cache related fixes:

*) Cache: fix for sending of empty responses.

   Revert wrong fix for empty responses introduced in 0.8.31 and apply new
   one, rewritten to match things done by static module as close as possible.

*) Cache: fix for sending of stale responses.

   For normal cached responses ngx_http_cache_send() sends last buffer and then
   request finalized via ngx_http_finalize_request() call, i.e. everything is
   ok.

   But for stale responses (i.e. when upstream died, but we have something in
   cache) the same ngx_http_cache_send() sends last buffer, but then in
   ngx_http_upstream_finalize_request() another last buffer is send.  This
   causes duplicate final chunk to appear if chunked encoding is used (and
   resulting problems with keepalive connections and so on).

   Fix this by not sending in ngx_http_upstream_finalize_request()
   another last buffer if we know response was from cache.

*) Fixed cache bypass caching of non-cacheable replies (ticket #21).

   If cache was bypassed with proxy_cache_bypass, cache-controlling headers
   (Cache-Control, Expires) wasn't considered and response was cached even
   if it was actually non-cacheable.

   Patch by John Ferlito.

14 years agoMerging r4147, r4148, r4149, r4150, r4207:
Igor Sysoev [Tue, 1 Nov 2011 13:45:33 +0000 (13:45 +0000)]
Merging r4147, r4148, r4149, r4150, r4207:

Fixes of combination of error_page and return directives:

*) Fix for incorrect 201 replies from dav module.

   Replies with 201 code contain body, and we should clearly indicate it's
   empty if it's empty.  Before 0.8.32 chunked was explicitly disabled for
   201 replies and as a result empty body was indicated by connection close
   (not perfect, but worked).  Since 0.8.32 chunked is enabled, and this
   causes incorrect responses from dav module when HTTP/1.1 is used: with
   "Transfer-Encoding: chunked" but no chunks at all.

   Fix is to actually return empty body in special response handler instead
   of abusing r->header_only flag.

   See here for initial report:
   http://mailman.nginx.org/pipermail/nginx-ru/2010-October/037535.html

*) Fix for double content when return is used in error_page handler.

   Test case:

      location / {
          error_page 405 /nope;
          return 405;
      }

      location /nope {
          return 200;
      }

   This is expected to return 405 with empty body, but in 0.8.42+ will return
   builtin 405 error page as well (though not counted in Content-Length, thus
   breaking protocol).

   Fix is to use status provided by rewrite script execution in case
   it's less than NGX_HTTP_BAD_REQUEST even if r->error_status set.  This
   check is in line with one in ngx_http_script_return_code().

   Note that this patch also changes behaviour for "return 302 ..." and
   "rewrite ... redirect" used as error handler.  E.g.

       location / {
           error_page 405 /redirect;
           return 405;
       }

       location /redirect {
           rewrite ^ http://example.com/;
       }

   will actually return redirect to "http://example.com/" instead of builtin
   405 error page with meaningless Location header.  This looks like correct
   change and it's in line with what happens on e.g. directory redirects
   in error handlers.

*) Fix for "return 202" not discarding body.

   Big POST (not fully preread) to a

       location / {
           return 202;
       }

   resulted in incorrect behaviour due to "return" code path not calling
   ngx_http_discard_request_body().  The same applies to all "return" used
   with 2xx/3xx codes except 201 and 204, and to all "return ... text" uses.

   Fix is to add ngx_http_discard_request_body() call to
   ngx_http_send_response() function where it looks appropriate.
   Discard body call from emtpy gif module removed as it's now redundant.

   Reported by Pyry Hakulinen, see
   http://mailman.nginx.org/pipermail/nginx/2011-August/028503.html

*) Incorrect special case for "return 204" removed.

   The special case in question leads to replies without body in
   configuration like

       location / { error_page 404 /zero; return 404; }
       location /zero { return 204; }

   while replies with empty body are expected per protocol specs.

   Correct one will look like

       if (status == NGX_HTTP_NO_CONTENT) {

           rc = ngx_http_send_header(r);

           if (rc == NGX_ERROR || r->header_only) {
               return rc;
           }

           return ngx_http_send_special(r, NGX_HTTP_LAST);
       }

   though it looks like it's better to drop this special case at all.

*) Clear old Location header (if any) while adding a new one.

   This prevents incorrect behaviour when another redirect is issued within
   error_page 302 handler.

14 years agoMerging r4132, r4134, r4143, r4183, r4191, r4199:
Igor Sysoev [Tue, 1 Nov 2011 13:24:50 +0000 (13:24 +0000)]
Merging r4132, r4134, r4143, r4183, r4191, r4199:

Various fixes related to error messages:

*) Removed old warning that suggested to use "server_name_in_redirect off"
   (now the default) in place of no longer supported "server_name *".

*) Fixing directive name in error message if types hash size is not enough.

*) Replaced "can not" with "cannot" and "could not" in a bunch of places.
   Fixed nearby grammar errors.

*) Overhauled error messages.

14 years agoMerging r4034, r4186, r4187, r4229, r4235, r4237:
Igor Sysoev [Tue, 1 Nov 2011 13:00:30 +0000 (13:00 +0000)]
Merging r4034, r4186, r4187, r4229, r4235, r4237:

SSL related fixes:

*) Better handling of various per-server ssl options with SNI.

   SSL_set_SSL_CTX() doesn't touch values cached within ssl connection
   structure, it only changes certificates (at least as of now, OpenSSL
   1.0.0d and earlier).

   As a result settings like ssl_verify_client, ssl_verify_depth,
   ssl_prefer_server_ciphers are only configurable on per-socket basis while
   with SNI it should be possible to specify them different for two servers
   listening on the same socket.

   Workaround is to explicitly re-apply settings we care about from context
   to ssl connection in servername callback.

   Note that SSL_clear_options() is only available in OpenSSL 0.9.8m+.  I.e.
   with older versions it is not possible to clear ssl_prefer_server_ciphers
   option if it's set in default server for a socket.

*) Disabling SSL compression. This saves about 300K per SSL connection.
   The SSL_OP_NO_COMPRESSION option is available since OpenSSL 1.0.0.

*) Releasing memory of idle SSL connection. This saves about 34K per SSL
   connection. The SSL_MODE_RELEASE_BUFFERS option is available since
   OpenSSL 1.0.0d.

*) Decrease of log level of some SSL handshake errors.

*) Fixed segfault on configuration testing with ssl (ticket #37).

   The following config caused segmentation fault due to conf->file not
   being properly set if "ssl on" was inherited from the http level:

   http {
       ssl on;
       server {
       }
   }

*) Silently ignoring a stale global SSL error left after disabled renegotiation.