]> git.kaiwu.me - nginx.git/log
nginx.git
14 years agoWin32: fixed memory allocation for shmem name (ticket #134).
Maxim Dounin [Mon, 2 Apr 2012 21:30:58 +0000 (21:30 +0000)]
Win32: fixed memory allocation for shmem name (ticket #134).

14 years agoUpstream: reject upstreams without normal servers.
Maxim Dounin [Mon, 2 Apr 2012 21:29:35 +0000 (21:29 +0000)]
Upstream: reject upstreams without normal servers.

Such upstreams cause CPU hog later in the code as number of peers isn't
expected to be 0.  Currently this may happen either if there are only backup
servers defined in an upstream block, or if server with ipv6 address used
in an upstream block.

14 years agoVersion bump.
Maxim Dounin [Mon, 2 Apr 2012 21:28:31 +0000 (21:28 +0000)]
Version bump.

14 years agoCorrected spelling of error message (ticket #136).
Ruslan Ermilov [Thu, 29 Mar 2012 19:47:27 +0000 (19:47 +0000)]
Corrected spelling of error message (ticket #136).

14 years agorelease-1.1.18 tag
Maxim Dounin [Wed, 28 Mar 2012 13:29:55 +0000 (13:29 +0000)]
release-1.1.18 tag

14 years agonginx-1.1.18-RELEASE release-1.1.18
Maxim Dounin [Wed, 28 Mar 2012 13:29:29 +0000 (13:29 +0000)]
nginx-1.1.18-RELEASE

14 years agoFixed win32 build after realpath changes in r4559.
Maxim Dounin [Wed, 28 Mar 2012 13:04:39 +0000 (13:04 +0000)]
Fixed win32 build after realpath changes in r4559.

14 years agoConfigure: fixed msghdr.msg_control test on 64bit platforms.
Maxim Dounin [Wed, 28 Mar 2012 12:38:03 +0000 (12:38 +0000)]
Configure: fixed msghdr.msg_control test on 64bit platforms.

Broken by r4560.

14 years agoReplaced ngx_http_realip_from_t with ngx_in_cidr_t.
Ruslan Ermilov [Wed, 28 Mar 2012 09:29:09 +0000 (09:29 +0000)]
Replaced ngx_http_realip_from_t with ngx_in_cidr_t.

14 years agoFixed calculation of range boundaries.
Ruslan Ermilov [Wed, 28 Mar 2012 06:50:23 +0000 (06:50 +0000)]
Fixed calculation of range boundaries.

14 years agoXslt: parser options now set with xmlCtxtUseOptions().
Maxim Dounin [Wed, 28 Mar 2012 01:56:49 +0000 (01:56 +0000)]
Xslt: parser options now set with xmlCtxtUseOptions().

Note that "ctxt->loadsubset = 1" previously used isn't really correct as
ctxt->loadsubset is a bitfield now.  The use of xmlCtxtUseOptions() with
XML_PARSE_DTDLOAD is believed to be a better way to do the same thing.

Patch by Laurence Rowe.

14 years agoFixed more gcc46 warnings in configure tests.
Maxim Dounin [Tue, 27 Mar 2012 16:44:52 +0000 (16:44 +0000)]
Fixed more gcc46 warnings in configure tests.

Steps to reproduce:

./configure --with-cc="gcc46" --with-cc-opt="-Wall -Werror -O2"

14 years agoFixed unconditional MAX_PATH usage (ticket #22).
Maxim Dounin [Tue, 27 Mar 2012 16:42:34 +0000 (16:42 +0000)]
Fixed unconditional MAX_PATH usage (ticket #22).

POSIX doesn't require it to be defined, and Debian GNU/Hurd doesn't define
it.  Note that if there is no MAX_PATH defined we have to use realpath()
with NULL argument and free() the result.

14 years agoAdded explicit include of time.h.
Maxim Dounin [Tue, 27 Mar 2012 16:37:43 +0000 (16:37 +0000)]
Added explicit include of time.h.

Most of the systems have it included due to namespace pollution, but
relying on this is a bad idea.  Explicit include is required for at least
Debian GNU/Hurd.

14 years agoResolver: added missing sanity checking when creating name queries.
Maxim Dounin [Thu, 22 Mar 2012 11:57:18 +0000 (11:57 +0000)]
Resolver: added missing sanity checking when creating name queries.

Found by Veracode.

14 years agoWin32: added missing call to srand().
Maxim Dounin [Thu, 22 Mar 2012 10:45:08 +0000 (10:45 +0000)]
Win32: added missing call to srand().

Found by Veracode.

14 years agoAdded xslt_param and xslt_string_param directives.
Maxim Dounin [Thu, 22 Mar 2012 10:44:00 +0000 (10:44 +0000)]
Added xslt_param and xslt_string_param directives.

Based on patch by Samuel Behan.

14 years agoFixed off-by-one in xslt parameter parsing.
Maxim Dounin [Thu, 22 Mar 2012 10:43:33 +0000 (10:43 +0000)]
Fixed off-by-one in xslt parameter parsing.

The problem was introduced in 0.7.44 (r2589) during conversion to complex
values.  Previously string.len included space for terminating NUL, but
with complex values it doesn't.

14 years agoRestricted keepalive_disable safari to OS X only.
Maxim Dounin [Thu, 22 Mar 2012 10:42:27 +0000 (10:42 +0000)]
Restricted keepalive_disable safari to OS X only.

The problem doesn't affect non-Apple systems for sure, and many pretend
to be Safari now.

Prodded by Piotr Sikora.

14 years agoRemoved safari from keepalive_disable default.
Maxim Dounin [Thu, 22 Mar 2012 10:41:29 +0000 (10:41 +0000)]
Removed safari from keepalive_disable default.

The bug in question is likely already fixed (though unfortunately we have
no information available as Apple's bugtracker isn't open), and the
workaround seems to be too pessimistic for modern versions of Safari
as well as other webkit-based browsers pretending to be Safari.

14 years agoThe addition of $tcpinfo_* variables has broken the build on Linux
Ruslan Ermilov [Wed, 21 Mar 2012 15:35:05 +0000 (15:35 +0000)]
The addition of $tcpinfo_* variables has broken the build on Linux
systems with glibc versions prior to 2.7.  Fixed this by checking
the existence of "struct tcp_info" members during configuration.

14 years agoworker_cpu_affinity: cleaned up Linux implementation, added FreeBSD support.
Ruslan Ermilov [Wed, 21 Mar 2012 13:58:51 +0000 (13:58 +0000)]
worker_cpu_affinity: cleaned up Linux implementation, added FreeBSD support.

14 years agoIf we inserted "Last-Modified" in r->headers_out.headers, don't
Ruslan Ermilov [Wed, 21 Mar 2012 07:35:43 +0000 (07:35 +0000)]
If we inserted "Last-Modified" in r->headers_out.headers, don't
forget to set the r->headers_out.last_modified pointer to it.

14 years agoMinor ngx_http_headers_filter_module.c code cleanup.
Ruslan Ermilov [Wed, 21 Mar 2012 06:19:11 +0000 (06:19 +0000)]
Minor ngx_http_headers_filter_module.c code cleanup.

- Removed "hash" element from ngx_http_header_val_t which was always 1.
- Replaced NGX_HTTP_EXPIRES_* with ngx_http_expires_t enum type.
- Added prototype for ngx_http_add_header()
- Simplified ngx_http_set_last_modified().

14 years agoFor the sake of case/switch code readability, 'fall through'
Maxim Konovalov [Mon, 19 Mar 2012 14:57:29 +0000 (14:57 +0000)]
For the sake of case/switch code readability, 'fall through'
comments added.

14 years agoImplemented $tcpinfo_rtt, $tcpinfo_rttvar, $tcpinfo_snd_cwnd, and
Ruslan Ermilov [Fri, 16 Mar 2012 19:15:33 +0000 (19:15 +0000)]
Implemented $tcpinfo_rtt, $tcpinfo_rttvar, $tcpinfo_snd_cwnd, and
$tcpinfo_rcv_space variables.  Supported on Linux and FreeBSD.

14 years agoSome older OSes (notably FreeBSD 4.x) did not have %zu
Ruslan Ermilov [Fri, 16 Mar 2012 07:33:55 +0000 (07:33 +0000)]
Some older OSes (notably FreeBSD 4.x) did not have %zu
format specifier, so revert to using %d.

14 years agoFixed compilation warnings in configuration C tests.
Ruslan Ermilov [Thu, 15 Mar 2012 20:39:38 +0000 (20:39 +0000)]
Fixed compilation warnings in configuration C tests.

Based on a patch by Piotr Sikora.

14 years agoLocal variable "ngx_http_next_filter" renamed to "ngx_http_next_body_filter"
Ruslan Ermilov [Thu, 15 Mar 2012 20:08:58 +0000 (20:08 +0000)]
Local variable "ngx_http_next_filter" renamed to "ngx_http_next_body_filter"
for consistency with other modules.

14 years agoThe "error_log" directive specified in the "http", "server", and
Ruslan Ermilov [Thu, 15 Mar 2012 20:04:50 +0000 (20:04 +0000)]
The "error_log" directive specified in the "http", "server", and
"location" sections now understands the special "stderr" parameter.
It was already treated specially when specified in the main section.

14 years agoSlight optimization in ngx_http_get_variable_index().
Ruslan Ermilov [Thu, 15 Mar 2012 19:41:35 +0000 (19:41 +0000)]
Slight optimization in ngx_http_get_variable_index().

14 years ago- New variable: $connection_requests.
Ruslan Ermilov [Thu, 15 Mar 2012 19:37:32 +0000 (19:37 +0000)]
- New variable: $connection_requests.
- While here, fixed format specifier for $connection.

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

14 years agorelease-1.1.17 tag
Maxim Dounin [Thu, 15 Mar 2012 11:32:39 +0000 (11:32 +0000)]
release-1.1.17 tag

14 years agonginx-1.1.17-RELEASE release-1.1.17
Maxim Dounin [Thu, 15 Mar 2012 11:32:18 +0000 (11:32 +0000)]
nginx-1.1.17-RELEASE

14 years agoHeaders with null character are now rejected.
Maxim Dounin [Thu, 15 Mar 2012 11:27:57 +0000 (11:27 +0000)]
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 agoFixed incorrect ngx_cpystrn() usage in ngx_http_*_process_header().
Maxim Dounin [Thu, 15 Mar 2012 11:27:12 +0000 (11:27 +0000)]
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.

14 years agoFixed ssi and perl interaction.
Maxim Dounin [Thu, 15 Mar 2012 11:23:07 +0000 (11:23 +0000)]
Fixed ssi and perl interaction.

Embedded perl module assumes there is a space for terminating NUL character,
make sure to provide it in all situations by allocating one extra byte for
value buffer.  Default ssi_value_length is reduced accordingly to
preserve 256 byte allocations.

While here, fixed another one byte value buffer overrun possible in
ssi_quoted_symbol_state.

Reported by Matthew Daley.

14 years agoUwsgi: merged r->http_version fixes from scgi module.
Maxim Dounin [Thu, 15 Mar 2012 11:21:54 +0000 (11:21 +0000)]
Uwsgi: merged r->http_version fixes from scgi module.

Fixed incorrect use of r->http_version (r4372).  Removed duplicate function
declaration (r4373).  Removed error if there is no Status header (r4374).

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

14 years agoMentioned the NGINX environment variable.
Ruslan Ermilov [Mon, 12 Mar 2012 12:29:56 +0000 (12:29 +0000)]
Mentioned the NGINX environment variable.

14 years agoAdded scgi_temp and uwsgi_temp to svn:ignore.
Ruslan Ermilov [Sun, 11 Mar 2012 13:33:03 +0000 (13:33 +0000)]
Added scgi_temp and uwsgi_temp to svn:ignore.

14 years ago- Applied some of the OpenBSD changes.
Ruslan Ermilov [Tue, 6 Mar 2012 06:54:48 +0000 (06:54 +0000)]
- Applied some of the OpenBSD changes.
- Expanded contractions.
- Fixed some markup.
- Updated URL of official documentation.

14 years agoWhitespace fixes.
Maxim Dounin [Mon, 5 Mar 2012 18:09:06 +0000 (18:09 +0000)]
Whitespace fixes.

14 years agoGrammar and wording fixes in CHANGES.
Maxim Dounin [Mon, 5 Mar 2012 18:08:23 +0000 (18:08 +0000)]
Grammar and wording fixes in CHANGES.

14 years agoVersion bump.
Maxim Dounin [Mon, 5 Mar 2012 18:06:15 +0000 (18:06 +0000)]
Version bump.

14 years agorelease-1.1.16 tag
Maxim Dounin [Wed, 29 Feb 2012 13:45:39 +0000 (13:45 +0000)]
release-1.1.16 tag

14 years agonginx-1.1.16-RELEASE release-1.1.16
Maxim Dounin [Wed, 29 Feb 2012 13:45:18 +0000 (13:45 +0000)]
nginx-1.1.16-RELEASE

14 years agoRaised simultaneous subrequest limit from 50 to 200.
Maxim Dounin [Tue, 28 Feb 2012 14:54:23 +0000 (14:54 +0000)]
Raised simultaneous subrequest limit from 50 to 200.

It wasn't enforced for a long time, and there are reports that people
use up to 100 simultaneous subrequests now.  As this is a safety limit
to prevent loops, it's raised accordingly.

14 years agoAdded msleep() on reload to allow new processes to start.
Maxim Dounin [Tue, 28 Feb 2012 11:40:18 +0000 (11:40 +0000)]
Added msleep() on reload to allow new processes to start.

This is expected to ensure smoother operation on reload (and with less
chance of listen queue overflows).

Prodded by Igor Sysoev.

14 years agoFixed spelling in single-line comments.
Ruslan Ermilov [Tue, 28 Feb 2012 11:31:05 +0000 (11:31 +0000)]
Fixed spelling in single-line comments.

14 years agoWorkaround for fs_size on ZFS (ticket #46).
Maxim Dounin [Tue, 28 Feb 2012 11:09:02 +0000 (11:09 +0000)]
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 agoFix of rbtree lookup on hash collisions.
Maxim Dounin [Mon, 27 Feb 2012 22:15:39 +0000 (22:15 +0000)]
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 agoFixed null pointer dereference in resolver (ticket #91).
Maxim Dounin [Mon, 27 Feb 2012 16:57:02 +0000 (16:57 +0000)]
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 agoDisable symlinks: added the "from=" parameter to the "disable_symlinks"
Valentin Bartenev [Mon, 27 Feb 2012 16:54:10 +0000 (16:54 +0000)]
Disable symlinks: added the "from=" parameter to the "disable_symlinks"
directive.

14 years agoDisable symlinks: initialization of the "disable_symlinks" field in
Valentin Bartenev [Mon, 27 Feb 2012 16:51:28 +0000 (16:51 +0000)]
Disable symlinks: initialization of the "disable_symlinks" field in
ngx_open_file_info_t moved to a separate function.

This is preparation for the "from=" parameter implementation of the
"disable_symlinks" directive.

14 years agoDisable symlinks: added the "from" parameter support to the open file cache.
Valentin Bartenev [Mon, 27 Feb 2012 16:46:57 +0000 (16:46 +0000)]
Disable symlinks: added the "from" parameter support to the open file cache.

14 years agoConfigure: moved icc detection before gcc.
Maxim Dounin [Mon, 27 Feb 2012 16:23:44 +0000 (16:23 +0000)]
Configure: moved icc detection before gcc.

New versions of icc confuse auto/cc/name due to introduced handling
of a "icc -v":

$ icc -v
icc version 12.1.3 (gcc version 4.6.0 compatibility)
$ icc -V
Intel(R) C Compiler XE for applications running on IA-32, Version 12.1.3.293 Build 20120212
Copyright (C) 1985-2012 Intel Corporation.  All rights reserved.
FOR NON-COMMERCIAL USE ONLY

See report here:
http://mailman.nginx.org/pipermail/nginx/2012-February/032177.html

14 years agoAdded support for the 307 Temporary Redirect.
Ruslan Ermilov [Mon, 27 Feb 2012 11:43:40 +0000 (11:43 +0000)]
Added support for the 307 Temporary Redirect.

14 years agoRenamed constants and fixed off-by-one error in "msie_padding on" handling.
Ruslan Ermilov [Wed, 22 Feb 2012 16:23:29 +0000 (16:23 +0000)]
Renamed constants and fixed off-by-one error in "msie_padding on" handling.

14 years agoEvent pipe: fixed buffer loss in p->length case.
Maxim Dounin [Wed, 22 Feb 2012 11:28:53 +0000 (11:28 +0000)]
Event pipe: fixed buffer loss in p->length case.

With previous code raw buffer might be lost if p->input_filter() was called
on a buffer without any data and used ngx_event_pipe_add_free_buf() to
return it to the free list.  This eventually might cause "all buffers busy"
problem, resulting in segmentation fault due to null pointer dereference in
ngx_event_pipe_write_chain_to_temp_file().

In ngx_event_pipe_add_free_buf() the buffer was added to the list start
due to pos == last, and then "p->free_raw_bufs = cl->next" in
ngx_event_pipe_read_upstream() dropped both chain links to the buffer
from the p->free_raw_bufs list.

Fix is to move "p->free_raw_bufs = cl->next" before calling the
p->input_filter().

14 years agoDisable symlinks: use O_SEARCH|O_DIRECTORY to open path components.
Valentin Bartenev [Tue, 21 Feb 2012 15:10:13 +0000 (15:10 +0000)]
Disable symlinks: use O_SEARCH|O_DIRECTORY to open path components.

14 years agoDisable symlinks: don't allow creating or truncating a file via a symlink in
Valentin Bartenev [Tue, 21 Feb 2012 15:04:41 +0000 (15:04 +0000)]
Disable symlinks: don't allow creating or truncating a file via a symlink in
the last path component if "if_not_owner" parameter is used.

To prevent race condition we have to open a file before checking its owner and
there's no way to change access flags for already opened file descriptor, so
we disable symlinks for the last path component at all if flags allow creating
or truncating the file.

14 years agoDisable symlinks: cleanups once again.
Valentin Bartenev [Tue, 21 Feb 2012 15:01:25 +0000 (15:01 +0000)]
Disable symlinks: cleanups once again.

In collaboration with Ruslan Ermilov.

14 years agoDisable symlinks: added explicit cast of AT_FDCWD (ticket #111).
Maxim Dounin [Mon, 20 Feb 2012 19:14:35 +0000 (19:14 +0000)]
Disable symlinks: added explicit cast of AT_FDCWD (ticket #111).

Solaris has AT_FDCWD defined to unsigned value, and comparison of a file
descriptor with it causes warnings in modern versions of gcc.  Explicitly
cast AT_FDCWD to ngx_fd_t to resolve these warnings.

14 years agoDisable symlinks: error handling cleanup again.
Maxim Dounin [Mon, 20 Feb 2012 19:14:07 +0000 (19:14 +0000)]
Disable symlinks: error handling cleanup again.

14 years agoVersion bump.
Maxim Dounin [Mon, 20 Feb 2012 19:12:48 +0000 (19:12 +0000)]
Version bump.

14 years agorelease-1.1.15 tag
Maxim Dounin [Wed, 15 Feb 2012 13:26:27 +0000 (13:26 +0000)]
release-1.1.15 tag

14 years agonginx-1.1.15-RELEASE release-1.1.15
Maxim Dounin [Wed, 15 Feb 2012 13:26:06 +0000 (13:26 +0000)]
nginx-1.1.15-RELEASE

14 years agoDisable symlinks: fixed edge cases of path handling.
Maxim Dounin [Wed, 15 Feb 2012 12:18:55 +0000 (12:18 +0000)]
Disable symlinks: fixed edge cases of path handling.

This includes non-absolute pathnames, multiple slashes and trailing
slashes.  In collaboration with Valentin Bartenev.

14 years agoDisable symlinks: cleanup error handling.
Maxim Dounin [Wed, 15 Feb 2012 12:17:24 +0000 (12:17 +0000)]
Disable symlinks: cleanup error handling.

Notably this fixes NGX_INVALID_FILE/NGX_FILE_ERROR mess, and adds
logging of close() errors.  In collaboration with Valentin Bartenev.

14 years agoSupport for disable_symlinks in various modules.
Andrey Belov [Mon, 13 Feb 2012 16:32:21 +0000 (16:32 +0000)]
Support for disable_symlinks in various modules.

14 years agoAdded disable_symlinks directive.
Andrey Belov [Mon, 13 Feb 2012 16:29:04 +0000 (16:29 +0000)]
Added disable_symlinks directive.

To completely disable symlinks (disable_symlinks on)
we use openat(O_NOFOLLOW) for each path component
to avoid races.

To allow symlinks with the same owner (disable_symlinks if_not_owner),
use openat() (followed by fstat()) and fstatat(AT_SYMLINK_NOFOLLOW),
and then compare uids between fstat() and fstatat().

As there is a race between openat() and fstatat() we don't
know if openat() in fact opened symlink or not.  Therefore,
we have to compare uids even if fstatat() reports the opened
component isn't a symlink (as we don't know whether it was
symlink during openat() or not).

Default value is off, i.e. symlinks are allowed.

14 years agoChanged ngx_open_and_stat_file() to use ngx_str_t.
Andrey Belov [Mon, 13 Feb 2012 16:16:45 +0000 (16:16 +0000)]
Changed ngx_open_and_stat_file() to use ngx_str_t.

No functional changes.

14 years agoAdded openat()/fstatat().
Andrey Belov [Mon, 13 Feb 2012 16:13:21 +0000 (16:13 +0000)]
Added openat()/fstatat().

14 years agoTime parsing cleanup.
Maxim Dounin [Mon, 13 Feb 2012 15:41:11 +0000 (15:41 +0000)]
Time parsing cleanup.

Nuke NGX_PARSE_LARGE_TIME, it's not used since 0.6.30.  The only error
ngx_parse_time() can currently return is NGX_ERROR, check it explicitly
and make sure to cast it to appropriate type (either time_t or ngx_msec_t)
to avoid signedness warnings on platforms with unsigned time_t (notably QNX).

14 years agoFixed build with embedded perl and --with-openssl.
Maxim Dounin [Mon, 13 Feb 2012 15:38:48 +0000 (15:38 +0000)]
Fixed build with embedded perl and --with-openssl.

14 years agoCore: protection from cycles with named locations and post_action.
Maxim Dounin [Mon, 13 Feb 2012 15:35:48 +0000 (15:35 +0000)]
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 agoCore: protection from subrequest loops.
Maxim Dounin [Mon, 13 Feb 2012 15:33:08 +0000 (15:33 +0000)]
Core: protection from subrequest loops.

Without the protection, subrequest loop results in r->count overflow and
SIGSEGV.  Protection was broken in 0.7.25.

Note that this also limits number of parallel subrequests.  This
wasn't exactly the case before 0.7.25 as local subrequests were
completed directly.

See here for details:
http://nginx.org/pipermail/nginx-ru/2010-February/032184.html

14 years agoVariables: honor no_cacheable for not_found variables.
Maxim Dounin [Mon, 13 Feb 2012 15:31:07 +0000 (15:31 +0000)]
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 agoFix for proxy_store leaving temporary files for subrequests.
Maxim Dounin [Mon, 13 Feb 2012 15:28:19 +0000 (15:28 +0000)]
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 agoGzip filter: handling of empty flush buffers.
Maxim Dounin [Mon, 13 Feb 2012 15:23:43 +0000 (15:23 +0000)]
Gzip filter: handling of empty flush buffers.

Empty flush buffers are legitimate and may happen e.g. due to $r->flush()
calls in embedded perl.  If there are no data buffered in zlib, deflate()
will return Z_BUF_ERROR (i.e. no progress possible) without adding anything
to output.  Don't treat Z_BUF_ERROR as fatal and correctly send empty flush
buffer if we have no data in output at all.

See this thread for details:
http://mailman.nginx.org/pipermail/nginx/2010-November/023693.html

14 years agoRemoved r->cache/r->cached dependencies in range filter.
Maxim Dounin [Mon, 13 Feb 2012 15:20:49 +0000 (15:20 +0000)]
Removed r->cache/r->cached dependencies in range filter.

This is a layering violation, use correct offset calculations instead.

14 years agoProxy: added the "proxy_cookie_path" directive.
Valentin Bartenev [Mon, 13 Feb 2012 11:08:05 +0000 (11:08 +0000)]
Proxy: added the "proxy_cookie_path" directive.

14 years agoProxy: added the "proxy_cookie_domain" directive.
Valentin Bartenev [Mon, 13 Feb 2012 11:04:45 +0000 (11:04 +0000)]
Proxy: added the "proxy_cookie_domain" directive.

14 years agoUpstream: added callback hook for the "Set-Cookie" header.
Valentin Bartenev [Mon, 13 Feb 2012 11:01:58 +0000 (11:01 +0000)]
Upstream: added callback hook for the "Set-Cookie" header.

No functional changes.

14 years agoProxy: generic regex related code from the "proxy_redirect" directive moved
Valentin Bartenev [Mon, 13 Feb 2012 11:00:08 +0000 (11:00 +0000)]
Proxy: generic regex related code from the "proxy_redirect" directive moved
to a separate function.

No functional changes.

14 years agoProxy: generic rewrite code from the "proxy_redirect" handlers moved to a
Valentin Bartenev [Mon, 13 Feb 2012 10:56:09 +0000 (10:56 +0000)]
Proxy: generic rewrite code from the "proxy_redirect" handlers moved to a
separate function with trivial optimization.

No functional changes.

14 years agoProxy: renamed some "proxy_redirect" related declarations to a more general and
Valentin Bartenev [Mon, 13 Feb 2012 10:42:44 +0000 (10:42 +0000)]
Proxy: renamed some "proxy_redirect" related declarations to a more general and
reusable.

No functional changes.

14 years agoUpstream: fixed "too big header" check.
Maxim Dounin [Fri, 10 Feb 2012 14:31:04 +0000 (14:31 +0000)]
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 agoAdded ngx_ncpu detection for most *nix platforms.
Valentin Bartenev [Fri, 10 Feb 2012 11:24:19 +0000 (11:24 +0000)]
Added 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 agoLimit conn: returned to the old behavior of using the first actual limit on
Valentin Bartenev [Fri, 10 Feb 2012 10:48:58 +0000 (10:48 +0000)]
Limit conn: returned to the old behavior of using the first actual limit on
the way.

It was unintentionally changed in r4272, so that it could only limit the first
location where the processing of the request has reached PREACCESS phase.

14 years agoFixed module name in comment. It was forgotten in r4281.
Valentin Bartenev [Fri, 10 Feb 2012 09:56:37 +0000 (09:56 +0000)]
Fixed module name in comment. It was forgotten in r4281.

14 years agoVersion bump.
Maxim Dounin [Thu, 9 Feb 2012 16:18:02 +0000 (16:18 +0000)]
Version bump.

14 years agorelease-1.1.14 tag
Maxim Dounin [Mon, 30 Jan 2012 13:52:35 +0000 (13:52 +0000)]
release-1.1.14 tag

14 years agonginx-1.1.14-RELEASE release-1.1.14
Maxim Dounin [Mon, 30 Jan 2012 13:52:10 +0000 (13:52 +0000)]
nginx-1.1.14-RELEASE

14 years agoUpdate OpenSSL and PCRE used for win32 builds.
Maxim Dounin [Mon, 30 Jan 2012 13:47:03 +0000 (13:47 +0000)]
Update OpenSSL and PCRE used for win32 builds.

14 years agoLimit req: unbreak compilation with MSVC.
Maxim Dounin [Mon, 30 Jan 2012 13:19:25 +0000 (13:19 +0000)]
Limit req: unbreak compilation with MSVC.

14 years agoFixed memory leak on HUP signal when PCRE JIT was used.
Valentin Bartenev [Mon, 30 Jan 2012 12:53:57 +0000 (12:53 +0000)]
Fixed memory leak on HUP signal when PCRE JIT was used.

The PCRE JIT compiler uses mmap to allocate memory for its executable codes, so
we have to explicitly call the pcre_free_study() function to free this memory.

14 years agoFixed proxy_redirect off inheritance.
Valentin Bartenev [Mon, 30 Jan 2012 11:22:56 +0000 (11:22 +0000)]
Fixed proxy_redirect off inheritance.

Example configuration to reproduce:

  server {
      proxy_redirect off;

      location / {
          proxy_pass http://localhost:8000;
          proxy_redirect http://localhost:8000/ /;

          location ~ \.php$ {
              proxy_pass http://localhost:8000;
              # proxy_redirect must be inherited from the level above,
              # but instead it was switched off here
          }
      }
  }