]> git.kaiwu.me - nginx.git/log
nginx.git
13 years agoCapped the status code that may be returned with "return" and "try_files".
Ruslan Ermilov [Wed, 16 May 2012 13:22:03 +0000 (13:22 +0000)]
Capped the status code that may be returned with "return" and "try_files".

13 years agoAdded syntax checking of the second parameter of the "split_clients" directive.
Ruslan Ermilov [Wed, 16 May 2012 13:14:53 +0000 (13:14 +0000)]
Added syntax checking of the second parameter of the "split_clients" directive.

13 years agoVersion bump.
Ruslan Ermilov [Wed, 16 May 2012 13:09:39 +0000 (13:09 +0000)]
Version bump.

14 years agorelease-1.3.0 tag
Maxim Dounin [Tue, 15 May 2012 14:24:09 +0000 (14:24 +0000)]
release-1.3.0 tag

14 years agonginx-1.3.0-RELEASE release-1.3.0
Maxim Dounin [Tue, 15 May 2012 14:23:49 +0000 (14:23 +0000)]
nginx-1.3.0-RELEASE

14 years agoUpdated OpenSSL used for win32 builds.
Maxim Dounin [Tue, 15 May 2012 14:20:06 +0000 (14:20 +0000)]
Updated OpenSSL used for win32 builds.

14 years agoFixed win32 build after changes in r4624.
Ruslan Ermilov [Tue, 15 May 2012 08:10:59 +0000 (08:10 +0000)]
Fixed win32 build after changes in r4624.

14 years agoUpdate c->sent in ngx_ssl_send_chain() even if SSL buffer is not used.
Valentin Bartenev [Mon, 14 May 2012 16:30:33 +0000 (16:30 +0000)]
Update c->sent in ngx_ssl_send_chain() even if SSL buffer is not used.

14 years agoReverted previous attempt to fix complation warning introduced in
Ruslan Ermilov [Mon, 14 May 2012 15:52:37 +0000 (15:52 +0000)]
Reverted previous attempt to fix complation warning introduced in
r4624 and actually fixed it.

14 years agogeoip: trusted proxies support and partial IPv6 support.
Ruslan Ermilov [Mon, 14 May 2012 14:00:17 +0000 (14:00 +0000)]
geoip: trusted proxies support and partial IPv6 support.

The module now supports recursive search of client address through the
chain of trusted proxies (closes #100), in the same scope as the geo
module.  Proxies are listed by the "geoip_proxy" directive, recursive
search is enabled by the "geoip_proxy_recursive" directive.  IPv6 is
partially supported: proxies may be specified with IPv6 addresses.

Example:
    geoip_country .../GeoIP.dat;
    geoip_proxy 127.0.0.1;
    geoip_proxy ::1;
    geoip_proxy 10.0.0.0/8;
    geoip_proxy_recursive on;

14 years agogeo: chains of trusted proxies and partial IPv6 support.
Ruslan Ermilov [Mon, 14 May 2012 13:53:22 +0000 (13:53 +0000)]
geo: chains of trusted proxies and partial IPv6 support.

The module now supports recursive search of client address through
the chain of trusted proxies, controlled by the "proxy_recursive"
directive in the "geo" block.  It also gets partial IPv6 support:
now proxies may be specified with IPv6 addresses.

Example:
    geo $test {
        ...
        proxy 127.0.0.1;
        proxy ::1;
        proxy_recursive;
    }

There's also a slight change in behavior.  When original client
address (as specified by the "geo" directive) is one of the
trusted proxies, and the value of the X-Forwarded-For request
header cannot not be parsed as a valid address, an original client
address will be used for lookup.  Previously, 255.255.255.255 was
used in this case.

14 years agoFixed compilation warning introduced in r4624.
Ruslan Ermilov [Mon, 14 May 2012 13:15:22 +0000 (13:15 +0000)]
Fixed compilation warning introduced in r4624.

14 years agorealip: chains of trusted proxies and IPv6 support.
Ruslan Ermilov [Mon, 14 May 2012 12:41:03 +0000 (12:41 +0000)]
realip: chains of trusted proxies and IPv6 support.

The module now supports recursive search of client address through
the chain of trusted proxies, controlled by the "real_ip_recursive"
directive (closes #2).  It also gets full IPv6 support (closes #44)
and canonical value of the $client_addr variable on address change.

Example:
    real_ip_header X-Forwarded-For;
    set_real_ip_from 127.0.0.0/8;
    set_real_ip_from ::1;
    set_real_ip_from unix:;
    real_ip_recursive on;

14 years agoNew function ngx_http_get_forwarded_addr() to look up real client address.
Ruslan Ermilov [Mon, 14 May 2012 12:27:41 +0000 (12:27 +0000)]
New function ngx_http_get_forwarded_addr() to look up real client address.

On input it takes an original address, string in the X-Forwarded-For format
and its length, list of trusted proxies, and a flag indicating to perform
the recursive search.  On output it returns NGX_OK and the "deepest" valid
address in a chain, or NGX_DECLINED.  It supports AF_INET and AF_INET6.
Additionally, original address and/or proxy may be specified as AF_UNIX.

14 years agoUpstream: fixed ip_hash rebalancing with the "down" flag.
Maxim Dounin [Mon, 14 May 2012 09:58:07 +0000 (09:58 +0000)]
Upstream: fixed ip_hash rebalancing with the "down" flag.

Due to weight being set to 0 for down peers, order of peers after sorting
wasn't the same as without the "down" flag (with down peers at the end),
resulting in client rebalancing for clients on other servers.  The only
rebalancing which should happen after adding "down" to a server is one
for clients on the server.

The problem was introduced in r1377 (which fixed endless loop by setting
weight to 0 for down servers).  The loop is no longer possible with new
smooth algorithm, so preserving original weight is safe.

14 years agoUpstream: smooth weighted round-robin balancing.
Maxim Dounin [Mon, 14 May 2012 09:57:20 +0000 (09:57 +0000)]
Upstream: smooth weighted round-robin balancing.

For edge case weights like { 5, 1, 1 } we now produce { a, a, b, a, c, a, a }
sequence instead of { c, b, a, a, a, a, a } produced previously.

Algorithm is as follows: on each peer selection we increase current_weight
of each eligible peer by its weight, select peer with greatest current_weight
and reduce its current_weight by total number of weight points distributed
among peers.

In case of { 5, 1, 1 } weights this gives the following sequence of
current_weight's:

     a  b  c
     0  0  0  (initial state)

     5  1  1  (a selected)
    -2  1  1

     3  2  2  (a selected)
    -4  2  2

     1  3  3  (b selected)
     1 -4  3

     6 -3  4  (a selected)
    -1 -3  4

     4 -2  5  (c selected)
     4 -2 -2

     9 -1 -1  (a selected)
     2 -1 -1

     7  0  0  (a selected)
     0  0  0

To preserve weight reduction in case of failures the effective_weight
variable was introduced, which usually matches peer's weight, but is
reduced temporarily on peer failures.

This change also fixes loop with backup servers and proxy_next_upstream
http_404 (ticket #47), and skipping alive upstreams in some cases if there
are multiple dead ones (ticket #64).

14 years agoFixed possible request hang with filter finalization.
Maxim Dounin [Mon, 14 May 2012 09:48:05 +0000 (09:48 +0000)]
Fixed possible request hang with filter finalization.

With r->filter_finalize set the ngx_http_finalize_connection() wasn't
called from ngx_http_finalize_request() called with NGX_OK, resulting in
r->main->count not being decremented, thus causing request hang in some
rare situations.

See here for more details:
http://mailman.nginx.org/pipermail/nginx-devel/2012-May/002190.html

Patch by Yichun Zhang (agentzh).

14 years agoResolver: protection from duplicate responses.
Maxim Dounin [Mon, 14 May 2012 09:13:45 +0000 (09:13 +0000)]
Resolver: protection from duplicate responses.

If we already had CNAME in resolver node (i.e. rn->cnlen and rn->u.cname
set), and got additional response with A record, it resulted in rn->cnlen
set and rn->u.cname overwritten by rn->u.addr (or rn->u.addrs), causing
segmentation fault later in ngx_resolver_free_node() on an attempt to free
overwritten rn->u.cname.  The opposite (i.e. CNAME got after A) might cause
similar problems as well.

14 years agoAccept moderation in case of EMFILE/ENFILE.
Maxim Dounin [Fri, 11 May 2012 13:33:06 +0000 (13:33 +0000)]
Accept moderation in case of EMFILE/ENFILE.

In case of EMFILE/ENFILE returned from accept() we disable accept events,
and (in case of no accept mutex used) arm timer to re-enable them later.
With accept mutex we just drop it, and rely on normal accept mutex handling
to re-enable accept events once it's acquired again.

As we now handle errors in question, logging level was changed to "crit"
(instead of "alert" used for unknown errors).

Note: the code might call ngx_enable_accept_events() multiple times if
there are many listen sockets.  The ngx_enable_accept_events() function was
modified to check if connection is already active (via c->read->active) and
skip it then, thus making multiple calls safe.

14 years agoRewrite: fixed escaping and possible segfault (ticket #162).
Maxim Dounin [Fri, 11 May 2012 13:19:22 +0000 (13:19 +0000)]
Rewrite: fixed escaping and possible segfault (ticket #162).

The following code resulted in incorrect escaping of uri and possible
segfault:

    location / {
        rewrite ^(.*) $1?c=$1;
        return 200 "$uri";
    }

If there were arguments in a rewrite's replacement string, and length was
actually calculated (due to duplicate captures as in the example above,
or variables present), the is_args flag was set and incorrectly copied
after length calculation.  This resulted in escaping applied to the uri part
of the replacement, resulting in incorrect escaping.  Additionally, buffer
was allocated without escaping expected, thus this also resulted in buffer
overrun and possible segfault.

14 years agoFastcgi: fixed padding handling on fixed-size records.
Maxim Dounin [Fri, 11 May 2012 13:14:58 +0000 (13:14 +0000)]
Fastcgi: fixed padding handling on fixed-size records.

Padding was incorrectly ignored on end request, empty stdout and stderr
fastcgi records.  This resulted in protocol desynchronization if fastcgi
application used these records with padding for some reason.

Reported by Ilia Vinokurov.

14 years agoAdded r->state reset on fastcgi/scgi/uwsgi request start.
Maxim Dounin [Fri, 11 May 2012 13:09:24 +0000 (13:09 +0000)]
Added r->state reset on fastcgi/scgi/uwsgi request start.

Failing to do so results in problems if 400 or 414 requests are
redirected to fastcgi/scgi/uwsgi upstream, as well as after invalid
headers got from upstream.  This was already fixed for proxy in r3478,
but fastcgi (the only affected protocol at that time) was missed.

Reported by Matthieu Tourne.

14 years agoAdded write event handler reset in ngx_http_named_location().
Maxim Dounin [Fri, 4 May 2012 11:35:22 +0000 (11:35 +0000)]
Added write event handler reset in ngx_http_named_location().

On internal redirects this happens via ngx_http_handler() call, which is
not called on named location redirect.  As a result incorrect write handler
remained (if previously set) and this might cause incorrect behaviour (likely
request hang).

Patch by Yichun Zhang (agentzh).

14 years agodebug_connection: added the IPv6 and UNIX-domain socket support.
Ruslan Ermilov [Sun, 29 Apr 2012 22:02:18 +0000 (22:02 +0000)]
debug_connection: added the IPv6 and UNIX-domain socket support.

14 years agoRemoved surplus condition.
Valentin Bartenev [Fri, 27 Apr 2012 10:48:42 +0000 (10:48 +0000)]
Removed surplus condition.

14 years agoAllows particular modules to handle subrequests properly.
Andrey Belov [Thu, 26 Apr 2012 13:06:27 +0000 (13:06 +0000)]
Allows particular modules to handle subrequests properly.

14 years agoFixed segmentation fault in ngx_resolver_create_name_query().
Ruslan Ermilov [Thu, 26 Apr 2012 12:58:42 +0000 (12:58 +0000)]
Fixed segmentation fault in ngx_resolver_create_name_query().

If name passed for resolution was { 0, NULL } (e.g. as a result
of name server returning CNAME pointing to ".") pointer wrapped
to (void *) -1 resulting in segmentation fault on an attempt to
dereference it.

Reported by Lanshun Zhou.

14 years agoVersion bump.
Maxim Dounin [Thu, 26 Apr 2012 11:20:29 +0000 (11:20 +0000)]
Version bump.

14 years agorelease-1.2.0 tag
Maxim Dounin [Mon, 23 Apr 2012 13:07:07 +0000 (13:07 +0000)]
release-1.2.0 tag

14 years agonginx-1.2.0-RELEASE release-1.2.0
Maxim Dounin [Mon, 23 Apr 2012 13:06:47 +0000 (13:06 +0000)]
nginx-1.2.0-RELEASE

14 years agoVersion bump.
Maxim Dounin [Mon, 23 Apr 2012 12:54:14 +0000 (12:54 +0000)]
Version bump.

14 years agoFix of "%f" format handling.
Igor Sysoev [Mon, 23 Apr 2012 11:11:32 +0000 (11:11 +0000)]
Fix of "%f" format handling.

ngx_sprintf("%.2f", 0.999) incorrectly resulted in "0.100" instead of "1.00".

14 years agoUpdate openssl used for win32 builds.
Maxim Dounin [Mon, 23 Apr 2012 11:05:21 +0000 (11:05 +0000)]
Update openssl used for win32 builds.

14 years agoProxy: added ctx checking to input filters.
Maxim Dounin [Mon, 23 Apr 2012 10:40:01 +0000 (10:40 +0000)]
Proxy: added ctx checking to input filters.

The proxy module context may be NULL in case of filter finalization
(e.g. by image_filter) followed by an internal redirect.  This needs
some better handling, but for now just check if ctx is still here.

14 years agoImage filter: compare aspect ratio more accurately during crop.
Maxim Dounin [Sat, 21 Apr 2012 19:02:21 +0000 (19:02 +0000)]
Image filter: compare aspect ratio more accurately during crop.

Previously used fixed-point calculation caused wrong code path selection
in some cases, resulting in incorrect image size.

See here for report:
http://mailman.nginx.org/pipermail/nginx-devel/2012-April/002123.html

14 years agoFixed segfault with try_files (ticket #152).
Maxim Dounin [Thu, 19 Apr 2012 15:48:03 +0000 (15:48 +0000)]
Fixed segfault with try_files (ticket #152).

The problem occured if first uri in try_files was shorter than request uri,
resulting in reserve being 0 and hence allocation skipped.  The bug was
introduced in r4584 (1.1.19).

14 years agoFixed master exit if there is no events section (ticket #150).
Maxim Dounin [Wed, 18 Apr 2012 14:47:10 +0000 (14:47 +0000)]
Fixed master exit if there is no events section (ticket #150).

Instead of checking if there is events{} section present in configuration
in init_module handler we now do the same in init_conf handler.  This
allows master process to detect incorrect configuration early and
reject it.

14 years agoDon't silently ignore the last line of configuration file that
Ruslan Ermilov [Wed, 18 Apr 2012 13:30:43 +0000 (13:30 +0000)]
Don't silently ignore the last line of configuration file that
consists solely of one unterminated token (inspired by #150).

14 years agoFixed ngx_readv_chain() to honor IOV_MAX (ticket #14).
Maxim Dounin [Tue, 17 Apr 2012 09:13:58 +0000 (09:13 +0000)]
Fixed ngx_readv_chain() to honor IOV_MAX (ticket #14).

Not using full chain passed is ok as consumers are expected to check
event's ready flag to determine if another call is needed, not the
returned size.

14 years agoIOV_MAX handling microoptimization.
Maxim Dounin [Tue, 17 Apr 2012 09:13:15 +0000 (09:13 +0000)]
IOV_MAX handling microoptimization.

We now stop on IOV_MAX iovec entries only if we are going to add new one,
i.e. next buffer can't be coalesced into last iovec.

This also fixes incorrect checks for trailer creation on FreeBSD and
Mac OS X, header.nelts was checked instead of trailer.nelts.

14 years agoFixed loop in ngx_writev_chain() and ngx_solaris_sendfilev_chain().
Maxim Dounin [Tue, 17 Apr 2012 09:10:50 +0000 (09:10 +0000)]
Fixed loop in ngx_writev_chain() and ngx_solaris_sendfilev_chain().

The "complete" flag wasn't cleared on loop iteration start, resulting in
broken behaviour if there were more than IOV_MAX buffers and first
iteration was fully completed (and hence the "complete" flag was set
to 1).

14 years agoFixed log->action after ssl handshake.
Maxim Dounin [Mon, 16 Apr 2012 13:05:20 +0000 (13:05 +0000)]
Fixed log->action after ssl handshake.

14 years agoFixed grammar in error messages.
Ruslan Ermilov [Thu, 12 Apr 2012 19:35:41 +0000 (19:35 +0000)]
Fixed grammar in error messages.

14 years agoVersion bump.
Maxim Dounin [Thu, 12 Apr 2012 16:34:59 +0000 (16:34 +0000)]
Version bump.

14 years agorelease-1.1.19 tag
Maxim Dounin [Thu, 12 Apr 2012 12:43:31 +0000 (12:43 +0000)]
release-1.1.19 tag

14 years agonginx-1.1.19-RELEASE release-1.1.19
Maxim Dounin [Thu, 12 Apr 2012 12:42:46 +0000 (12:42 +0000)]
nginx-1.1.19-RELEASE

14 years agoMp4: sanity checks cleanup.
Maxim Dounin [Thu, 12 Apr 2012 12:18:14 +0000 (12:18 +0000)]
Mp4: sanity checks cleanup.

14 years agoReduced the number of lines of code in ngx_inet_addr().
Ruslan Ermilov [Thu, 12 Apr 2012 10:20:33 +0000 (10:20 +0000)]
Reduced the number of lines of code in ngx_inet_addr().

14 years agoFixed buffer overflow when long URI is processed by "try_files" in
Ruslan Ermilov [Thu, 12 Apr 2012 09:19:14 +0000 (09:19 +0000)]
Fixed buffer overflow when long URI is processed by "try_files" in
regex location with "alias" (fixes ticket #135).

14 years agoImproved readability of the code that produces bitmask from prefix.
Ruslan Ermilov [Wed, 11 Apr 2012 17:18:15 +0000 (17:18 +0000)]
Improved readability of the code that produces bitmask from prefix.
In collaboration with Maxim Dounin.

14 years agoFixed directives inheritance.
Ruslan Ermilov [Wed, 11 Apr 2012 09:56:30 +0000 (09:56 +0000)]
Fixed directives inheritance.

14 years agoAccess module: fixed inheritance of allow/deny ipv6 rules.
Maxim Dounin [Tue, 10 Apr 2012 13:25:53 +0000 (13:25 +0000)]
Access module: fixed inheritance of allow/deny ipv6 rules.

Previous (incorrect) behaviour was to inherit ipv6 rules separately from
ipv4 ones.  Now all rules are either inherited (if there are no rules
defined at current level) or not (if there are any rules defined).

14 years agoFixed debug logging.
Igor Sysoev [Tue, 10 Apr 2012 11:28:59 +0000 (11:28 +0000)]
Fixed debug logging.

14 years agoFixed previous commit.
Igor Sysoev [Tue, 10 Apr 2012 11:27:43 +0000 (11:27 +0000)]
Fixed previous commit.

14 years agoFixed mp4 module seek.
Igor Sysoev [Tue, 10 Apr 2012 11:21:47 +0000 (11:21 +0000)]
Fixed mp4 module seek.

14 years agoFixed signed integer overflows in timer code (ticket #145).
Maxim Dounin [Fri, 6 Apr 2012 23:46:09 +0000 (23:46 +0000)]
Fixed signed integer overflows in timer code (ticket #145).

Integer overflow is undefined behaviour in C and this indeed caused
problems on Solaris/SPARC (at least in some cases).  Fix is to
subtract unsigned integers instead, and then cast result to a signed
one, which is implementation-defined behaviour and used to work.

Strictly speaking, we should compare (unsigned) result with the maximum
value of the corresponding signed integer type instead, this will be
defined behaviour.  This will require much more changes though, and
considered to be overkill for now.

14 years agoComment fixed.
Andrey Belov [Thu, 5 Apr 2012 19:49:34 +0000 (19:49 +0000)]
Comment fixed.

14 years agoStyle: the function type should be on a line by itself
Maxim Konovalov [Thu, 5 Apr 2012 15:32:43 +0000 (15:32 +0000)]
Style: the function type should be on a line by itself
preceding the function.  No functional changes.

14 years agoIn ngx_ptocidr(), check that the supplied prefix length is within
Ruslan Ermilov [Tue, 3 Apr 2012 08:22:00 +0000 (08:22 +0000)]
In ngx_ptocidr(), check that the supplied prefix length is within
the allowed range.

14 years agoFixed spelling in multiline C comments.
Ruslan Ermilov [Tue, 3 Apr 2012 07:37:31 +0000 (07:37 +0000)]
Fixed spelling in multiline C comments.

14 years agoWin32: improved ngx_mutex_init() stub (ticket #138).
Maxim Dounin [Mon, 2 Apr 2012 21:31:45 +0000 (21:31 +0000)]
Win32: improved ngx_mutex_init() stub (ticket #138).

This allows to run nginx with "master_process off" under Windows.

14 years agoWin32: fixed memory allocation for shmem name (ticket #134).
Maxim Dounin [Mon, 2 Apr 2012 21:30:58 +0000 (21:30 +0000)]
Win32: fixed memory allocation for shmem name (ticket #134).

14 years agoUpstream: reject upstreams without normal servers.
Maxim Dounin [Mon, 2 Apr 2012 21:29:35 +0000 (21:29 +0000)]
Upstream: reject upstreams without normal servers.

Such upstreams cause CPU hog later in the code as number of peers isn't
expected to be 0.  Currently this may happen either if there are only backup
servers defined in an upstream block, or if server with ipv6 address used
in an upstream block.

14 years agoVersion bump.
Maxim Dounin [Mon, 2 Apr 2012 21:28:31 +0000 (21:28 +0000)]
Version bump.

14 years agoCorrected spelling of error message (ticket #136).
Ruslan Ermilov [Thu, 29 Mar 2012 19:47:27 +0000 (19:47 +0000)]
Corrected spelling of error message (ticket #136).

14 years agorelease-1.1.18 tag
Maxim Dounin [Wed, 28 Mar 2012 13:29:55 +0000 (13:29 +0000)]
release-1.1.18 tag

14 years agonginx-1.1.18-RELEASE release-1.1.18
Maxim Dounin [Wed, 28 Mar 2012 13:29:29 +0000 (13:29 +0000)]
nginx-1.1.18-RELEASE

14 years agoFixed win32 build after realpath changes in r4559.
Maxim Dounin [Wed, 28 Mar 2012 13:04:39 +0000 (13:04 +0000)]
Fixed win32 build after realpath changes in r4559.

14 years agoConfigure: fixed msghdr.msg_control test on 64bit platforms.
Maxim Dounin [Wed, 28 Mar 2012 12:38:03 +0000 (12:38 +0000)]
Configure: fixed msghdr.msg_control test on 64bit platforms.

Broken by r4560.

14 years agoReplaced ngx_http_realip_from_t with ngx_in_cidr_t.
Ruslan Ermilov [Wed, 28 Mar 2012 09:29:09 +0000 (09:29 +0000)]
Replaced ngx_http_realip_from_t with ngx_in_cidr_t.

14 years agoFixed calculation of range boundaries.
Ruslan Ermilov [Wed, 28 Mar 2012 06:50:23 +0000 (06:50 +0000)]
Fixed calculation of range boundaries.

14 years agoXslt: parser options now set with xmlCtxtUseOptions().
Maxim Dounin [Wed, 28 Mar 2012 01:56:49 +0000 (01:56 +0000)]
Xslt: parser options now set with xmlCtxtUseOptions().

Note that "ctxt->loadsubset = 1" previously used isn't really correct as
ctxt->loadsubset is a bitfield now.  The use of xmlCtxtUseOptions() with
XML_PARSE_DTDLOAD is believed to be a better way to do the same thing.

Patch by Laurence Rowe.

14 years agoFixed more gcc46 warnings in configure tests.
Maxim Dounin [Tue, 27 Mar 2012 16:44:52 +0000 (16:44 +0000)]
Fixed more gcc46 warnings in configure tests.

Steps to reproduce:

./configure --with-cc="gcc46" --with-cc-opt="-Wall -Werror -O2"

14 years agoFixed unconditional MAX_PATH usage (ticket #22).
Maxim Dounin [Tue, 27 Mar 2012 16:42:34 +0000 (16:42 +0000)]
Fixed unconditional MAX_PATH usage (ticket #22).

POSIX doesn't require it to be defined, and Debian GNU/Hurd doesn't define
it.  Note that if there is no MAX_PATH defined we have to use realpath()
with NULL argument and free() the result.

14 years agoAdded explicit include of time.h.
Maxim Dounin [Tue, 27 Mar 2012 16:37:43 +0000 (16:37 +0000)]
Added explicit include of time.h.

Most of the systems have it included due to namespace pollution, but
relying on this is a bad idea.  Explicit include is required for at least
Debian GNU/Hurd.

14 years agoResolver: added missing sanity checking when creating name queries.
Maxim Dounin [Thu, 22 Mar 2012 11:57:18 +0000 (11:57 +0000)]
Resolver: added missing sanity checking when creating name queries.

Found by Veracode.

14 years agoWin32: added missing call to srand().
Maxim Dounin [Thu, 22 Mar 2012 10:45:08 +0000 (10:45 +0000)]
Win32: added missing call to srand().

Found by Veracode.

14 years agoAdded xslt_param and xslt_string_param directives.
Maxim Dounin [Thu, 22 Mar 2012 10:44:00 +0000 (10:44 +0000)]
Added xslt_param and xslt_string_param directives.

Based on patch by Samuel Behan.

14 years agoFixed off-by-one in xslt parameter parsing.
Maxim Dounin [Thu, 22 Mar 2012 10:43:33 +0000 (10:43 +0000)]
Fixed off-by-one in xslt parameter parsing.

The problem was introduced in 0.7.44 (r2589) during conversion to complex
values.  Previously string.len included space for terminating NUL, but
with complex values it doesn't.

14 years agoRestricted keepalive_disable safari to OS X only.
Maxim Dounin [Thu, 22 Mar 2012 10:42:27 +0000 (10:42 +0000)]
Restricted keepalive_disable safari to OS X only.

The problem doesn't affect non-Apple systems for sure, and many pretend
to be Safari now.

Prodded by Piotr Sikora.

14 years agoRemoved safari from keepalive_disable default.
Maxim Dounin [Thu, 22 Mar 2012 10:41:29 +0000 (10:41 +0000)]
Removed safari from keepalive_disable default.

The bug in question is likely already fixed (though unfortunately we have
no information available as Apple's bugtracker isn't open), and the
workaround seems to be too pessimistic for modern versions of Safari
as well as other webkit-based browsers pretending to be Safari.

14 years agoThe addition of $tcpinfo_* variables has broken the build on Linux
Ruslan Ermilov [Wed, 21 Mar 2012 15:35:05 +0000 (15:35 +0000)]
The addition of $tcpinfo_* variables has broken the build on Linux
systems with glibc versions prior to 2.7.  Fixed this by checking
the existence of "struct tcp_info" members during configuration.

14 years agoworker_cpu_affinity: cleaned up Linux implementation, added FreeBSD support.
Ruslan Ermilov [Wed, 21 Mar 2012 13:58:51 +0000 (13:58 +0000)]
worker_cpu_affinity: cleaned up Linux implementation, added FreeBSD support.

14 years agoIf we inserted "Last-Modified" in r->headers_out.headers, don't
Ruslan Ermilov [Wed, 21 Mar 2012 07:35:43 +0000 (07:35 +0000)]
If we inserted "Last-Modified" in r->headers_out.headers, don't
forget to set the r->headers_out.last_modified pointer to it.

14 years agoMinor ngx_http_headers_filter_module.c code cleanup.
Ruslan Ermilov [Wed, 21 Mar 2012 06:19:11 +0000 (06:19 +0000)]
Minor ngx_http_headers_filter_module.c code cleanup.

- Removed "hash" element from ngx_http_header_val_t which was always 1.
- Replaced NGX_HTTP_EXPIRES_* with ngx_http_expires_t enum type.
- Added prototype for ngx_http_add_header()
- Simplified ngx_http_set_last_modified().

14 years agoFor the sake of case/switch code readability, 'fall through'
Maxim Konovalov [Mon, 19 Mar 2012 14:57:29 +0000 (14:57 +0000)]
For the sake of case/switch code readability, 'fall through'
comments added.

14 years agoImplemented $tcpinfo_rtt, $tcpinfo_rttvar, $tcpinfo_snd_cwnd, and
Ruslan Ermilov [Fri, 16 Mar 2012 19:15:33 +0000 (19:15 +0000)]
Implemented $tcpinfo_rtt, $tcpinfo_rttvar, $tcpinfo_snd_cwnd, and
$tcpinfo_rcv_space variables.  Supported on Linux and FreeBSD.

14 years agoSome older OSes (notably FreeBSD 4.x) did not have %zu
Ruslan Ermilov [Fri, 16 Mar 2012 07:33:55 +0000 (07:33 +0000)]
Some older OSes (notably FreeBSD 4.x) did not have %zu
format specifier, so revert to using %d.

14 years agoFixed compilation warnings in configuration C tests.
Ruslan Ermilov [Thu, 15 Mar 2012 20:39:38 +0000 (20:39 +0000)]
Fixed compilation warnings in configuration C tests.

Based on a patch by Piotr Sikora.

14 years agoLocal variable "ngx_http_next_filter" renamed to "ngx_http_next_body_filter"
Ruslan Ermilov [Thu, 15 Mar 2012 20:08:58 +0000 (20:08 +0000)]
Local variable "ngx_http_next_filter" renamed to "ngx_http_next_body_filter"
for consistency with other modules.

14 years agoThe "error_log" directive specified in the "http", "server", and
Ruslan Ermilov [Thu, 15 Mar 2012 20:04:50 +0000 (20:04 +0000)]
The "error_log" directive specified in the "http", "server", and
"location" sections now understands the special "stderr" parameter.
It was already treated specially when specified in the main section.

14 years agoSlight optimization in ngx_http_get_variable_index().
Ruslan Ermilov [Thu, 15 Mar 2012 19:41:35 +0000 (19:41 +0000)]
Slight optimization in ngx_http_get_variable_index().

14 years ago- New variable: $connection_requests.
Ruslan Ermilov [Thu, 15 Mar 2012 19:37:32 +0000 (19:37 +0000)]
- New variable: $connection_requests.
- While here, fixed format specifier for $connection.

14 years agoVersion bump.
Maxim Dounin [Thu, 15 Mar 2012 17:43:54 +0000 (17:43 +0000)]
Version bump.

14 years agorelease-1.1.17 tag
Maxim Dounin [Thu, 15 Mar 2012 11:32:39 +0000 (11:32 +0000)]
release-1.1.17 tag

14 years agonginx-1.1.17-RELEASE release-1.1.17
Maxim Dounin [Thu, 15 Mar 2012 11:32:18 +0000 (11:32 +0000)]
nginx-1.1.17-RELEASE

14 years agoHeaders with null character are now rejected.
Maxim Dounin [Thu, 15 Mar 2012 11:27:57 +0000 (11:27 +0000)]
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.

14 years agoFixed incorrect ngx_cpystrn() usage in ngx_http_*_process_header().
Maxim Dounin [Thu, 15 Mar 2012 11:27:12 +0000 (11:27 +0000)]
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.

14 years agoFixed ssi and perl interaction.
Maxim Dounin [Thu, 15 Mar 2012 11:23:07 +0000 (11:23 +0000)]
Fixed ssi and perl interaction.

Embedded perl module assumes there is a space for terminating NUL character,
make sure to provide it in all situations by allocating one extra byte for
value buffer.  Default ssi_value_length is reduced accordingly to
preserve 256 byte allocations.

While here, fixed another one byte value buffer overrun possible in
ssi_quoted_symbol_state.

Reported by Matthew Daley.

14 years agoUwsgi: merged r->http_version fixes from scgi module.
Maxim Dounin [Thu, 15 Mar 2012 11:21:54 +0000 (11:21 +0000)]
Uwsgi: merged r->http_version fixes from scgi module.

Fixed incorrect use of r->http_version (r4372).  Removed duplicate function
declaration (r4373).  Removed error if there is no Status header (r4374).