]> git.kaiwu.me - nginx.git/log
nginx.git
13 years agoMerge of r4948, r4949, r4964, r4973, r5011: variables.
Maxim Dounin [Sun, 10 Feb 2013 03:08:42 +0000 (03:08 +0000)]
Merge of r4948, r4949, r4964, r4973, r5011: variables.

*) 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.

*) The "auth_basic" directive gained support of variables.

*) Fixed variable syntax checking in "set", "geo", "limit_conn_zone",
   and "perl_set" directives.

*) Added checks that disallow adding a variable with an empty name.
   Added variable name syntax checks to "geo" and "map" directives.

*) Variables $pipe, $request_length, $time_iso8601, and $time_local.
   Log module counterparts are preserved for efficiency.
   Based on patch by Kiril Kalchev.

13 years agoMerge of r4947: xslt: prevented infinite loop.
Maxim Dounin [Sun, 10 Feb 2013 03:00:55 +0000 (03:00 +0000)]
Merge of r4947: 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 agoMerge of r4946, r4978: perl.
Maxim Dounin [Sun, 10 Feb 2013 02:58:03 +0000 (02:58 +0000)]
Merge of r4946, r4978: perl.

*) Fixed build with embedded perl in certain setups (ticket #48).

*) Brought the link to ngx_http_perl_module documentation up to date.

13 years agoMerge of r4945, r4984: ngx_inet.[ch] minor fixes.
Maxim Dounin [Sun, 10 Feb 2013 02:56:03 +0000 (02:56 +0000)]
Merge of r4945, r4984: ngx_inet.[ch] minor fixes.

*) 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.

*) Properly initialize "struct in6_addr" with zeroes.

13 years agoMerge of r4944: removed GLOB_NOSORT glob option.
Maxim Dounin [Sat, 9 Feb 2013 21:27:37 +0000 (21:27 +0000)]
Merge of r4944: 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 [Sat, 9 Feb 2013 21:07:06 +0000 (21:07 +0000)]
Version bump.

13 years agorelease-1.2.6 tag
Maxim Dounin [Tue, 11 Dec 2012 14:26:07 +0000 (14:26 +0000)]
release-1.2.6 tag

13 years agonginx-1.2.6-RELEASE release-1.2.6
Maxim Dounin [Tue, 11 Dec 2012 14:24:23 +0000 (14:24 +0000)]
nginx-1.2.6-RELEASE

13 years agoMerge of r4921, r4922, r4923, r4924, r4925: request body fixes.
Maxim Dounin [Tue, 11 Dec 2012 13:18:50 +0000 (13:18 +0000)]
Merge of r4921, r4922, r4923, r4924, r4925: request body fixes.

*) 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.

*) 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.

*) 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().

*) 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.

*) 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 agoMerge of r4933, r4933: shared memory fixes.
Maxim Dounin [Mon, 10 Dec 2012 18:17:32 +0000 (18:17 +0000)]
Merge of r4933, r4933: shared memory fixes.

*) Fixed location of debug message in ngx_shmtx_lock().

*) 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 agoMerge of r4920, r4939: ngx_write_chain_to_file() fixes.
Maxim Dounin [Mon, 10 Dec 2012 18:04:54 +0000 (18:04 +0000)]
Merge of r4920, r4939: ngx_write_chain_to_file() fixes.

*) Core: added debug logging of writev() in ngx_write_chain_to_file().

*) 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 agoMerge of r4919: fixed segfault on PUT in dav module.
Maxim Dounin [Mon, 10 Dec 2012 17:51:10 +0000 (17:51 +0000)]
Merge of r4919: fixed segfault on PUT in dav module.

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 agoMerge of r4918: cache manager startup with many listen sockets.
Maxim Dounin [Mon, 10 Dec 2012 17:46:51 +0000 (17:46 +0000)]
Merge of r4918: cache manager startup with many listen sockets.

Fixed failure to start cache manager and cache loader processes
if there were more than 512 listening sockets in configuration.

13 years agoMerge of r4915, r4916, r4917: upstream minor fixes.
Maxim Dounin [Mon, 10 Dec 2012 16:35:32 +0000 (16:35 +0000)]
Merge of r4915, r4916, r4917: upstream minor fixes.

*) 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".

*) 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 agoMerge of r4914: variables $request_time and $msec.
Maxim Dounin [Mon, 10 Dec 2012 16:03:56 +0000 (16:03 +0000)]
Merge of r4914: variables $request_time and $msec.

Log module counterparts are preserved for efficiency.

13 years agoMerge of r4913: fixed CPU affinity on respawn of dead workers.
Maxim Dounin [Mon, 10 Dec 2012 16:00:55 +0000 (16:00 +0000)]
Merge of r4913: fixed CPU affinity on respawn of dead workers.

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.
Maxim Dounin [Mon, 10 Dec 2012 15:43:41 +0000 (15:43 +0000)]
Version bump.

13 years agorelease-1.2.5 tag
Maxim Dounin [Tue, 13 Nov 2012 13:35:19 +0000 (13:35 +0000)]
release-1.2.5 tag

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

13 years agoMerge of r4896: event pipe: fixed handling of buf_to_file data.
Maxim Dounin [Tue, 13 Nov 2012 11:24:14 +0000 (11:24 +0000)]
Merge of r4896: 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 agoMerge of r4892: keepalive memory usage optimization.
Maxim Dounin [Tue, 13 Nov 2012 11:21:31 +0000 (11:21 +0000)]
Merge of r4892: keepalive memory usage optimization.

The ngx_http_keepalive_handler() function 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 agoMerge of r4891: worker_processes auto.
Maxim Dounin [Tue, 13 Nov 2012 11:00:37 +0000 (11:00 +0000)]
Merge of r4891: worker_processes auto.

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 agoMerge of r4886, r4887, r4894: log variables generalization:
Maxim Dounin [Tue, 13 Nov 2012 10:45:23 +0000 (10:45 +0000)]
Merge of r4886, r4887, r4894: log variables generalization:

*) 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.

*) Variable $bytes_sent.  It replicates variable $bytes_sent as previously
   available in log module only.  Patch by Benjamin Grössing (with minor
   changes).

*) 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 agoMerge of r4885: ssl_verify_client optional_no_ca.
Maxim Dounin [Tue, 13 Nov 2012 10:42:16 +0000 (10:42 +0000)]
Merge of r4885: ssl_verify_client optional_no_ca.

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 agoMerge of r4872, r4893: resolver cached addresses random rotation.
Maxim Dounin [Mon, 12 Nov 2012 18:47:07 +0000 (18:47 +0000)]
Merge of r4872, r4893: resolver cached addresses random rotation.

Resolver: cached addresses are returned with random rotation now.

This ensures balancing when working with dynamically resolved upstream
servers with multiple addresses.

Based on patch by Anton Jouline.

13 years agoMerge of r4870, r4871, r4890, r4895: minor fixes.
Maxim Dounin [Mon, 12 Nov 2012 18:39:51 +0000 (18:39 +0000)]
Merge of r4870, r4871, r4890, r4895: minor fixes.

*) Made sure to initialize the entire ngx_file_t structure.
   Found by Coverity.

*) Correct plural form for "path" in the whole source base.

*) 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.

*) Style, parentheses instead of braces in misc/GNUMakefile.

13 years agoMerge of r4868, r4869: SSL minor fixes.
Maxim Dounin [Mon, 12 Nov 2012 18:00:32 +0000 (18:00 +0000)]
Merge of r4868, r4869: SSL minor fixes.

*) SSL: fixed compression workaround to remove all methods.

   Previous code used sk_SSL_COMP_delete(ssl_comp_methods, i) while iterating
   stack from 0 to n, resulting in removal of only even compression methods.

   In real life this change is a nop, as there is only one compression method
   which is enabled by default in OpenSSL.

*) SSL: added version checks for ssl compression workaround.

   The SSL_COMP_get_compression_methods() is only available as an API
   function in OpenSSL 0.9.8+, require it explicitly to unbreak build
   with OpenSSL 0.9.7.

13 years agoMerge of r4866, r4867: configure fixes.
Maxim Dounin [Mon, 12 Nov 2012 17:57:57 +0000 (17:57 +0000)]
Merge of r4866, r4867: configure fixes.

*) Configure: help updated to list upstream keepalive and least_conn.
   Patch by Joshua Zhu.

*) Configure: additional test for ExtUtils::Embed perl module presence.
   Now perl configure will correctly fail if ExtUtils::Embed perl module
   is not present in the system (found on Amazon Linux AMI, as of
   release 2012.03).

13 years agoMerge of r4865: clearing of cpu_affinity after process spawn.
Maxim Dounin [Mon, 12 Nov 2012 17:54:49 +0000 (17:54 +0000)]
Merge of r4865: clearing of cpu_affinity after process spawn.

This fixes unwanted/incorrect cpu_affinity use on dead worker processes
respawn.  While this is not ideal, it's expected to be better when previous
situation where multiple processes were spawn with identical CPU affinity
set.

Reported by Charles Chen.

13 years agoVersion bump.
Maxim Dounin [Mon, 12 Nov 2012 17:03:38 +0000 (17:03 +0000)]
Version bump.

13 years agorelease-1.2.4 tag
Maxim Dounin [Tue, 25 Sep 2012 13:43:03 +0000 (13:43 +0000)]
release-1.2.4 tag

13 years agonginx-1.2.4-RELEASE release-1.2.4
Maxim Dounin [Tue, 25 Sep 2012 13:42:43 +0000 (13:42 +0000)]
nginx-1.2.4-RELEASE

13 years agoStable: removed gunzip module from win32 helper target.
Maxim Dounin [Tue, 25 Sep 2012 10:41:22 +0000 (10:41 +0000)]
Stable: removed gunzip module from win32 helper target.

Gunzip filter isn't merged into stable branch.

13 years agoMerge of r4835, r4841: improved welcome and 50x error pages.
Maxim Dounin [Mon, 24 Sep 2012 19:14:17 +0000 (19:14 +0000)]
Merge of r4835, r4841: improved welcome and 50x error pages.

13 years agoMerge of r4833: limit req: fix of rbtree node insertion.
Maxim Dounin [Mon, 24 Sep 2012 19:11:45 +0000 (19:11 +0000)]
Merge of r4833: limit req: fix of rbtree node insertion.

Limit req: fix of rbtree node insertion on hash collisions.

The rbtree used in ngx_http_limit_req_module has two level of keys, the top is
hash, and the next is the value string itself. However, when inserting a new
node, only hash has been set, while the value string has been left empty.

The bug was introduced in r4419 (1.1.14).
Found by Charles Chen.

13 years agoMerge of r4829: fixed strict aliasing with ipv6 (ticket #201).
Maxim Dounin [Mon, 24 Sep 2012 19:06:48 +0000 (19:06 +0000)]
Merge of r4829: fixed strict aliasing with ipv6 (ticket #201).

Fixed strict aliasing bugs when dealing with IPv4-mapped IPv6
addresses.

13 years agoMerge of r4828: "include" with wildcards in map and types blocks.
Maxim Dounin [Mon, 24 Sep 2012 19:05:02 +0000 (19:05 +0000)]
Merge of r4828: "include" with wildcards in map and types blocks.

The "include" directive should be able to include multiple files if
given a filename mask.  Fixed this to work for "include" directives
inside the "map" or "types" blocks.  The "include" directive inside
the "geo" block is still not fixed.

13 years agoMerge of r4817: geo: fixed handling of ranges without default set.
Maxim Dounin [Mon, 24 Sep 2012 19:02:16 +0000 (19:02 +0000)]
Merge of r4817: geo: fixed handling of ranges without default set.

The bug had appeared in 0.8.43 (r3653).  Patch by Weibin Yao.

13 years agoMerge of r4815: map: fixed optimization of variables as values.
Maxim Dounin [Mon, 24 Sep 2012 19:00:02 +0000 (19:00 +0000)]
Merge of r4815: map: fixed optimization of variables as values.

Previous code incorrectly used ctx->var_values as an array of pointers to
ngx_http_variable_value_t, but the array contains structures, not pointers.
Additionally, ctx->var_values inspection failed to properly set var on
match.

13 years agoMerge of r4813, r4814, r4818, r4819, r4820, r4823: mail fixes.
Maxim Dounin [Mon, 24 Sep 2012 18:58:13 +0000 (18:58 +0000)]
Merge of r4813, r4814, r4818, r4819, r4820, r4823: mail fixes.

*) Corrected the directive name in the ngx_mail_auth_http_module
   error message.

*) Don't let the well-known port in the "listen" directive to
   override the already set "protocol".

*) Fixed sorting of listen addresses (ticket #187).  For http module
   this problem was already fixed in r4756.

*) Removed a stale "AF_INET only" comment.  IPv6 client connections
   in mail modules have been supported since r2856.

*) Fixed handling of AF_UNIX addresses in "listen".  This makes AF_UNIX
   addresses in mail officially supported.

*) Whitespace fix.

13 years agoMerge of r4785, r4795, r4811, r4812, r4816, r4822: coverity.
Maxim Dounin [Mon, 24 Sep 2012 18:54:28 +0000 (18:54 +0000)]
Merge of r4785, r4795, r4811, r4812, r4816, r4822: coverity.

*) Resolver: fixed possible memory leak in ngx_resolver_create().

*) Explicitly ignore returned value from unlink() in ngx_open_tempfile().

*) Explicitly ignore returned value from close() in ngx_event_core_init_conf().

*) Added three missing checks for NULL after ngx_array_push() calls.

*) Crypt: fixed handling of corrupted SSHA entries in password file.

*) Mark logically dead code with corresponding comment.

Found by / prodded by Coverity.

13 years agoMerge of r4784: fixed the -p parameter handling.
Maxim Dounin [Mon, 24 Sep 2012 18:50:25 +0000 (18:50 +0000)]
Merge of r4784: fixed the -p parameter handling.

Ensure that the path supplied always ends with a `/' except when empty.
An empty value now corresponds to the current directory instead of `/'.

13 years agoMerge of r4842: fixed make macros to use parentheses.
Maxim Dounin [Mon, 24 Sep 2012 18:46:50 +0000 (18:46 +0000)]
Merge of r4842: fixed make macros to use parentheses.

Configure: fixed make macros to use parentheses instead of braces.
Parentheses are more portable, in particular they are understood by
nmake while braces aren't.

13 years agoMerge of r4779, r4840, r4843, r4844: win32 changes.
Maxim Dounin [Mon, 24 Sep 2012 18:37:14 +0000 (18:37 +0000)]
Merge of r4779, r4840, r4843, r4844: win32 changes.

*) Fixed build with Visual Studio 2005 Express.

   It is available via winetricks which makes it still usable, and has
   an old crtdefs.h which uses _CRT_SECURE_NO_DEPRECATE instead of
   _CRT_SECURE_NO_WARNINGS to suppress warnings.

   Reported by HAYASHI Kentaro,
   http://mailman.nginx.org/pipermail/nginx-devel/2012-August/002542.html

*) Configure: provide inflate() when building zlib on win32.

*) Helper target "win32" to run configure for win32 builds.

*) Updated zlib used for win32 builds.

13 years agoMerge of r4778, r4782, r4783, r4824, r4830, r4834: minor fixes.
Maxim Dounin [Mon, 24 Sep 2012 18:34:04 +0000 (18:34 +0000)]
Merge of r4778, r4782, r4783, r4824, r4830, r4834: minor fixes.

*) Reorder checks in ngx_shared_memory_add() for more consistent
   error messages.

*) Added "const" to ngx_memcpy() with NGX_MEMCPY_LIMIT defined.  This
   fixes warning produced during compilation of the ngx_http_geoip_module
   due to const qualifier being discarded.

*) Fixed possible use of old cached times if runtime went backwards.

   If ngx_time_sigsafe_update() updated only ngx_cached_err_log_time, and
   then clock was adjusted backwards, the cached_time[slot].sec might
   accidentally match current seconds on next ngx_time_update() call,
   resulting in various cached times not being updated.

   Fix is to clear the cached_time[slot].sec to explicitly mark cached times
   are stale and need updating.

*) Radix tree preallocation fix.  The preallocation size was calculated
   incorrectly and was always 8 due to sizeof(ngx_radix_tree_t) accidentally
   used instead of sizeof(ngx_radix_node_t).

*) Fixed overflow if ngx_slab_alloc() is called with very big "size"
   argument.

*) Write filter: replaced unneeded loop with one to free chains.
   Noted by Gabor Lekeny.

13 years agoMerge of r4777, r4780, r4831, r4832: release process changes.
Maxim Dounin [Mon, 24 Sep 2012 18:30:26 +0000 (18:30 +0000)]
Merge of r4777, r4780, r4831, r4832: release process changes.

*) Simplified makefile that builds CHANGES.

*) Removed the need in Perl to generate ZIP archive of nginx/Windows.

*) Converted DOS-style newlines in dump.xslt.

*) Pass changes.xml thru xmllint when generating CHANGES and CHANGES.ru.

13 years agoVersion bump.
Maxim Dounin [Mon, 24 Sep 2012 18:24:07 +0000 (18:24 +0000)]
Version bump.

13 years agorelease-1.2.3 tag
Maxim Dounin [Tue, 7 Aug 2012 12:36:19 +0000 (12:36 +0000)]
release-1.2.3 tag

13 years agonginx-1.2.3-RELEASE release-1.2.3
Maxim Dounin [Tue, 7 Aug 2012 12:35:56 +0000 (12:35 +0000)]
nginx-1.2.3-RELEASE

13 years agoMerge of r4739: s/ngx_shmtx_destory/ngx_shmtx_destroy/.
Maxim Dounin [Mon, 6 Aug 2012 18:09:23 +0000 (18:09 +0000)]
Merge of r4739: s/ngx_shmtx_destory/ngx_shmtx_destroy/.

13 years agoMerge of r4775: updated PCRE used for win32 builds.
Maxim Dounin [Mon, 6 Aug 2012 17:38:12 +0000 (17:38 +0000)]
Merge of r4775: updated PCRE used for win32 builds.

13 years agoMerge of r4771: ngx_http_find_virtual_server() fix.
Maxim Dounin [Mon, 6 Aug 2012 17:36:30 +0000 (17:36 +0000)]
Merge of r4771: ngx_http_find_virtual_server() fix.

The ngx_http_find_virtual_server() function should return NGX_DECLINED
if virtual server not found.

13 years agoMerge of r4770: hide_headers/pass_headers inheritance fix.
Maxim Dounin [Mon, 6 Aug 2012 17:34:08 +0000 (17:34 +0000)]
Merge of r4770: hide_headers/pass_headers inheritance fix.

Hide headers and pass headers arrays might not be inherited correctly
into a nested location, e.g. in configuration like

    server {
        proxy_hide_header X-Foo;
        location / {
            location /nested/ {
                proxy_pass_header X-Pad;
            }
        }
    }

the X-Foo header wasn't hidden in the location /nested/.

Reported by Konstantin Svist,
http://mailman.nginx.org/pipermail/nginx-ru/2012-July/047555.html

13 years agoMerge of r4769: better diagnostics for directives in wrong context.
Maxim Dounin [Mon, 6 Aug 2012 17:31:32 +0000 (17:31 +0000)]
Merge of r4769: better diagnostics for directives in wrong context.

13 years agoMerge of r4766, r4767: ngx_http_upstream_add() changes.
Maxim Dounin [Mon, 6 Aug 2012 17:20:01 +0000 (17:20 +0000)]
Merge of r4766, r4767: ngx_http_upstream_add() changes.

*) Fixed to return NULL if an error occurs.

*) Microoptimization: replaced an expression known to be constant with
   the constant value.

13 years agoMerge of r4765: reduced the number of preprocessor directives.
Maxim Dounin [Mon, 6 Aug 2012 17:15:23 +0000 (17:15 +0000)]
Merge of r4765: reduced the number of preprocessor directives.

13 years agoMerge of r4764: debug_connection with a domain name change.
Maxim Dounin [Mon, 6 Aug 2012 17:13:20 +0000 (17:13 +0000)]
Merge of r4764: debug_connection with a domain name change.

When "debug_connection" is configured with a domain name, only the first
resolved address was used.  Now all addresses will be used.

13 years agoMerge of r4763: added the Clang compiler support.
Maxim Dounin [Mon, 6 Aug 2012 17:10:35 +0000 (17:10 +0000)]
Merge of r4763: added the Clang compiler support.

The -Werror is commented out to not break builds on Linux.

13 years agoMerge of r4760, r4761: -Wmissing-prototypes.
Maxim Dounin [Mon, 6 Aug 2012 17:07:28 +0000 (17:07 +0000)]
Merge of r4760, r4761: -Wmissing-prototypes.

Fixed compilation with -Wmissing-prototypes.  Added a commented
out -Wmissing-prototypes to CFLAGS.  It is commented out to not break
builds with 3rd party modules.

13 years agoMerge of r4759, r4762, r4768: configure minor fixes.
Maxim Dounin [Mon, 6 Aug 2012 17:03:01 +0000 (17:03 +0000)]
Merge of r4759, r4762, r4768: configure minor fixes.

*) Replaced a number of "else if" with "elif".

*) Made sure to run configure in a "C" locale.  Otherwise, we may fail
   to properly detect a version of compiler.

*) Removed extraneous GCC warning flags.

13 years agoMerge of r4758: win32: fixed cpu hog after process startup failure.
Maxim Dounin [Mon, 6 Aug 2012 16:24:22 +0000 (16:24 +0000)]
Merge of r4758: win32: fixed cpu hog after process startup failure.

If ngx_spawn_process() failed while starting a process, the process
handle was closed but left non-NULL in the ngx_processes[] array.
The handle later was used in WaitForMultipleObjects() (if there
were multiple worker processes configured and at least one worker
process was started successfully), resulting in infinite loop.

Reported by Ricardo Villalobos Guevara:
http://mailman.nginx.org/pipermail/nginx-devel/2012-July/002494.html

13 years agoMerge of r4757: debugging messages in limit_conn.
Maxim Dounin [Mon, 6 Aug 2012 16:19:35 +0000 (16:19 +0000)]
Merge of r4757: debugging messages in limit_conn.

Fixed debugging messages to account that limit_zone was renamed to limit_conn.

13 years agoVersion bump.
Maxim Dounin [Mon, 6 Aug 2012 16:06:36 +0000 (16:06 +0000)]
Version bump.

13 years agoMerge of r4756: fixed listen addresses sorting (ticket #187)
Maxim Dounin [Mon, 6 Aug 2012 16:03:56 +0000 (16:03 +0000)]
Merge of r4756: fixed listen addresses sorting (ticket #187)

Fixed sorting of listen addresses so that wildcard address is always at
the end.  Failure to do so could result in several listen sockets to be
created instead of only one listening on wildcard address.

Reported by Roman Odaisky.

13 years agoMerge of r4754: synchronized the license text.
Maxim Dounin [Mon, 6 Aug 2012 15:52:02 +0000 (15:52 +0000)]
Merge of r4754: synchronized the license text.

Synchronized the license text with the FreeBSD's bsd-style-copyright.

13 years agoMerge of r4741: fixed "make" used instead of "${MAKE}".
Maxim Dounin [Mon, 6 Aug 2012 15:47:15 +0000 (15:47 +0000)]
Merge of r4741: fixed "make" used instead of "${MAKE}".

13 years agoMerge of r4740: fixed $request_length for pipelined requests.
Maxim Dounin [Mon, 6 Aug 2012 15:45:44 +0000 (15:45 +0000)]
Merge of r4740: fixed $request_length for pipelined requests.

13 years agoMerge of r4738: struct flock initialization.
Maxim Dounin [Mon, 6 Aug 2012 15:31:49 +0000 (15:31 +0000)]
Merge of r4738: struct flock initialization.

Made sure to initialize the entire "struct flock" allocated on stack.

13 years agoMerge of r4737: r->uri_changed in a named location fix.
Maxim Dounin [Mon, 6 Aug 2012 15:20:03 +0000 (15:20 +0000)]
Merge of r4737: r->uri_changed in a named location fix.

Reset r->uri_changed in a named location (ticket #184).

13 years agoMerge of r4736: typo fixed.
Maxim Dounin [Mon, 6 Aug 2012 14:58:36 +0000 (14:58 +0000)]
Merge of r4736: typo fixed.

13 years agoMerge of r4713: map hostnames fix (ticket #182).
Maxim Dounin [Mon, 6 Aug 2012 14:04:06 +0000 (14:04 +0000)]
Merge of r4713: map hostnames fix (ticket #182).

The final dot wasn't stripped before looking up in a map of hostnames.

13 years agorelease-1.2.2 tag
Maxim Dounin [Tue, 3 Jul 2012 10:48:54 +0000 (10:48 +0000)]
release-1.2.2 tag

13 years agonginx-1.2.2-RELEASE release-1.2.2
Maxim Dounin [Tue, 3 Jul 2012 10:48:31 +0000 (10:48 +0000)]
nginx-1.2.2-RELEASE

13 years agoMerge of r4698: X-Forwarded-For conditionals.
Maxim Dounin [Mon, 2 Jul 2012 17:41:52 +0000 (17:41 +0000)]
Merge of r4698: X-Forwarded-For conditionals.

Fixed compile-time conditionals used to detect if X-Forwarded-For support
is needed.

Note: compatibility shims were added during merge to avoid possible
breakage of 3rd party modules.  At least cache purge module was broken
by the original commit, as it used to rely on NGX_HTTP_PROXY define.

13 years agoMerge of r4697: disabled gzip in OpenSSL prior to 1.0.0.
Maxim Dounin [Mon, 2 Jul 2012 17:25:51 +0000 (17:25 +0000)]
Merge of r4697: disabled gzip in OpenSSL prior to 1.0.0.

Disabled gzip compression in OpenSSL prior to 1.0.0 version.
This saves about 522K per connection.

13 years agoMerge of r4693: fixed "sendmsg() failed" alerts on HP-UX.
Maxim Dounin [Mon, 2 Jul 2012 17:22:31 +0000 (17:22 +0000)]
Merge of r4693: fixed "sendmsg() failed" alerts on HP-UX.

HP-UX needs _HPUX_ALT_XOPEN_SOCKET_API to be defined to be able to
use various POSIX versions of networking functions.  Notably sendmsg()
resulted in "sendmsg() failed (9: Bad file number)" alerts without it.

See xopen_networking(7) for more details.

13 years agoMerge of r4691: changed default alignment to 16.
Maxim Dounin [Mon, 2 Jul 2012 17:08:26 +0000 (17:08 +0000)]
Merge of r4691: changed default alignment to 16.

This fixes alignment problems observerd on ARMs, and likely also needed
for MIPSes.  Unless we know alignment is not required just assume we
need 16, which appears to be safe default for all architectures.

See here for details:
http://mailman.nginx.org/pipermail/nginx/2012-June/034139.html

13 years agoMerge of r4690: conflicting wildcard server names fix.
Maxim Dounin [Mon, 2 Jul 2012 16:59:34 +0000 (16:59 +0000)]
Merge of r4690: conflicting wildcard server names fix.

With previous code wildcard names were added to hash even if conflict
was detected.  This resulted in identical names in hash and segfault
later in ngx_hash_wildcard_init().

13 years agoMerge of r4688, r4689, r4706:
Maxim Dounin [Mon, 2 Jul 2012 16:56:53 +0000 (16:56 +0000)]
Merge of r4688, r4689, r4706:

*) Mp4: fixed non-keyframe seeks in some cases (ticket #175).

   Number of entries in stsc atom was wrong if we've added an entry to
   split a chunk.

   Additionally, there is no need to add an entry if we are going to split
   last chunk in an entry, it's enough to update the entry we already have.
   Previously new entry was added and old one was left as is, resulting in
   incorrect entry with zero chunks which might confuse some software.

*) Mp4: fixed streaming if moov atom is at buffer edge.

13 years agoMerge of r4686, r4687: $status variable.
Maxim Dounin [Mon, 2 Jul 2012 16:53:36 +0000 (16:53 +0000)]
Merge of r4686, r4687: $status variable.

Contains response status code as a 3-digit integer
(with leading zeroes if necessary), or one of the following values:

    000 - response status code has not yet been assigned
    009 - HTTP/0.9 request is being processed

13 years agoMerge of r4682, r4694, r4699, r4704, r4705: minor nits.
Maxim Dounin [Mon, 2 Jul 2012 16:51:02 +0000 (16:51 +0000)]
Merge of r4682, r4694, r4699, r4704, r4705: minor nits.

*) Fixed spelling of "endianness", and called it "byte ordering" in the
   user visible part.

*) Fixed return type of ngx_strerror_init().

*) Fixed a harmless error in spelling of "Connection: close" when computing
   the response header length.

*) Style.

*) Added code to look up Google perftools in /opt/local/, for MacPorts.

13 years agoMerge of r4655, r4656, r4657, r4695, r4696: upstream changes.
Maxim Dounin [Mon, 2 Jul 2012 16:41:13 +0000 (16:41 +0000)]
Merge of r4655, r4656, r4657, r4695, r4696: upstream changes.

*) Upstream: least_conn balancer module.

*) Upstream: weights and IPv6 support in ip_hash balancer.

*) Upstream keepalive: "single" parameter deprecated.

13 years agoMerge of r4654, r4672, r4684, r4685, r4692: resolver changes.
Maxim Dounin [Mon, 2 Jul 2012 16:23:14 +0000 (16:23 +0000)]
Merge of r4654, r4672, r4684, r4685, r4692: resolver changes.

*) Resolver: fixed format specification.
   Patch by Yichun Zhang (agentzh).

*) Support for IPv6 literals and an optional port in resolver.

*) Fixed crash in ngx_resolver_cleanup_tree().

   If sending a DNS request fails with an error (e.g., when mistakenly
   trying to send it to a local IP broadcast), such a request is not
   deleted if there are clients waiting on it.  However, it was still
   erroneously removed from the queue.  Later ngx_resolver_cleanup_tree()
   attempted to remove it from the queue again that resulted in a NULL
   pointer dereference.

*) When "resolver" is configured with a domain name, only the first
   resolved address was used.  Now all addresses will be used.

*) Fixed segfault with poll and resolver used.

   Poll event method needs ngx_cycle->files to work, and use of
   ngx_exit_cycle without files set caused null pointer dereference in
   resolver's cleanup on udp socket close.

13 years agoMerge of r4671: support for IPv6 literals in proxy_pass and so on.
Maxim Dounin [Mon, 2 Jul 2012 16:16:27 +0000 (16:16 +0000)]
Merge of r4671: support for IPv6 literals in proxy_pass and so on.

13 years agoMerge of r4653: ngx_inet.c code reduction.
Maxim Dounin [Mon, 2 Jul 2012 16:11:02 +0000 (16:11 +0000)]
Merge of r4653: ngx_inet.c code reduction.

Code reduction (no functional changes).

13 years agoMerge of r4652: ssl without buffer should not set c->buffered.
Maxim Dounin [Mon, 2 Jul 2012 15:51:02 +0000 (15:51 +0000)]
Merge of r4652: ssl without buffer should not set c->buffered.

Removed mistaken setting of NGX_SSL_BUFFERED flag in ngx_ssl_send_chain()
if SSL buffer is not used.

13 years agoMerge of r4651: proxy_cookie_* fix.
Maxim Dounin [Mon, 2 Jul 2012 15:43:50 +0000 (15:43 +0000)]
Merge of r4651: proxy_cookie_* fix.

Fixed returned value handling from the cookie rewrite handler.

If the "proxy_cookie_domain" or "proxy_cookie_path" directive is used and there
are no matches in Set-Cookie header then ngx_http_proxy_rewrite_cookie() returns
NGX_DECLINED to indicate that the header was not rewritten. Returning this value
further from the upstream headers copy handler resulted in 500 error response.

See here for report:
http://mailman.nginx.org/pipermail/nginx/2012-May/033858.html

13 years agoMerge of r4648, r4649, r4650: memory leak with $geoip_org.
Maxim Dounin [Mon, 2 Jul 2012 15:41:31 +0000 (15:41 +0000)]
Merge of r4648, r4649, r4650: memory leak with $geoip_org.

Patch by Denis F. Latypoff (slightly modified).

13 years agoMerge of r4647: xslt reuse.
Maxim Dounin [Mon, 2 Jul 2012 15:39:28 +0000 (15:39 +0000)]
Merge of r4647: xslt reuse.

Fixed the reuse of parsed DTDs and XSLTs.

Patch by Kuramoto Eiji.

13 years agoMerge of r4646: jemalloc 3.0.0 compatibility.
Maxim Dounin [Mon, 2 Jul 2012 15:37:49 +0000 (15:37 +0000)]
Merge of r4646: jemalloc 3.0.0 compatibility.

Fixed compilation with -DNGX_DEBUG_MALLOC on FreeBSD 10.

After jemalloc 3.0.0 import there is no _malloc_options symbol, it has
been replaced with the malloc_conf one with a different syntax.

13 years agoMerge of r4644:
Maxim Dounin [Mon, 2 Jul 2012 15:35:22 +0000 (15:35 +0000)]
Merge of r4644:

Fixed potential null pointer dereference in ngx_resolver_create().
While here, improved error message.

13 years agoMerge of r4643:
Maxim Dounin [Mon, 2 Jul 2012 15:33:35 +0000 (15:33 +0000)]
Merge of r4643:

Removed historical and now redundant syntax pre-checks in ngx_parse_url().

13 years agoMerge of r4642:
Maxim Dounin [Mon, 2 Jul 2012 14:42:08 +0000 (14:42 +0000)]
Merge of r4642:

Fixed core variables dynamic access after reconfiguration.

If variable was indexed in previous configuration but not in current
one, the NGX_HTTP_VAR_INDEXED flag was left set and confused
ngx_http_get_variable().

Patch by Yichun Zhang (agentzh), slightly modified.

13 years agoMerge of r4639, r4640: C++ fixes.
Maxim Dounin [Fri, 29 Jun 2012 17:32:43 +0000 (17:32 +0000)]
Merge of r4639, r4640: C++ fixes.

Fixed the ngx_regex.h header file compatibility with C++.  Fixed
building --with-cpp_test_module on some systems.

13 years agoMerge of r4636, r4637, r4638: config sanity checks.
Maxim Dounin [Fri, 29 Jun 2012 17:28:41 +0000 (17:28 +0000)]
Merge of r4636, r4637, r4638: config sanity checks.

*) Added syntax checking of the second parameter of the "split_clients"
   directive.

*) Capped the status code that may be returned with "return" and
   "try_files".

*) Zero padded the returned and logged HTTP status code, and fixed possible
   buffer overrun in $status handling.

13 years agoMerge of r4645: fixed warning during nginx.xs compilation.
Maxim Dounin [Tue, 26 Jun 2012 14:40:23 +0000 (14:40 +0000)]
Merge of r4645: fixed warning during nginx.xs compilation.

13 years agoFixed misc/GNUmakefile to properly tag on stable-1.2 branch.
Maxim Dounin [Mon, 25 Jun 2012 15:41:17 +0000 (15:41 +0000)]
Fixed misc/GNUmakefile to properly tag on stable-1.2 branch.

13 years agoVersion bump.
Maxim Dounin [Mon, 25 Jun 2012 15:40:29 +0000 (15:40 +0000)]
Version bump.

13 years agoRetagged release-1.2.1 properly.
Maxim Dounin [Mon, 25 Jun 2012 15:35:27 +0000 (15:35 +0000)]
Retagged release-1.2.1 properly.

13 years agonginx-1.2.1-RELEASE
Maxim Dounin [Tue, 5 Jun 2012 14:01:45 +0000 (14:01 +0000)]
nginx-1.2.1-RELEASE