Commit Graph

3684 Commits

Author SHA1 Message Date
Maxim Dounin
9339f628cc release-1.0.15 tag 2012-04-12 13:01:17 +00:00
Maxim Dounin
6350cc9101 nginx-1.0.15-RELEASE 2012-04-12 13:00:53 +00:00
Maxim Dounin
dcdb3ca43b Merge of r4578, r4579, r4580, r4586: mp4 fixes. 2012-04-12 12:55:43 +00:00
Maxim Dounin
faf6380c3c Version bump. 2012-04-12 12:47:36 +00:00
Maxim Dounin
873cb739a7 release-1.0.14 tag 2012-03-15 11:51:16 +00:00
Maxim Dounin
d00d28aaf3 nginx-1.0.14-RELEASE 2012-03-15 11:50:53 +00:00
Maxim Dounin
ec416084d5 Updated OpenSSL and PCRE used for win32 builds. 2012-03-15 11:46:29 +00:00
Maxim Dounin
44eade9c1d Merge of r4530, r4531: null character fixes.
*) Fixed incorrect ngx_cpystrn() usage in ngx_http_*_process_header().

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

   Reported by Matthew Daley.

*) Headers with null character are now rejected.

   Headers with NUL character aren't allowed by HTTP standard and may cause
   various security problems.  They are now unconditionally rejected.
2012-03-15 11:41:43 +00:00
Maxim Dounin
6dbc33f831 Version bump. 2012-03-15 11:37:11 +00:00
Maxim Dounin
84442a5343 release-1.0.13 tag 2012-03-05 15:20:15 +00:00
Maxim Dounin
072a2aa26a nginx-1.0.13-RELEASE 2012-03-05 15:19:49 +00:00
Maxim Dounin
fc03bdde05 Merge of r4500: fixed spelling in single-line comments. 2012-03-05 13:26:40 +00:00
Maxim Dounin
1b6a7864a1 Merge of r4499: workaround for fs_size on ZFS (ticket #46).
ZFS reports incorrect st_blocks until file settles on disk, and this
may take a while (i.e. just after creation of a file the st_blocks value
is incorrect).  As a workaround we now use st_blocks only if
st_blocks * 512 > st_size, this should fix ZFS problems while still
preserving accuracy for other filesystems.

The problem had appeared in r3900 (1.0.1).
2012-03-05 13:20:40 +00:00
Maxim Dounin
0ffc4c3218 Merge of r4498:
Fix of rbtree lookup on hash collisions.

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

Patch by Lanshun Zhou.
2012-03-05 13:17:56 +00:00
Maxim Dounin
2d3fff0c5e Merge of r4497:
Fixed null pointer dereference in resolver (ticket #91).

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

Patch by Roman Arutyunyan.
2012-03-05 13:06:29 +00:00
Maxim Dounin
031458770a Merge of r4491, r4492:
*) Renamed constants and fixed off-by-one error in "msie_padding on"
   handling.

*) Added support for the 307 Temporary Redirect.
2012-03-05 13:03:39 +00:00
Maxim Dounin
01f5961540 Merge of r4474, r4493: configure/build fixes.
*) Fixed build with embedded perl and --with-openssl.

*) Configure: moved icc detection before gcc.  New versions of icc
   confuse auto/cc/name due to introduced handling of a "icc -v".
2012-03-05 12:58:10 +00:00
Maxim Dounin
be909c35b0 Merge of r4473:
Core: protection from cycles with named locations and post_action.

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

1. Post action which recursively triggers post action:

    location / {
        post_action /index.html;
    }

2. Post action pointing to nonexistent named location:

    location / {
        post_action @nonexistent;
    }

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

    location / {
        recursive_error_pages on;
        error_page 500 @nonexistent;
        return 500;
    }
2012-03-05 12:49:32 +00:00
Maxim Dounin
31b3edd003 Merge of r4471:
Variables: honor no_cacheable for not_found variables.

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

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

Also this eliminates unneeded call to ngx_http_get_indexed_variable() in
cacheable case (as it will return cached value anyway).
2012-03-05 12:36:51 +00:00
Maxim Dounin
8f78d3ae63 Merge of r4470:
Fix for proxy_store leaving temporary files for subrequests.

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

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

Fix is to move relevant code into ngx_http_upstream_finalize_request() which
is called in all cases, either directly or via the cleanup handler.
2012-03-05 12:33:06 +00:00
Maxim Dounin
d2ad924d33 Merge of r4468:
Removed r->cache/r->cached dependencies in range filter.  This is
a layering violation, use correct offset calculations instead.
2012-03-05 12:24:18 +00:00
Maxim Dounin
27b9a05b4b Merge of r4461: upstream: fixed "too big header" check.
If header filter postponed processing of a header by returning NGX_AGAIN
and not moved u->buffer->pos, previous check incorrectly assumed there
is additional space and did another recv() with zero-size buffer.  This
resulted in "upstream prematurely closed connection" error instead
of correct "upstream sent too big header" one.

Patch by Feibo Li.
2012-03-05 12:15:02 +00:00
Maxim Dounin
9ec45d5f6f Merge of r4460: ngx_ncpu detection for most *nix platforms.
This inaccurate detection by using sysconf(_SC_NPROCESSORS_ONLN) can improve
usage of the mutex lock optimization on multicore systems.
2012-03-05 12:10:09 +00:00
Maxim Dounin
658587e7d2 Merge of r4423: fixed proxy_redirect off inheritance. 2012-03-05 11:47:25 +00:00
Maxim Dounin
510a0036de Version bump. 2012-03-05 11:36:21 +00:00
Maxim Dounin
95aee69f89 release-1.0.12 tag 2012-02-06 14:09:16 +00:00
Maxim Dounin
4a8d696bd7 nginx-1.0.12-RELEASE 2012-02-06 14:08:59 +00:00
Maxim Dounin
8f8e06a641 Updated libs used for win32 builds. 2012-02-06 11:40:10 +00:00
Maxim Dounin
b39bc1ccbd Merge of r4422:
Fixed error handling in ngx_event_connect_peer().

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

Patch by Piotr Sikora.
2012-02-05 20:06:50 +00:00
Maxim Dounin
f4d00a96ac Merge of r4416:
Fixed AIO error handling on FreeBSD.

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

Additionally, in "aio sendfile" case r->blocked was incremented in case of
error returned from ngx_file_aio_read(), thus causing request hangs.
2012-02-05 20:05:11 +00:00
Maxim Dounin
a22bc749c7 Merge of r4406, r4413: copyrights updated. 2012-02-05 20:02:59 +00:00
Maxim Dounin
915bc54403 Merge of r4405:
Fixed division by zero exception in ngx_hash_init().

The ngx_hash_init() function did not expect call with zero elements count,
which caused FPE error on configs with an empty "types" block in http context
and "types_hash_max_size" > 10000.
2012-02-05 19:27:18 +00:00
Maxim Dounin
a491bd5799 Merge of r4404:
Fixed sched_setaffinity(2) to correctly pass size.

Second argument (cpusetsize) is size in bytes, not in bits.  Previously
used constant 32 resulted in reading of uninitialized memory and caused
EINVAL to be returned on some Linux kernels.
2012-02-05 19:25:24 +00:00
Maxim Dounin
c8d012d425 Merge of r4402:
Fixed proxy_cache_use_stale in "no live upstreams" case.
2012-02-05 19:23:44 +00:00
Maxim Dounin
8bfb37e9f0 Merge of r4401, r4415:
SSL changes:

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

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

*) Removed ENGINE_load_builtin_engines() call.

   It's already called by OPENSSL_config().  Calling it again causes
   some openssl engines (notably GOST) to corrupt memory, as they don't
   expect to be created more than once.
2012-02-05 19:15:09 +00:00
Maxim Dounin
28c968a89b Merge of r4398:
Changed ngx_log_debugN() macros to verify the number of arguments
when built with debugging.
2012-02-05 19:06:52 +00:00
Maxim Dounin
4ce7f78c97 Merge of r4396:
Some questionable optomizations flags for icc were removed
in order to simplify support of its future versions.
2012-02-05 19:05:06 +00:00
Maxim Dounin
d1f88c6530 Merge of r4393: zlib license file include fixed. 2012-02-05 19:03:21 +00:00
Maxim Dounin
21f546d0d6 Merge of r4384, r4385:
Fixes for limit_rate:

*) Fixed throughput problems with large limit_rate.

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

*) Fixed interaction of limit_rate and sendfile_max_chunk.

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

   See here for report (in Russian):
   http://mailman.nginx.org/pipermail/nginx-ru/2010-March/032806.html
2012-02-05 16:12:55 +00:00
Maxim Dounin
ff8c2aedfe Merge of r4383, r4403:
MP4 fixes:

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

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

*) Fixed handling of mp4 above 2G and 32bit offsets (ticket #84).
2012-02-05 15:51:20 +00:00
Maxim Dounin
d7ccc61da1 Merge of r4381, r4400:
Fixed limit_conn_log_level/limit_req_log_level inheritance.  The
directives did not work if there were no limit_conn/limit_req
specified on the same level.

The code for limit_conn is different in 1.0.x, conflict resolved
manually.
2012-02-05 15:47:58 +00:00
Maxim Dounin
6a86b4d662 Merge of r4379: duplicate words removed. 2012-02-05 15:34:20 +00:00
Maxim Dounin
ea7bed29fd Merge of r4375, r4382:
SSI changes:

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

*) Added regex captures support in the expression of the "if" command.
2012-02-05 14:09:46 +00:00
Maxim Dounin
ef76b584da Merge of r4372, r4373, r4374:
SCGI fixes:

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

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

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

*) Removed duplicate function declaration.

*) Removed error if there is no Status header.

   The SCGI specification doesn't specify format of the response, and
   assuming CGI specs should be used there is no reason to complain.
   RFC 3875 explicitly states that "A Status header field is optional,
   and status 200 'OK' is assumed if it is omitted".
2012-02-05 13:53:50 +00:00
Maxim Dounin
6f7a1824b5 Merge of r4339, r4340, r4341:
Cache fixes:

*) Obsolete code removed.

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

*) Handling of cache files with long headers.

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

*) Only complain on long locked entries.

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

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

[1] http://mailman.nginx.org/pipermail/nginx-devel/2011-September/001287.html
2012-02-05 13:34:08 +00:00
Maxim Dounin
cb15836d9a Merge of r4338:
Renamed some constants to improve readability, no functional changes.
2012-02-05 12:46:20 +00:00
Maxim Dounin
e8f02297be Merge r4336:
Microoptimization of sendfile(2) usage under FreeBSD.

FreeBSD kernel checks headers/trailers pointer against NULL, not
corresponding count.  Passing NULL if there are no headers/trailers
helps to avoid unneeded work in kernel, as well as unexpected 0 bytes
GIO in traces.
2012-02-05 12:42:36 +00:00
Maxim Dounin
c68a4cfdc5 Merge of r4335:
Fixed: some of $sent_http_* variables might contain header entries
which actually wasn't sent to a client.

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

Thanks to Yichun Zhang (agentzh).
2012-02-05 12:37:48 +00:00
Maxim Dounin
b134a0cfa9 Merge of r4377: configure on Solaris fixed. 2012-02-05 12:28:35 +00:00
Maxim Dounin
6154497b90 Merge of r4327:
Removed unused function ngx_regex_capture_count().  The function has
been unused since r3326 (0.8.25).
2012-02-04 23:28:10 +00:00