]> git.kaiwu.me - nginx.git/log
nginx.git
13 years agoUpdated PCRE used for win32 builds.
Maxim Dounin [Thu, 10 Jan 2013 11:38:14 +0000 (11:38 +0000)]
Updated PCRE used for win32 builds.

13 years agoSSL: speedup loading of configs with many ssl servers.
Maxim Dounin [Wed, 9 Jan 2013 14:11:48 +0000 (14:11 +0000)]
SSL: speedup loading of configs with many ssl servers.

The patch saves one EC_KEY_generate_key() call per server{} block by
informing OpenSSL about SSL_OP_SINGLE_ECDH_USE we are going to use before
the SSL_CTX_set_tmp_ecdh() call.

For a configuration file with 10k simple server{} blocks with SSL enabled
this change reduces startup time from 18s to 5s on a slow test box here.

13 years agoEvents: added check for duplicate "events" directive.
Valentin Bartenev [Tue, 8 Jan 2013 14:03:37 +0000 (14:03 +0000)]
Events: added check for duplicate "events" directive.

13 years agoThe data pointer in ngx_open_file_t objects must be initialized.
Valentin Bartenev [Tue, 8 Jan 2013 14:01:57 +0000 (14:01 +0000)]
The data pointer in ngx_open_file_t objects must be initialized.

Uninitialized pointer may result in arbitrary segfaults if access_log is used
without buffer and without variables in file path.

Patch by Tatsuhiko Kubo (ticket #268).

13 years agoYear 2013.
Ruslan Ermilov [Mon, 31 Dec 2012 22:08:19 +0000 (22:08 +0000)]
Year 2013.

13 years agoGeo: improved code readability.
Ruslan Ermilov [Thu, 27 Dec 2012 21:35:47 +0000 (21:35 +0000)]
Geo: improved code readability.

13 years agoUpstream keepalive: detect duplicate "keepalive" directive.
Ruslan Ermilov [Wed, 26 Dec 2012 14:46:06 +0000 (14:46 +0000)]
Upstream keepalive: detect duplicate "keepalive" directive.

A failure to detect duplicate "keepalive" directive resulted in
stack exhaustion.

13 years agoVersion bump.
Ruslan Ermilov [Wed, 26 Dec 2012 09:29:37 +0000 (09:29 +0000)]
Version bump.

13 years agoGeo: made "default" affect both IPv4 and IPv6 when using prefixes.
Ruslan Ermilov [Wed, 26 Dec 2012 05:03:51 +0000 (05:03 +0000)]
Geo: made "default" affect both IPv4 and IPv6 when using prefixes.

Previously, "default" was equivalent to specifying 0.0.0.0/0, now
it's equivalent to specifying both 0.0.0.0/0 and ::/0 (if support
for IPv6 is enabled) with the same value.

13 years agorelease-1.3.10 tag
Maxim Dounin [Tue, 25 Dec 2012 14:24:12 +0000 (14:24 +0000)]
release-1.3.10 tag

13 years agonginx-1.3.10-RELEASE release-1.3.10
Maxim Dounin [Tue, 25 Dec 2012 14:23:45 +0000 (14:23 +0000)]
nginx-1.3.10-RELEASE

13 years agoGeo: properly initialize ngx_cidr_t when dealing with "default".
Ruslan Ermilov [Tue, 25 Dec 2012 10:00:39 +0000 (10:00 +0000)]
Geo: properly initialize ngx_cidr_t when dealing with "default".

13 years agoGeo: IPv6 support.
Ruslan Ermilov [Tue, 25 Dec 2012 08:21:56 +0000 (08:21 +0000)]
Geo: IPv6 support.

The "ranges" mode is still limited to IPv4 only.

13 years agoUpstream: fixed state resetting when switching to backup servers.
Valentin Bartenev [Tue, 25 Dec 2012 08:02:21 +0000 (08:02 +0000)]
Upstream: fixed state resetting when switching to backup servers.

Based on patch by Thomas Chen (ticket #257).

13 years agoFixed HEAD requests handling when proxying is used (closes #261).
Valentin Bartenev [Mon, 24 Dec 2012 17:32:53 +0000 (17:32 +0000)]
Fixed HEAD requests handling when proxying is used (closes #261).

13 years agoTrailing whitespace fix.
Ruslan Ermilov [Mon, 24 Dec 2012 16:40:55 +0000 (16:40 +0000)]
Trailing whitespace fix.

13 years agoAccess log: the "gzip" parameter of the "access_log" directive.
Valentin Bartenev [Sun, 23 Dec 2012 19:09:33 +0000 (19:09 +0000)]
Access log: the "gzip" parameter of the "access_log" directive.

Note: this requires zlib version 1.2.0.4 or above to work.

13 years agoConfigure: added the NGX_ZLIB define.
Valentin Bartenev [Sun, 23 Dec 2012 16:04:14 +0000 (16:04 +0000)]
Configure: added the NGX_ZLIB define.

This was introduced for conditional compilation of the code that requires
the zlib library.

13 years agoAccess log: the "flush" parameter of the "access_log" directive.
Valentin Bartenev [Sun, 23 Dec 2012 15:51:47 +0000 (15:51 +0000)]
Access log: the "flush" parameter of the "access_log" directive.

13 years agoReopening log files code moved to a separate function.
Valentin Bartenev [Sun, 23 Dec 2012 15:36:52 +0000 (15:36 +0000)]
Reopening log files code moved to a separate function.

The code refactored in a way to call custom handler that can do appropriate
cleanup work (if any), like flushing buffers, finishing compress streams,
finalizing connections to log daemon, etc..

13 years agoAccess log: fixed redundant buffer reallocation.
Valentin Bartenev [Sun, 23 Dec 2012 15:27:55 +0000 (15:27 +0000)]
Access log: fixed redundant buffer reallocation.

Previously a new buffer was allocated for every "access_log" directive with the
same file path and "buffer=" parameters, while only one buffer per file is used.

13 years agoProperly initialize "struct in6_addr" with zeroes.
Ruslan Ermilov [Sat, 22 Dec 2012 20:03:38 +0000 (20:03 +0000)]
Properly initialize "struct in6_addr" with zeroes.

13 years agoCore: crypt_r() error handling fixed.
Maxim Dounin [Fri, 21 Dec 2012 16:13:03 +0000 (16:13 +0000)]
Core: crypt_r() error handling fixed.

The crypt_r() function returns NULL on errors, check it explicitly instead
of assuming errno will remain 0 if there are no errors (per POSIX, the
setting of errno after a successful call to a function is unspecified
unless the description of that function specifies that errno shall not
be modified).

Additionally, dropped unneeded ngx_set_errno(0) and fixed error handling
of memory allocation after normal crypt(), which was inapropriate and
resulted in null pointer dereference on allocation failures.

13 years agoImage filter: fixed image_filter rotate inheritance.
Maxim Dounin [Fri, 21 Dec 2012 15:07:45 +0000 (15:07 +0000)]
Image filter: fixed image_filter rotate inheritance.

Configurations like

    location /i/ {
        image_filter resize 200 200;
        image_filter rotate 180;

        location /i/foo/ {
            image_filter resize 200 200;
        }
   }

resulted in rotation incorrectly applied in the location /i/foo, without
any way to clear it.  Fix is to handle conf->angle/conf->acv consistently
with other filter variables and do not try to inherit them if there are
transformations defined for current location.

13 years agoGeo: ensure that default entry is always present.
Ruslan Ermilov [Fri, 21 Dec 2012 08:46:52 +0000 (08:46 +0000)]
Geo: ensure that default entry is always present.

If 0.0.0.0/32 entry was present and there was no explicit "default",
we failed to add an empty string as a default value.

13 years agoThere's no need to normalize address returned by ngx_ptocidr().
Ruslan Ermilov [Fri, 21 Dec 2012 08:44:39 +0000 (08:44 +0000)]
There's no need to normalize address returned by ngx_ptocidr().

13 years agoImage filter: configuration inheritance fixes.
Maxim Dounin [Thu, 20 Dec 2012 19:04:28 +0000 (19:04 +0000)]
Image filter: configuration inheritance fixes.

The image_filter_jpeg_quality, image_filter_sharpen and "image_filter rotate"
were inherited incorrectly if a directive with variables was defined, and
then redefined to a literal value, i.e. in configurations like

    image_filter_jpeg_quality $arg_q;

    location / {
        image_filter_jpeg_quality 50;
    }

Patch by Ian Babrou, with minor changes.

13 years agoBrought the link to ngx_http_perl_module documentation up to date.
Ruslan Ermilov [Thu, 20 Dec 2012 15:34:37 +0000 (15:34 +0000)]
Brought the link to ngx_http_perl_module documentation up to date.

13 years agoFixed return type of internal function that allocates radix tree nodes.
Ruslan Ermilov [Thu, 20 Dec 2012 11:16:03 +0000 (11:16 +0000)]
Fixed return type of internal function that allocates radix tree nodes.

13 years agoLet "add_header" affect 201 responses (ticket #125).
Ruslan Ermilov [Wed, 19 Dec 2012 10:33:56 +0000 (10:33 +0000)]
Let "add_header" affect 201 responses (ticket #125).

13 years agoSlightly optimized code that handles special headers in "add_header".
Ruslan Ermilov [Wed, 19 Dec 2012 10:30:45 +0000 (10:30 +0000)]
Slightly optimized code that handles special headers in "add_header".

13 years agoAvoid sending "100 Continue" on 413 Request Entity Too Large.
Maxim Dounin [Tue, 18 Dec 2012 18:39:39 +0000 (18:39 +0000)]
Avoid sending "100 Continue" on 413 Request Entity Too Large.

Patch by Igor Sysoev.

13 years agoAdded checks that disallow adding a variable with an empty name.
Ruslan Ermilov [Mon, 17 Dec 2012 19:03:33 +0000 (19:03 +0000)]
Added checks that disallow adding a variable with an empty name.
Added variable name syntax checks to "geo" and "map" directives.

13 years agoImplemented IPv6 support for URLs specified using domain names.
Ruslan Ermilov [Mon, 17 Dec 2012 12:08:53 +0000 (12:08 +0000)]
Implemented IPv6 support for URLs specified using domain names.

This includes "debug_connection", upstreams, "proxy_pass", etc.
(ticket #92)

To preserve compatibility, "listen" specified with a domain name
selects the first IPv4 address, if available.  If not available,
the first IPv6 address will be used (ticket #186).

13 years agoFixed URL parsing code.
Ruslan Ermilov [Mon, 17 Dec 2012 09:44:46 +0000 (09:44 +0000)]
Fixed URL parsing code.

The URL parsing code is not expected to initialize port from default port
when in "no_resolve" mode.  This got broken in r4671 for the case of IPv6
literals.

13 years agoSimplified URL parsing code.
Ruslan Ermilov [Mon, 17 Dec 2012 09:31:53 +0000 (09:31 +0000)]
Simplified URL parsing code.

Except for the "listen" directive, "*" specified as a hostname is
no longer treated specially.

13 years agoGeo: fixed the "ranges" without ranges case.
Ruslan Ermilov [Fri, 14 Dec 2012 19:56:03 +0000 (19:56 +0000)]
Geo: fixed the "ranges" without ranges case.

The following configuration returned an empty value for $geo:

    geo $geo {
        ranges;
        default default;
    }

13 years agoGeo: improved ngx_http_geo_block() code readability.
Ruslan Ermilov [Fri, 14 Dec 2012 19:35:37 +0000 (19:35 +0000)]
Geo: improved ngx_http_geo_block() code readability.

13 years agoFixed handling of ngx_write_fd() and ngx_read_fd() errors.
Valentin Bartenev [Fri, 14 Dec 2012 15:24:24 +0000 (15:24 +0000)]
Fixed handling of ngx_write_fd() and ngx_read_fd() errors.

The ngx_write_fd() and ngx_read_fd() functions return -1 in case of error,
so the incorrect comparison with NGX_FILE_ERROR (which is 0 on windows
platforms) might result in inaccurate error message in the error log.

Also the ngx_errno global variable is being set only if the returned value
is -1.

13 years agoGzip: fixed zlib memLevel adjusting.
Valentin Bartenev [Fri, 14 Dec 2012 15:17:58 +0000 (15:17 +0000)]
Gzip: fixed zlib memLevel adjusting.

An incorrect memLevel (lower than 1) might be passed to deflateInit2() if the
"gzip_hash" directive is set to a value less than the value of "gzip_window"
directive. This resulted in "deflateInit2() failed: -2" alert and an empty
reply.

13 years agoUpstream: fixed SIGSEGV with the "if" directive.
Maxim Dounin [Thu, 13 Dec 2012 16:05:59 +0000 (16:05 +0000)]
Upstream: fixed SIGSEGV with the "if" directive.

Configuration like

    location / {
        set $true 1;

        if ($true) {
            proxy_pass http://backend;
        }

        if ($true) {
            # nothing
        }
    }

resulted in segmentation fault due to NULL pointer dereference as the
upstream configuration wasn't initialized in an implicit location created
by the last if(), but the r->content_handler was set due to first if().

Instead of committing a suicide by dereferencing a NULL pointer, return
500 (Internal Server Error) in such cases, i.e. if uscf is NULL.  Better
fix would be to avoid such cases by fixing the "if" directive handling,
but it's out of scope of this patch.

Prodded by Piotr Sikora.

13 years agoFixed variable syntax checking in "set", "geo", "limit_conn_zone",
Ruslan Ermilov [Thu, 13 Dec 2012 15:05:19 +0000 (15:05 +0000)]
Fixed variable syntax checking in "set", "geo", "limit_conn_zone",
and "perl_set" directives.

13 years agoProxy: better error message about unexpected data.
Maxim Dounin [Thu, 13 Dec 2012 13:45:39 +0000 (13:45 +0000)]
Proxy: better error message about unexpected data.

Requested by Igor Sysoev.

13 years agoLimit rate: fixed integer overflow in limit calculation (ticket #256).
Valentin Bartenev [Wed, 12 Dec 2012 14:48:48 +0000 (14:48 +0000)]
Limit rate: fixed integer overflow in limit calculation (ticket #256).

Patch by Alexey Antropov.

13 years agoConfigure: better check for PCRE JIT.
Maxim Dounin [Wed, 12 Dec 2012 13:50:07 +0000 (13:50 +0000)]
Configure: better check for PCRE JIT.

On Mac OS X system toolchain by default prefers include files
from /usr/local/include, but libraries from /usr/lib.  This might result in
various problems, in particular the one outlined below.

If the PCRE library is installed into /usr/local/, this results in pcre.h
being used from /usr/local/include (with PCRE_CONFIG_JIT defined), but
libpcre from /usr/lib (as shipped with the OS, without pcre_free_study()
symbol).  As a result build fails as we use pcre_free_study() function
if we try to compile with PCRE JIT support.

Obvious workaround is to the root cause is to ask compiler to prefer
library from /usr/local/lib via ./configure --with-ld-opt="-L/usr/local/lib".
On the other hand, in any case it would be good to check if the function
we are going to use is available, hence the change.

See thread here for details:
http://mailman.nginx.org/pipermail/nginx-devel/2012-December/003074.html

Prodded by Piotr Sikora.

13 years agoThe "auth_basic" directive gained support of variables.
Ruslan Ermilov [Mon, 10 Dec 2012 13:11:11 +0000 (13:11 +0000)]
The "auth_basic" directive gained support of variables.

13 years agoAllow the complex value to be defined as an empty string.
Ruslan Ermilov [Thu, 6 Dec 2012 23:03:53 +0000 (23:03 +0000)]
Allow the complex value to be defined as an empty string.

This makes conversion from strings to complex values possible
without the loss of functionality.

13 years agoXslt: prevented infinite loop.
Ruslan Ermilov [Thu, 6 Dec 2012 21:22:58 +0000 (21:22 +0000)]
Xslt: prevented infinite loop.

If XSLT transformation failed and error 500 was handled in the same
location, an infinite loop occured that exhausted the stack.

13 years agoFixed build with embedded perl in certain setups (ticket #48).
Ruslan Ermilov [Mon, 3 Dec 2012 16:00:26 +0000 (16:00 +0000)]
Fixed build with embedded perl in certain setups (ticket #48).

13 years agoFixed the NGX_SOCKADDR_STRLEN macro definition.
Ruslan Ermilov [Fri, 30 Nov 2012 11:26:50 +0000 (11:26 +0000)]
Fixed the NGX_SOCKADDR_STRLEN macro definition.

The ngx_sock_ntop() function, when told to print both address and port,
prints IPv6 address in square brackets, followed by colon and port.

13 years agoCore: removed GLOB_NOSORT glob option.
Maxim Dounin [Thu, 29 Nov 2012 23:15:41 +0000 (23:15 +0000)]
Core: removed GLOB_NOSORT glob option.

This will result in alphabetical sorting of included files if
the "include" directive with wildcards is used.

Note that the behaviour is now different from that on Windows, where
alphabetical sorting is not guaranteed for FindFirsFile()/FindNextFile()
(used to be alphabetical on NTFS, but not on FAT).

Approved by Igor Sysoev, prodded by many.

13 years agoVersion bump.
Maxim Dounin [Thu, 29 Nov 2012 23:13:18 +0000 (23:13 +0000)]
Version bump.

13 years agorelease-1.3.9 tag
Maxim Dounin [Tue, 27 Nov 2012 13:55:54 +0000 (13:55 +0000)]
release-1.3.9 tag

13 years agonginx-1.3.9-RELEASE release-1.3.9
Maxim Dounin [Tue, 27 Nov 2012 13:55:34 +0000 (13:55 +0000)]
nginx-1.3.9-RELEASE

13 years agoGunzip: added missing ngx_http_clear_etag().
Maxim Dounin [Mon, 26 Nov 2012 21:30:45 +0000 (21:30 +0000)]
Gunzip: added missing ngx_http_clear_etag().

13 years agoCore: fixed ngx_write_chain_to_file() with IOV_MAX reached.
Maxim Dounin [Mon, 26 Nov 2012 21:19:57 +0000 (21:19 +0000)]
Core: fixed ngx_write_chain_to_file() with IOV_MAX reached.

Catched by dav_chunked.t on Solaris.  In released versions this might
potentially result in corruption of complex protocol responses if they
were written to disk and there were more distinct buffers than IOV_MAX
in a single write.

13 years agoRequest body: block write events while reading body.
Maxim Dounin [Mon, 26 Nov 2012 18:01:49 +0000 (18:01 +0000)]
Request body: block write events while reading body.

If write events are not blocked, an extra write event might happen for
various reasons (e.g. as a result of a http pipelining), resulting in
incorrect body being passed to a post handler.

The problem manifested itself with the dav module only, as this is
the only module which reads the body from a content phase handler (in
contrast to exclusive content handlers like proxy).  Additionally, dav
module used to dump core in such situations due to ticket #238.

See reports here:

http://mailman.nginx.org/pipermail/nginx-devel/2012-November/002981.html
http://serverfault.com/questions/449195/nginx-webdav-server-with-auth-request

13 years agoRequest body: error checking fixes, negative rb->rest handling.
Maxim Dounin [Mon, 26 Nov 2012 18:01:08 +0000 (18:01 +0000)]
Request body: error checking fixes, negative rb->rest handling.

Negative rb->rest can't happen with current code, but it's good to have
it handled anyway.

Found by Coverity (CID 744846, 744847, 744848).

13 years agoRequest body: improved handling of incorrect chunked request body.
Maxim Dounin [Mon, 26 Nov 2012 18:00:14 +0000 (18:00 +0000)]
Request body: improved handling of incorrect chunked request body.

While discarding chunked request body in some cases after detecting
request body corruption no error was returned, while it was possible
to correctly return 400 Bad Request.  If error is detected too late,
make sure to properly close connection.

Additionally, in ngx_http_special_response_handler() don't return body
of 500 Internal Server Error to a client if ngx_http_discard_request_body()
fails, but disable keepalive and continue.

13 years agoRequest body: fixed discard of chunked request body.
Maxim Dounin [Mon, 26 Nov 2012 17:59:30 +0000 (17:59 +0000)]
Request body: fixed discard of chunked request body.

Even if there is no preread data, make sure to always call
ngx_http_discard_request_body_filter() in case of chunked request
body to initialize r->headers_in.content_length_n for later use.

13 years agoCore: don't reuse shared memory zone that changed ownership (ticket #210).
Ruslan Ermilov [Fri, 23 Nov 2012 12:43:58 +0000 (12:43 +0000)]
Core: don't reuse shared memory zone that changed ownership (ticket #210).

nginx doesn't allow the same shared memory zone to be used for different
purposes, but failed to check this on reconfiguration.  If a shared memory
zone was used for another purpose in the new configuration, nginx attempted
to reuse it and crashed.

13 years agoFixed location of debug message in ngx_shmtx_lock().
Ruslan Ermilov [Wed, 21 Nov 2012 14:23:26 +0000 (14:23 +0000)]
Fixed location of debug message in ngx_shmtx_lock().

13 years agoRequest body: unbreak build without debug.
Maxim Dounin [Wed, 21 Nov 2012 01:40:11 +0000 (01:40 +0000)]
Request body: unbreak build without debug.

13 years agoRequest body: chunked transfer encoding support.
Maxim Dounin [Wed, 21 Nov 2012 01:08:11 +0000 (01:08 +0000)]
Request body: chunked transfer encoding support.

13 years agoRequest body: recalculate size of a request body in scgi module.
Maxim Dounin [Wed, 21 Nov 2012 01:06:53 +0000 (01:06 +0000)]
Request body: recalculate size of a request body in scgi module.

This allows to handle requests with chunked body by scgi module, and
also simplifies handling of various request body modifications.

13 years agoRequest body: $content_length variable to honor real body size.
Maxim Dounin [Wed, 21 Nov 2012 01:05:08 +0000 (01:05 +0000)]
Request body: $content_length variable to honor real body size.

This allows to handle requests with chunked body by fastcgi and uwsgi
modules, and also simplifies handling of various request body modifications.

13 years agoRequest body: always use calculated size of a request body in proxy.
Maxim Dounin [Wed, 21 Nov 2012 01:03:48 +0000 (01:03 +0000)]
Request body: always use calculated size of a request body in proxy.

This allows to handle requests with chunked body, and also simplifies
handling of various request body modifications.

13 years agoRequest body: adjust b->pos when chunked parsing done.
Maxim Dounin [Wed, 21 Nov 2012 01:02:56 +0000 (01:02 +0000)]
Request body: adjust b->pos when chunked parsing done.

This is a nop for the current code, though will allow to correctly parse
pipelined requests.

13 years agoRequest body: chunked parsing moved to ngx_http_parse.c from proxy.
Maxim Dounin [Wed, 21 Nov 2012 00:59:16 +0000 (00:59 +0000)]
Request body: chunked parsing moved to ngx_http_parse.c from proxy.

No functional changes.

13 years agoRequest body: properly handle events while discarding body.
Maxim Dounin [Wed, 21 Nov 2012 00:57:56 +0000 (00:57 +0000)]
Request body: properly handle events while discarding body.

An attempt to call ngx_handle_read_event() before actually reading
data from a socket might result in read event being disabled, which is
wrong.  Catched by body.t test on Solaris.

13 years agoRequest body: fixed socket leak on errors.
Maxim Dounin [Wed, 21 Nov 2012 00:57:16 +0000 (00:57 +0000)]
Request body: fixed socket leak on errors.

The r->main->count reference counter was always incremented in
ngx_http_read_client_request_body(), while it is only needs to be
incremented on positive returns.

13 years agoRequest body: code duplication reduced, no functional changes.
Maxim Dounin [Wed, 21 Nov 2012 00:55:50 +0000 (00:55 +0000)]
Request body: code duplication reduced, no functional changes.

The r->request_body_in_file_only with empty body case is now handled in
ngx_http_write_request_body().

13 years agoRequest body: $request_body variable generalization.
Maxim Dounin [Wed, 21 Nov 2012 00:55:06 +0000 (00:55 +0000)]
Request body: $request_body variable generalization.

The $request_body variable was assuming there can't be more than two
buffers.  While this is currently true due to request body reading
implementation details, this is not a good thing to depend on and may
change in the future.

13 years agoRequest body: fixed "501 Not Implemented" error handling.
Maxim Dounin [Wed, 21 Nov 2012 00:54:01 +0000 (00:54 +0000)]
Request body: fixed "501 Not Implemented" error handling.

It is not about "Method" but a generic message, and is expected to be used
e.g. if specified Transfer-Encoding is not supported.  Fixed message to
match RFC 2616.

Additionally, disable keepalive on such errors as we won't be able to read
request body correctly if we don't understand Transfer-Encoding used.

13 years agoCore: added debug logging of writev() in ngx_write_chain_to_file().
Maxim Dounin [Wed, 21 Nov 2012 00:52:35 +0000 (00:52 +0000)]
Core: added debug logging of writev() in ngx_write_chain_to_file().

13 years agoDav: fixed segfault on PUT if body was already read (ticket #238).
Maxim Dounin [Wed, 21 Nov 2012 00:51:37 +0000 (00:51 +0000)]
Dav: fixed segfault on PUT if body was already read (ticket #238).

If request body reading happens with different options it's possible
that there will be no r->request_body->temp_file available (or even
no r->request_body available if body was discarded).  Return internal
server error in this case instead of committing suicide by dereferencing
a null pointer.

13 years agoFixed failure to start cache manager and cache loader processes
Igor Sysoev [Tue, 20 Nov 2012 13:37:55 +0000 (13:37 +0000)]
Fixed failure to start cache manager and cache loader processes
if there were more than 512 listening sockets in configuration.

13 years agoTrailing whitespace fix.
Maxim Dounin [Sat, 17 Nov 2012 00:36:44 +0000 (00:36 +0000)]
Trailing whitespace fix.

13 years agoUpstream: better detection of connect() failures with kqueue.
Maxim Dounin [Fri, 16 Nov 2012 18:29:19 +0000 (18:29 +0000)]
Upstream: better detection of connect() failures with kqueue.

Pending EOF might be reported on both read and write events, whichever
comes first, so check both of them.

Patch by Yichun Zhang (agentzh), slightly modified.

13 years agoUpstream: honor the "down" flag for a single server.
Ruslan Ermilov [Fri, 16 Nov 2012 12:18:05 +0000 (12:18 +0000)]
Upstream: honor the "down" flag for a single server.

If an upstream block was defined with the only server marked as
"down", e.g.

    upstream u {
        server 127.0.0.1:8080 down;
    }

an attempt was made to contact the server despite the "down" flag.
It is believed that immediate 502 response is better in such a
case, and it's also consistent with what is currently done in case
of multiple servers all marked as "down".

13 years agoVariables $request_time and $msec.
Ruslan Ermilov [Fri, 16 Nov 2012 09:37:14 +0000 (09:37 +0000)]
Variables $request_time and $msec.

Log module counterparts are preserved for efficiency.

13 years agoFixed setting of CPU affinity on respawn of dead worker processes.
Ruslan Ermilov [Fri, 16 Nov 2012 09:25:52 +0000 (09:25 +0000)]
Fixed setting of CPU affinity on respawn of dead worker processes.

Worker processes are now made aware of their sequential number needed
to select CPU affinity mask.  This replaces a workaround from r4865.

13 years agoVersion bump.
Ruslan Ermilov [Fri, 16 Nov 2012 07:49:41 +0000 (07:49 +0000)]
Version bump.

13 years agorelease-1.3.8 tag
Maxim Dounin [Tue, 30 Oct 2012 13:35:18 +0000 (13:35 +0000)]
release-1.3.8 tag

13 years agonginx-1.3.8-RELEASE release-1.3.8
Maxim Dounin [Tue, 30 Oct 2012 13:34:23 +0000 (13:34 +0000)]
nginx-1.3.8-RELEASE

13 years agoEvent pipe: fixed handling of buf_to_file data.
Maxim Dounin [Tue, 30 Oct 2012 11:14:24 +0000 (11:14 +0000)]
Event pipe: fixed handling of buf_to_file data.

Input filter might free a buffer if there is no data in it, and in case
of first buffer (used for cache header and request header, aka p->buf_to_file)
this resulted in cache corruption.  Buffer memory was reused to read upstream
response before headers were written to disk.

Fix is to avoid moving pointers in ngx_event_pipe_add_free_buf() to a buffer
start if we were asked to free a buffer used by p->buf_to_file.

This fixes occasional cache file corruption, usually resulted
in "cache file ... has md5 collision" alerts.

Reported by Anatoli Marinov.

13 years agoStyle, parentheses instead of braces in misc/GNUMakefile.
Maxim Dounin [Tue, 30 Oct 2012 11:09:38 +0000 (11:09 +0000)]
Style, parentheses instead of braces in misc/GNUMakefile.

13 years agoVariables $connection and $connection_requests.
Maxim Dounin [Mon, 29 Oct 2012 17:17:59 +0000 (17:17 +0000)]
Variables $connection and $connection_requests.

Log module counterparts are removed as they aren't used often and
there is no need to preserve them for efficiency.

13 years agoResolver: added missing memory allocation error handling.
Maxim Dounin [Wed, 24 Oct 2012 14:07:08 +0000 (14:07 +0000)]
Resolver: added missing memory allocation error handling.

13 years agongx_http_keepalive_handler() is now trying to not keep c->buffer's memory for
Valentin Bartenev [Tue, 23 Oct 2012 14:36:18 +0000 (14:36 +0000)]
ngx_http_keepalive_handler() is now trying to not keep c->buffer's memory for
idle connections.

This behaviour is consistent with the ngx_http_set_keepalive() function and it
should decrease memory usage in some cases (especially if epoll/rtsig is used).

13 years agoCore: the "auto" parameter of the "worker_processes" directive.
Andrey Belov [Tue, 23 Oct 2012 09:08:41 +0000 (09:08 +0000)]
Core: the "auto" parameter of the "worker_processes" directive.

The parameter will set the number of worker processes to the
autodetected number of available CPU cores.

13 years agoRemoved conditional compilation from waitpid() error test.
Maxim Dounin [Thu, 18 Oct 2012 14:48:33 +0000 (14:48 +0000)]
Removed conditional compilation from waitpid() error test.

There are reports that call to a signal handler for an exited process
despite waitpid() already called for the process may happen on Linux
as well.

13 years agoGunzip: fixed r->gzip_ok check.
Maxim Dounin [Thu, 18 Oct 2012 14:27:40 +0000 (14:27 +0000)]
Gunzip: fixed r->gzip_ok check.

13 years agoOCSP stapling: properly check if there is ssl.ctx.
Maxim Dounin [Fri, 5 Oct 2012 11:09:14 +0000 (11:09 +0000)]
OCSP stapling: properly check if there is ssl.ctx.

This fixes segfault if stapling was enabled in a server without a certificate
configured (and hence no ssl.ctx).

13 years agoVariable $bytes_sent.
Maxim Dounin [Wed, 3 Oct 2012 15:25:36 +0000 (15:25 +0000)]
Variable $bytes_sent.

It replicates variable $bytes_sent as previously available in log module
only.

Patch by Benjamin Grössing (with minor changes).

13 years agoLog: $apache_bytes_sent removed.
Maxim Dounin [Wed, 3 Oct 2012 15:25:06 +0000 (15:25 +0000)]
Log: $apache_bytes_sent removed.

It was renamed to $body_bytes_sent in nginx 0.3.10 and the old name is
deprecated since then.

13 years agoSSL: the "ssl_verify_client" directive parameter "optional_no_ca".
Maxim Dounin [Wed, 3 Oct 2012 15:24:08 +0000 (15:24 +0000)]
SSL: the "ssl_verify_client" directive parameter "optional_no_ca".

This parameter allows to don't require certificate to be signed by
a trusted CA, e.g. if CA certificate isn't known in advance, like in
WebID protocol.

Note that it doesn't add any security unless the certificate is actually
checked to be trusted by some external means (e.g. by a backend).

Patch by Mike Kazantsev, Eric O'Connor.

13 years agoVersion bump.
Maxim Dounin [Wed, 3 Oct 2012 15:22:18 +0000 (15:22 +0000)]
Version bump.

13 years agorelease-1.3.7 tag
Maxim Dounin [Tue, 2 Oct 2012 13:33:58 +0000 (13:33 +0000)]
release-1.3.7 tag

13 years agonginx-1.3.7-RELEASE release-1.3.7
Maxim Dounin [Tue, 2 Oct 2012 13:33:37 +0000 (13:33 +0000)]
nginx-1.3.7-RELEASE