Commit graph

3649 commits

Author SHA1 Message Date
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
Maxim Dounin
e646c6a946 Merge of r4306, r4320:
Protection from stale write events in epoll.

Stale write event may happen if epoll_wait() reported both read and write
events, and processing of the read event closed descriptor.
2012-02-04 23:18:12 +00:00
Maxim Dounin
b720407a89 Merge of r4326:
Fix for read_head with try_files and open_file_cache.

The of.read_ahead wasn't set in try_files code path, causing read_ahead
directive to be a nop if try_files and open_file_cache were used.
2012-02-04 22:30:30 +00:00
Maxim Dounin
65d3ae1715 Version bump. 2012-02-04 22:23:12 +00:00
Maxim Dounin
4b939cd7ab release-1.0.11 tag 2011-12-15 14:05:08 +00:00
Maxim Dounin
9d942148aa nginx-1.0.11-RELEASE 2011-12-15 14:04:39 +00:00
Maxim Dounin
5d8dd8a6bd Merge of r4315:
Allowed add_header for proxied 206 replies.

It was working for nginx's own 206 replies as they are seen as 200 in the
headers filter module (range filter goes later in the headers filter chain),
but not for proxied replies.
2011-12-14 18:06:21 +00:00
Maxim Dounin
1020536663 Merge of r4313:
Added escaping of double quotes in ngx_escape_html().

Patch by Zaur Abasmirzoev.
2011-12-14 18:04:06 +00:00
Maxim Dounin
e415ec3b99 Merge of r4307:
Fix of mp4 module seeking.
2011-12-14 18:02:37 +00:00
Maxim Dounin
344cb11f29 Merge of r4305:
Fixed segfault on ssl servers without cert with SNI (ticket #54).

Non-default servers may not have ssl context created if there are no
certificate defined.  Make sure to check if ssl context present before
using it.
2011-12-14 18:00:50 +00:00
Maxim Dounin
47463035c8 Merge of r4298:
Fixed flv header to match specification.

Used "\x5" in 5th byte to claim presence of both audio and video.  Used
previous tag size 0 in the beginning of the flv body (bytes 10 .. 13) as
required by specification (see http://www.adobe.com/devnet/f4v.html).

Patch by Piotr Sikora.
2011-12-14 15:30:02 +00:00
Maxim Dounin
430aef49ac Merge of r4295:
Fixed incorrect counting the length of headers in a SCGI request.
2011-12-14 15:28:13 +00:00
Maxim Dounin
408c331545 Merge of r4294:
Fixed handling of SIGWINCH/NOACCEPT signal.

After first upgrade it was ignored since r4020 (1.1.1, 1.0.9) as
ngx_daemonized wasn't set.
2011-12-14 15:25:32 +00:00
Maxim Dounin
e44e248c23 Merge of r4284:
Introduction of simple ngx_write_stderr() instead of ngx_log_stderr()
for output of ./configure options, etc., since ngx_log_stderr() output
length is limited by 2048 characters defined as NGX_MAX_ERROR_STR.
2011-12-14 15:23:23 +00:00
Maxim Dounin
214dfd3e22 Merge of r4282, r4302:
Added image/webp and video/webm MIME types.  Added svgz extension for
compressed SVG.
2011-12-14 15:16:05 +00:00
Maxim Dounin
7377d07c39 Merge of r4275, r4276, r4278, r4279:
Fixes for proxy_set_header, fastcgi/scgi/uwsgi_param inheritance:

*) Fixed proxy_set_header inheritance with proxy_cache (ticket #45).

   Headers cleared with cache enabled (If-Modified-Since etc.) might be
   cleared in unrelated servers/locations without proxy_cache enabled
   if proxy_cache was used in some server/location.

   Example config which triggered the problem:

       proxy_set_header X-Test "test";
       server { location /1 { proxy_cache name; proxy_pass ... } }
       server { location /2 { proxy_pass ... } }

   Another one:

       server {
           proxy_cache name;
           location /1 { proxy_pass ... }
           location /2 { proxy_cache off; proxy_pass ... }
       }

   In both cases If-Modified-Since header wasn't sent to backend in
   location /2.

   Fix is to not modify conf->headers_source, but instead merge user-supplied
   headers from conf->headers_source and default headers (either cache or not)
   into separate headers_merged array.

*) Fixed proxy_set_header inheritance with proxy_set_body.

*) Separate functions to merge fastcgi/scgi/uwsgi params.
   No functional changes.

*) Fixed fastcgi/scgi/uwsgi_param inheritance.  The following problems were
   fixed:

   1. Directive fastcgi_cache affected headers sent to backends in unrelated
      servers / locations (see ticket #45).

   2. If-Unmodified-Since, If-Match and If-Range headers were sent to
      backends if fastcgi_cache was used.

   3. Cache-related headers were sent to backends if there were no
      fastcgi_param directives and fastcgi_cache was used at server level.
2011-12-14 15:13:25 +00:00
Maxim Dounin
aa96ac67fc Merge of r4270, r4274:
Minor cleanup:

*) Changed error message to be more appropriate in the imaginary
   "open_file_cache max=0" case.

*) Fixed NGX_CONF_TAKE1/NGX_CONF_FLAG misuse.
2011-12-14 14:31:55 +00:00
Maxim Dounin
b527aea8d1 Merge of r4267, r4301:
Fix of the "keepalive_disable" directive.
2011-12-14 13:40:25 +00:00
Maxim Dounin
5bb71a40b9 Merge of r4266, r4308, r4309:
Image filter changes:

*) The "image_filter_sharpen" directive.

*) Cosmetics.

*) Fixed "rotate" to always work when combined with "resize/crop".
2011-12-14 13:37:53 +00:00
Maxim Dounin
0c9e5e185e Merge of r4231, r4300, r4303, r4304:
Configure/build changes and fixes:

*) Revamped "configure --help" text.

*) FreeBSD 10-current has recently gotten POSIX_FADV_* macros.
   A fix for the broken build applied.

*) AIX 7 defines sys_nerr in errno.h, therefore <errno.h> included
   in the sys_nerr test.

   When sys_nerr and _sys_nerr are missed on a particular platform
   and our euristic for a maximum errno detection applied always
   print the maximum errno number we reached instead of printing void.

   This makes possible to build nginx on AIX 7.1.

*) Made it possible to build/install from the SVN checkout.
2011-12-14 13:34:16 +00:00
Maxim Dounin
6692bd213c Merge of r4227, r4228:
Fixed range checking for the "somaxconn" sysctl.  Fixed port range checking.
2011-12-14 13:06:45 +00:00
Maxim Dounin
ed89c54f99 Merge of r4223:
FreeBSD's MALLOC_OPTIONS must be set before any malloc() call.
The bug has been introduced in r3799.
2011-12-13 19:01:10 +00:00
Maxim Dounin
b993b9ded7 Merge of r4221, r4222:
Fixed unix ngx_write_chain_to_file() to return total bytes written.

Previously result of last iteration's writev() was returned.  This was
unnoticed as return value was only used if chain contained only one or
two buffers.
2011-12-13 18:59:18 +00:00
Maxim Dounin
3a8f4c1141 Merge of r4217, r4218:
Fixed "expires @00h".  Fixed "expires @time" with unknown last modified
time (ticket #32).
2011-12-13 18:46:07 +00:00
Maxim Dounin
80824feaff Merge of r4153:
Better handling of late upstream creation.

Configuration with duplicate upstream blocks defined after first use, i.e.
like

    server {
        ...
        location / {
            proxy_pass http://backend;
        }
    }

    upstream backend { ... }
    upstream backend { ... }

now correctly results in "duplicate upstream" error.

Additionally, upstream blocks defined after first use now handle various
server directive parameters ("weight", "max_fails", etc.).  Previously
configuration like

    server {
        ...
        location / {
            proxy_pass http://backend;
        }
    }

    upstream backend {
        server 127.0.0.1 max_fails=5;
    }

incorrectly resulted in "invalid parameter "max_fails=5"" error.
2011-12-13 18:34:34 +00:00
Maxim Dounin
5d45af698c Merge of r4144:
Upstream: clearing of u->peer.connection on close.

This fixes crashes observed with some 3rd party balancer modules.  Standard
balancer modules (round-robin and ip hash) explicitly set pc->connection
(aka u->peer.connection) to NULL and aren't affected.
2011-12-13 18:30:15 +00:00
Maxim Dounin
86e4445d8a Merge of r4001, r4002, r4008:
Manpage changes:

*) Support link.

*) Commented out reference to non-existing nginx.conf(5).

*) Rebuild manpage only if needed.
2011-12-13 18:07:52 +00:00
Maxim Dounin
33a77285e5 Merge of r4000, r4014, r4265, r4321, r4342, r4343:
Infrastructure changes:

*) Don't ignore xmllint errors.

*) Added missing dependencies for the CHANGES{,ru} targets.
   Pass string params to xsltproc.

*) Ancient incomplete ngx_http_status_module removal.

*) Compute the repository root from the checkout.

*) Fixed RELEASE target to correctly call "release" one.
2011-12-13 17:58:18 +00:00
Maxim Dounin
a0a8663eae Version bump. 2011-12-13 16:59:41 +00:00
Igor Sysoev
a407664a1b release-1.0.10 tag 2011-11-15 08:24:10 +00:00
Igor Sysoev
b4082d0c75 nginx-1.0.10-RELEASE 2011-11-15 08:24:03 +00:00
Igor Sysoev
6883ab13b4 Merge of r4283:
Fix of "Content-Length" header of MP4 response if start argument was used.

Patch by Piotr Sikora.
2011-11-14 16:14:11 +00:00
Igor Sysoev
9e4f24d33f Merge of r4280:
Reverted incorrect change in internal md5 (part of r3928).
2011-11-14 16:13:15 +00:00
Igor Sysoev
13f1b5adee Merge of r4268:
Fixed compression pointer processing in DNS response greater than 255 bytes.

Thanks to Ben Hawkes.
2011-11-14 16:12:25 +00:00
Igor Sysoev
7067707c4e Version bump. 2011-11-14 15:53:35 +00:00
Igor Sysoev
922b417f45 release-1.0.9 tag 2011-11-01 14:51:26 +00:00