Commit graph

3881 commits

Author SHA1 Message Date
Maxim Dounin
e426504e21 Added (void) as we intentionally ignore returned values.
Requested by Igor Sysoev.
2011-11-28 11:01:42 +00:00
Maxim Dounin
98f8eccefb 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-11-28 10:00:47 +00:00
Valentin Bartenev
291486c4bd Added support for IP-literal in the Host header and request line (ticket #1).
Additional parsing logic added to correctly handle RFC 3986 compliant IPv6 and
IPvFuture characters enclosed in square brackets.

The host validation was completely rewritten. The behavior for non IP literals
was changed in a more proper and safer way:

 - Host part is now delimited either by the first colon or by the end of string
   if there's no colon. Previously the last colon was used as delimiter which
   allowed substitution of a port number in the $host variable.
   (e.g. Host: 127.0.0.1:9000:80)

 - Fixed stripping of the ending dot in the Host header when the host was also
   followed by a port number.
   (e.g. Host: nginx.com.:80)

 - Fixed upper case characters detection. Previously it was broken which led to
   wasting memory and CPU.
2011-11-28 09:15:33 +00:00
Maxim Dounin
eaf1314ae3 Added escaping of double quotes in ngx_escape_html().
Patch by Zaur Abasmirzoev.
2011-11-25 16:36:02 +00:00
Maxim Dounin
9e3c5c1792 Unlock of shared memory zones on process crash.
If process exited abnormally while holding lock on some shared memory zone -
unlock it.  It may be not safe thing to do (as crash with lock held may
result in corrupted shared memory structure, and other processes will
subsequently crash while trying to access shared data), therefore complain
loudly if unlock succeeds.
2011-11-23 14:09:19 +00:00
Maxim Dounin
49e9547747 Fixed build without atomic operations. 2011-11-23 14:07:06 +00:00
Maxim Dounin
9d2d3aee6d Added shmtx interface to forcibly unlock mutexes.
It is currently used from master process on abnormal worker termination to
unlock accept mutex (unlocking of accept mutex was broken in 1.0.2).  It is
expected to be used in the future to unlock other mutexes as well.

Shared mutex code was rewritten to make this possible in a safe way, i.e.
with a check if lock was actually held by the exited process.  We again use
pid to lock mutex, and use separate atomic variable for a count of processes
waiting in sem_wait().
2011-11-23 13:55:38 +00:00
Ruslan Ermilov
38d6a346d7 Fixed "rotate" to always work when combined with "resize/crop". 2011-11-23 10:22:44 +00:00
Ruslan Ermilov
18b7122d6e Cosmetics. 2011-11-23 10:16:30 +00:00
Igor Sysoev
1da4d8e81c Fix of mp4 module seeking. 2011-11-23 07:22:15 +00:00
Maxim Dounin
259b961e7b 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.

Patch by Yichun Zhang (agentzh).
2011-11-22 17:02:21 +00:00
Maxim Dounin
0d5cf1a261 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-11-22 16:27:45 +00:00
Ruslan Ermilov
f00f3dc803 Made it possible to build/install from the SVN checkout. 2011-11-22 13:26:44 +00:00
Maxim Konovalov
80c62b4aa2 o AIX 7 defines sys_nerr in errno.h, therefore <errno.h> included
in the sys_nerr test.

o 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.[*]

* patch from Maxim Dounin

This commit makes possible to build nginx on AIX 7.1.
2011-11-21 11:51:41 +00:00
Maxim Konovalov
16825c7e67 svgz extension for compressed SVG added (close #56). 2011-11-21 09:20:50 +00:00
Ruslan Ermilov
addbd0bf05 Fixed "keepalive_disable".
Patch by Alexander Usov.  The bug has been introduced in r4267.
2011-11-21 07:31:59 +00:00
Maxim Konovalov
e410e4693d FreeBSD 10-current has recently gotten POSIX_FADV_* macros.
A fix for the broken build applied.

Patch from Igor Sysoev.
2011-11-18 18:42:00 +00:00
Maxim Dounin
87648fe191 Upstream: don't cache unfinished responses.
Check if received data length match Content-Length header (if present),
don't cache response if no match found.  This prevents caching of corrupted
response in case of premature connection close by upstream.
2011-11-18 15:09:08 +00:00
Maxim Dounin
cf17f65fb6 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-11-18 14:41:01 +00:00
Ruslan Ermilov
c884156af0 Silenced a warning for some compilers. 2011-11-16 13:27:33 +00:00
Ruslan Ermilov
60b802dc38 Now nginx uses TTL of a DNS response when calculating cache validity.
Previously it used a hardcoded value of 300 seconds.  Also added the
"valid=" parameter to the "resolver" directive that can be used to
override the cache validity time.

Patch by Kirill A. Korinskiy with minor changes.
2011-11-16 13:11:39 +00:00
Valentin Bartenev
a19dfffc8f Fixed incorrect counting the length of headers in a SCGI request. 2011-11-16 12:51:27 +00:00
Maxim Dounin
758a031e89 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-11-15 20:35:41 +00:00
Maxim Dounin
3bf70b5143 Version bump. 2011-11-15 20:33:37 +00:00
Igor Sysoev
eea444b4b1 release-1.1.8 tag 2011-11-14 15:38:02 +00:00
Igor Sysoev
e5b23d4bb6 nginx-1.1.8-RELEASE 2011-11-14 15:37:54 +00:00
Igor Sysoev
bef9d24ee8 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-11-14 14:59:00 +00:00
Igor Sysoev
e477a6d9d8 Fix of "Content-Length" header of MP4 response if start argument was used.
Patch by Piotr Sikora.
2011-11-14 14:42:48 +00:00
Valentin Bartenev
f66679d7fd Added image/webp and video/webm MIME types. 2011-11-14 14:16:51 +00:00
Valentin Bartenev
86fc57edd5 Renamed ngx_http_limit_zone_module to ngx_http_limit_conn_module. 2011-11-14 14:04:42 +00:00
Maxim Dounin
2c5c9e0c24 Reverted incorrect change in internal md5 (part of r3928). 2011-11-14 13:38:02 +00:00
Maxim Dounin
a60f482c6b 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-11-14 13:26:18 +00:00
Maxim Dounin
f5cb08dc33 Separate functions to merge fastcgi/scgi/uwsgi params.
No functional changes.
2011-11-14 13:24:43 +00:00
Maxim Dounin
9209769d83 Fixed Upgrade header clearing with proxy_cache.
This was missed in proxy HTTP/1.1 support commit (r4127).
2011-11-14 13:21:10 +00:00
Maxim Dounin
ab5978088b Fixed proxy_set_header inheritance with proxy_set_body. 2011-11-14 13:19:56 +00:00
Maxim Dounin
6f4903c804 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.
2011-11-14 13:18:15 +00:00
Sergey Budnevitch
e0ce48cd7d Fixed NGX_CONF_TAKE1/NGX_CONF_FLAG misuse. 2011-11-14 09:12:15 +00:00
Valentin Bartenev
49c77d2423 Limit zone: added the "limit_conn_zone" directive.
It supersedes old "limit_zone" directive (deprecated accordingly) and uses
syntax consistent with the "limit_req_zone" directive.
2011-11-10 16:25:08 +00:00
Valentin Bartenev
1e127d5be1 Limit zone: support for multiple "limit_conn" limits. 2011-11-10 16:08:13 +00:00
Valentin Bartenev
99b82c698d Limit zone: rbtree lookup moved to a separate function.
No functional changes.
2011-11-10 15:51:55 +00:00
Ruslan Ermilov
5518d9bceb Changed error message to be more appropriate in the imaginary
"open_file_cache max=0" case.
2011-11-10 09:13:09 +00:00
Ruslan Ermilov
f9ce97f300 Belatedly fixed language in 1.1.7 relnotes. 2011-11-09 14:50:33 +00:00
Igor Sysoev
6cc6ee5f71 Fixed compression pointer processing in DNS response greater than 255 bytes.
Thanks to Ben Hawkes.
2011-11-09 13:54:07 +00:00
Igor Sysoev
a1f95cd5d6 Fix of "keepalive_disable" directive. 2011-11-08 13:48:23 +00:00
Igor Sysoev
2263971f60 The "image_filter_sharpen" directive. 2011-11-08 13:17:14 +00:00
Igor Sysoev
f62aef5432 Ancient incomplete ngx_http_status_module removal. 2011-11-01 15:16:28 +00:00
Igor Sysoev
c334837744 Version bump. 2011-11-01 15:10:46 +00:00
Igor Sysoev
2c7edf2692 release-1.1.7 tag 2011-10-31 14:52:53 +00:00
Igor Sysoev
badc4dc2da nginx-1.1.7-RELEASE 2011-10-31 14:52:46 +00:00
Igor Sysoev
aac006c475 Silently ignoring a stale global SSL error left after disabled renegotiation. 2011-10-31 14:30:03 +00:00