Commit Graph

4117 Commits

Author SHA1 Message Date
Maxim Dounin
ce750db233 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.
2012-09-24 18:34:04 +00:00
Maxim Dounin
649cd3b401 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.
2012-09-24 18:30:26 +00:00
Maxim Dounin
bd0a1916dd Version bump. 2012-09-24 18:24:07 +00:00
Maxim Dounin
c925a2afeb release-1.2.3 tag 2012-08-07 12:36:19 +00:00
Maxim Dounin
fe3b78f0d4 nginx-1.2.3-RELEASE 2012-08-07 12:35:56 +00:00
Maxim Dounin
67dbb8b8d0 Merge of r4739: s/ngx_shmtx_destory/ngx_shmtx_destroy/. 2012-08-06 18:09:23 +00:00
Maxim Dounin
567dc0b265 Merge of r4775: updated PCRE used for win32 builds. 2012-08-06 17:38:12 +00:00
Maxim Dounin
6087743fe2 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.
2012-08-06 17:36:30 +00:00
Maxim Dounin
cfef618a6f 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
2012-08-06 17:34:08 +00:00
Maxim Dounin
6145efaef4 Merge of r4769: better diagnostics for directives in wrong context. 2012-08-06 17:31:32 +00:00
Maxim Dounin
5ac59c235d 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.
2012-08-06 17:20:01 +00:00
Maxim Dounin
23778a20c9 Merge of r4765: reduced the number of preprocessor directives. 2012-08-06 17:15:23 +00:00
Maxim Dounin
f3959db1e7 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.
2012-08-06 17:13:20 +00:00
Maxim Dounin
8dd36f4aaf Merge of r4763: added the Clang compiler support.
The -Werror is commented out to not break builds on Linux.
2012-08-06 17:10:35 +00:00
Maxim Dounin
20ce4fcbbf 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.
2012-08-06 17:07:28 +00:00
Maxim Dounin
a24d4d23f7 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.
2012-08-06 17:03:01 +00:00
Maxim Dounin
7ca2e6d24e 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
2012-08-06 16:24:22 +00:00
Maxim Dounin
09c6ff334e Merge of r4757: debugging messages in limit_conn.
Fixed debugging messages to account that limit_zone was renamed to limit_conn.
2012-08-06 16:19:35 +00:00
Maxim Dounin
980a0d60a1 Version bump. 2012-08-06 16:06:36 +00:00
Maxim Dounin
50cb5ca3a5 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.
2012-08-06 16:03:56 +00:00
Maxim Dounin
5f4fbaf71c Merge of r4754: synchronized the license text.
Synchronized the license text with the FreeBSD's bsd-style-copyright.
2012-08-06 15:52:02 +00:00
Maxim Dounin
1c1cccf673 Merge of r4741: fixed "make" used instead of "${MAKE}". 2012-08-06 15:47:15 +00:00
Maxim Dounin
b3f5ddf875 Merge of r4740: fixed $request_length for pipelined requests. 2012-08-06 15:45:44 +00:00
Maxim Dounin
c14faaa687 Merge of r4738: struct flock initialization.
Made sure to initialize the entire "struct flock" allocated on stack.
2012-08-06 15:31:49 +00:00
Maxim Dounin
003a2e0ab9 Merge of r4737: r->uri_changed in a named location fix.
Reset r->uri_changed in a named location (ticket #184).
2012-08-06 15:20:03 +00:00
Maxim Dounin
7886114506 Merge of r4736: typo fixed. 2012-08-06 14:58:36 +00:00
Maxim Dounin
51130c8663 Merge of r4713: map hostnames fix (ticket #182).
The final dot wasn't stripped before looking up in a map of hostnames.
2012-08-06 14:04:06 +00:00
Maxim Dounin
94fdcd5e65 release-1.2.2 tag 2012-07-03 10:48:54 +00:00
Maxim Dounin
fab212dd0a nginx-1.2.2-RELEASE 2012-07-03 10:48:31 +00:00
Maxim Dounin
92486bd9cc 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.
2012-07-02 17:41:52 +00:00
Maxim Dounin
d4ee957632 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.
2012-07-02 17:25:51 +00:00
Maxim Dounin
37cf05e2af 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.
2012-07-02 17:22:31 +00:00
Maxim Dounin
a6633971fb 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
2012-07-02 17:08:26 +00:00
Maxim Dounin
63c3d48168 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().
2012-07-02 16:59:34 +00:00
Maxim Dounin
02f8e0ecd3 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.
2012-07-02 16:56:53 +00:00
Maxim Dounin
c7fcd1e78a 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
2012-07-02 16:53:36 +00:00
Maxim Dounin
7138ca1704 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.
2012-07-02 16:51:02 +00:00
Maxim Dounin
eaf3544e15 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.
2012-07-02 16:41:13 +00:00
Maxim Dounin
bb612f1336 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.
2012-07-02 16:23:14 +00:00
Maxim Dounin
cd8c055e4a Merge of r4671: support for IPv6 literals in proxy_pass and so on. 2012-07-02 16:16:27 +00:00
Maxim Dounin
3a017984d6 Merge of r4653: ngx_inet.c code reduction.
Code reduction (no functional changes).
2012-07-02 16:11:02 +00:00
Maxim Dounin
fb6e7626f6 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.
2012-07-02 15:51:02 +00:00
Maxim Dounin
6d92e76271 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
2012-07-02 15:43:50 +00:00
Maxim Dounin
0b23391686 Merge of r4648, r4649, r4650: memory leak with $geoip_org.
Patch by Denis F. Latypoff (slightly modified).
2012-07-02 15:41:31 +00:00
Maxim Dounin
049447b267 Merge of r4647: xslt reuse.
Fixed the reuse of parsed DTDs and XSLTs.

Patch by Kuramoto Eiji.
2012-07-02 15:39:28 +00:00
Maxim Dounin
ef03533f89 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.
2012-07-02 15:37:49 +00:00
Maxim Dounin
ac12c5f882 Merge of r4644:
Fixed potential null pointer dereference in ngx_resolver_create().
While here, improved error message.
2012-07-02 15:35:22 +00:00
Maxim Dounin
ab2ca17064 Merge of r4643:
Removed historical and now redundant syntax pre-checks in ngx_parse_url().
2012-07-02 15:33:35 +00:00
Maxim Dounin
e5ae5b6890 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.
2012-07-02 14:42:08 +00:00
Maxim Dounin
917e4ab3fb 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.
2012-06-29 17:32:43 +00:00