]> git.kaiwu.me - nginx.git/log
nginx.git
14 years agomalloc() debugging on MacOSX.
Igor Sysoev [Mon, 24 Oct 2011 15:46:48 +0000 (15:46 +0000)]
malloc() debugging on MacOSX.

14 years agoFreeBSD's MALLOC_OPTIONS must be set before any malloc() call.
Igor Sysoev [Mon, 24 Oct 2011 12:59:01 +0000 (12:59 +0000)]
FreeBSD's MALLOC_OPTIONS must be set before any malloc() call.
The bug has been introduced in r3799.

14 years agoFixed another return in unix ngx_write_chain_to_file().
Maxim Dounin [Fri, 21 Oct 2011 11:04:46 +0000 (11:04 +0000)]
Fixed another return in unix ngx_write_chain_to_file().

Previous patch missed special case for one iovec, it needs total bytes
written to be returned as well.

14 years agoFixed unix ngx_write_chain_to_file() to return total bytes written.
Maxim Dounin [Thu, 20 Oct 2011 12:40:26 +0000 (12:40 +0000)]
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.

14 years agoFixing conflict with SDK off_t definition.
Igor Sysoev [Thu, 20 Oct 2011 07:12:45 +0000 (07:12 +0000)]
Fixing conflict with SDK off_t definition.

14 years agoRecent SDKs allow to build IPV6 only for Windows XP or above.
Igor Sysoev [Thu, 20 Oct 2011 07:00:04 +0000 (07:00 +0000)]
Recent SDKs allow to build IPV6 only for Windows XP or above.

14 years agoFixed "expires @time" with unknown last modified time (ticket #32).
Maxim Dounin [Mon, 17 Oct 2011 17:32:08 +0000 (17:32 +0000)]
Fixed "expires @time" with unknown last modified time (ticket #32).

14 years agoFixed "expires @00h".
Maxim Dounin [Mon, 17 Oct 2011 17:30:18 +0000 (17:30 +0000)]
Fixed "expires @00h".

14 years agoRemoval of incomplete draft documentation processing.
Igor Sysoev [Mon, 17 Oct 2011 15:42:12 +0000 (15:42 +0000)]
Removal of incomplete draft documentation processing.

14 years agoVersion bump.
Igor Sysoev [Mon, 17 Oct 2011 15:39:59 +0000 (15:39 +0000)]
Version bump.

14 years agorelease-1.1.6 tag
Igor Sysoev [Mon, 17 Oct 2011 15:10:31 +0000 (15:10 +0000)]
release-1.1.6 tag

14 years agonginx-1.1.6-RELEASE release-1.1.6
Igor Sysoev [Mon, 17 Oct 2011 15:10:23 +0000 (15:10 +0000)]
nginx-1.1.6-RELEASE

14 years agoMoving RELEASE target in more safe place.
Igor Sysoev [Mon, 17 Oct 2011 15:09:34 +0000 (15:09 +0000)]
Moving RELEASE target in more safe place.

14 years agoAdded clearing of modules' contexts in ngx_http_named_location().
Maxim Dounin [Sat, 15 Oct 2011 21:42:03 +0000 (21:42 +0000)]
Added clearing of modules' contexts in ngx_http_named_location().

Patch by Yichun Zhang (agentzh).

14 years agoFixed utf8 decode (ticket #25).
Maxim Dounin [Thu, 13 Oct 2011 13:56:41 +0000 (13:56 +0000)]
Fixed utf8 decode (ticket #25).

Patch by Alexey Kuts.

14 years agoSkipping location rewrite phase for server null location.
Igor Sysoev [Thu, 13 Oct 2011 12:43:22 +0000 (12:43 +0000)]
Skipping location rewrite phase for server null location.

14 years agoBetter recheck of dead upstream servers.
Maxim Dounin [Wed, 12 Oct 2011 14:22:48 +0000 (14:22 +0000)]
Better recheck of dead upstream servers.

Previously nginx used to mark backend again as live as soon as fail_timeout
passes (10s by default) since last failure.  On the other hand, detecting
dead backend takes up to 60s (proxy_connect_timeout) in typical situation
"backend is down and doesn't respond to any packets".  This resulted in
suboptimal behaviour in the above situation (up to 23% of requests were
directed to dead backend with default settings).

More detailed description of the problem may be found here (in Russian):
http://mailman.nginx.org/pipermail/nginx-ru/2011-August/042172.html

Fix is to only allow one request after fail_timeout passes, and
mark backend as "live" only if this request succeeds.

Note that with new code backend will not be marked "live" unless "check"
request is completed, and this may take a while in some specific workloads
(e.g. streaming).  This is believed to be acceptable.

14 years agoClear old Location header (if any) while adding a new one.
Maxim Dounin [Wed, 12 Oct 2011 13:28:03 +0000 (13:28 +0000)]
Clear old Location header (if any) while adding a new one.

This prevents incorrect behaviour when another redirect is issued within
error_page 302 handler.

14 years agoWording fix, "many data" is incorrect.
Maxim Dounin [Wed, 12 Oct 2011 13:24:59 +0000 (13:24 +0000)]
Wording fix, "many data" is incorrect.

Noted by Piotr Sikora.

14 years agoFixed two minor bugs in "types" parsing code.
Ruslan Ermilov [Wed, 12 Oct 2011 09:36:21 +0000 (09:36 +0000)]
Fixed two minor bugs in "types" parsing code.

14 years agoFixed grammar in a comment.
Ruslan Ermilov [Wed, 12 Oct 2011 09:34:53 +0000 (09:34 +0000)]
Fixed grammar in a comment.

14 years agoReplaced magic constants representing default values of some directives
Ruslan Ermilov [Wed, 12 Oct 2011 09:33:43 +0000 (09:33 +0000)]
Replaced magic constants representing default values of some directives
with appropriate #define's.

14 years agoStylistic change in checking the boolean expression.
Ruslan Ermilov [Wed, 12 Oct 2011 09:27:34 +0000 (09:27 +0000)]
Stylistic change in checking the boolean expression.

14 years agoPreallocating exact number of default MIME types entries.
Igor Sysoev [Wed, 12 Oct 2011 09:19:57 +0000 (09:19 +0000)]
Preallocating exact number of default MIME types entries.

14 years agoFixed configuration summary and manpage contents for the special
Ruslan Ermilov [Wed, 12 Oct 2011 09:04:59 +0000 (09:04 +0000)]
Fixed configuration summary and manpage contents for the special
--error-log-path=stderr case.

14 years agoRemoved old warning that suggested to use "server_name_in_redirect off"
Ruslan Ermilov [Wed, 12 Oct 2011 07:20:20 +0000 (07:20 +0000)]
Removed old warning that suggested to use "server_name_in_redirect off"
(now the default) in place of no longer supported "server_name *".

14 years agoAdditional headers for proxy/fastcgi/uwsgi/scgi_ignore_headers.
Maxim Dounin [Tue, 11 Oct 2011 18:10:49 +0000 (18:10 +0000)]
Additional headers for proxy/fastcgi/uwsgi/scgi_ignore_headers.

Now the following headers may be ignored as well: X-Accel-Limit-Rate,
X-Accel-Buffering, X-Accel-Charset.

14 years agoHandling of Content-Encoding set from perl.
Maxim Dounin [Tue, 11 Oct 2011 18:01:38 +0000 (18:01 +0000)]
Handling of Content-Encoding set from perl.

This fixes double gzipping in case of gzip filter being enabled while perl
returns already gzipped response.

14 years agoFix for socket leak with "aio sendfile" and "limit_rate".
Maxim Dounin [Tue, 11 Oct 2011 18:00:23 +0000 (18:00 +0000)]
Fix for socket leak with "aio sendfile" and "limit_rate".

Second aio post happened when timer set by limit_rate expired while we have
aio request in flight, resulting in "second aio post" alert and socket leak.

The patch adds actual protection from aio calls with r->aio already set to
aio sendfile code in ngx_http_copy_filter().  This should fix other cases
as well, e.g. when sending buffered to disk upstream replies while still
talking to upstream.

The ngx_http_writer() is also fixed to handle the above case (though it's
mostly optimization now).

Reported by Oleksandr V. Typlyns'kyi.

14 years agoFix for connection drops with AIO.
Maxim Dounin [Tue, 11 Oct 2011 17:58:51 +0000 (17:58 +0000)]
Fix for connection drops with AIO.

Connections serving content with AIO to fast clients were dropped with
"client timed out" messages after send_timeout from response start.

14 years agoAutoindex: escape html in file names.
Maxim Dounin [Tue, 11 Oct 2011 17:57:41 +0000 (17:57 +0000)]
Autoindex: escape html in file names.

14 years agoAutoindex: escape '?' in file names.
Maxim Dounin [Tue, 11 Oct 2011 17:56:51 +0000 (17:56 +0000)]
Autoindex: escape '?' in file names.

For files with '?' in their names autoindex generated links with '?' not
escaped.  This resulted in effectively truncated links as '?' indicates
query string start.

This is an updated version of the patch originally posted at [1].  It
introduces generic NGX_ESCAPE_URI_COMPONENT which escapes everything but
unreserved characters as per RFC 3986.  This approach also renders unneeded
special colon processing (as colon is percent-encoded now), it's dropped
accordingly.

[1] http://nginx.org/pipermail/nginx-devel/2010-February/000112.html

Reported by Konstantin Leonov.

14 years agoImproved access log escaping to better protect other software.
Maxim Dounin [Tue, 11 Oct 2011 17:54:38 +0000 (17:54 +0000)]
Improved access log escaping to better protect other software.

Some character sets (notably ISO-8859-1) have C1 control characters in
upper half, make sure to escape them.

Reported by Jesus Olmos Gonzalez.

14 years agoFixing directive name in error message if types hash size is not enough.
Igor Sysoev [Tue, 11 Oct 2011 11:11:44 +0000 (11:11 +0000)]
Fixing directive name in error message if types hash size is not enough.

14 years agoFixing mp4 module seeking on 32-bit platforms.
Igor Sysoev [Tue, 11 Oct 2011 10:12:44 +0000 (10:12 +0000)]
Fixing mp4 module seeking on 32-bit platforms.

14 years agoFixed macro name.
Ruslan Ermilov [Mon, 10 Oct 2011 08:38:28 +0000 (08:38 +0000)]
Fixed macro name.

14 years agoThe reference documentation is moving elsewhere.
Ruslan Ermilov [Sun, 9 Oct 2011 06:49:54 +0000 (06:49 +0000)]
The reference documentation is moving elsewhere.

14 years agoReleasing memory of idle SSL connection. This saves about 34K per SSL
Igor Sysoev [Fri, 7 Oct 2011 12:15:20 +0000 (12:15 +0000)]
Releasing memory of idle SSL connection. This saves about 34K per SSL
connection. The SSL_MODE_RELEASE_BUFFERS option is available since
OpenSSL 1.0.0d.

14 years agoDisabling SSL compression. This saves about 300K per SSL connection.
Igor Sysoev [Fri, 7 Oct 2011 10:59:02 +0000 (10:59 +0000)]
Disabling SSL compression. This saves about 300K per SSL connection.
The SSL_OP_NO_COMPRESSION option is available since OpenSSL 1.0.0.

14 years agoVersion bump.
Igor Sysoev [Fri, 7 Oct 2011 10:41:13 +0000 (10:41 +0000)]
Version bump.

14 years agoImproved ngx_parse_time() code readability.
Ruslan Ermilov [Fri, 7 Oct 2011 08:03:16 +0000 (08:03 +0000)]
Improved ngx_parse_time() code readability.

14 years agoTweaked error messages.
Ruslan Ermilov [Fri, 7 Oct 2011 07:57:24 +0000 (07:57 +0000)]
Tweaked error messages.

14 years agoAdding repository path missed in r4179.
Igor Sysoev [Thu, 6 Oct 2011 13:09:00 +0000 (13:09 +0000)]
Adding repository path missed in r4179.

14 years agorelease-1.1.5 tag
Igor Sysoev [Wed, 5 Oct 2011 14:46:09 +0000 (14:46 +0000)]
release-1.1.5 tag

14 years agonginx-1.1.5-RELEASE release-1.1.5
Igor Sysoev [Wed, 5 Oct 2011 14:44:11 +0000 (14:44 +0000)]
nginx-1.1.5-RELEASE

14 years agoAdding RELEASE procedure in GNUmakefile.
Igor Sysoev [Wed, 5 Oct 2011 13:24:32 +0000 (13:24 +0000)]
Adding RELEASE procedure in GNUmakefile.

14 years agoVersion bump.
Igor Sysoev [Wed, 5 Oct 2011 13:13:25 +0000 (13:13 +0000)]
Version bump.

14 years agoFixed cache bypass caching of non-cacheable replies (ticket #21).
Maxim Dounin [Wed, 5 Oct 2011 10:14:21 +0000 (10:14 +0000)]
Fixed cache bypass caching of non-cacheable replies (ticket #21).

If cache was bypassed with proxy_cache_bypass, cache-controlling headers
(Cache-Control, Expires) wasn't considered and response was cached even
if it was actually non-cacheable.

Patch by John Ferlito.

14 years agoAdded uwsgi_buffering and scgi_buffering directives.
Maxim Dounin [Fri, 30 Sep 2011 11:53:27 +0000 (11:53 +0000)]
Added uwsgi_buffering and scgi_buffering directives.

Patch by Peter Smit.

14 years agoUsing strtod() instead of atofp() to support a lot of digits after dot in
Igor Sysoev [Fri, 30 Sep 2011 09:18:28 +0000 (09:18 +0000)]
Using strtod() instead of atofp() to support a lot of digits after dot in
"start" parameter value.

14 years agoFix of building on platforms with 32-bit off_t. (closed #23)
Igor Sysoev [Thu, 29 Sep 2011 15:19:36 +0000 (15:19 +0000)]
Fix of building on platforms with 32-bit off_t. (closed #23)

14 years agoFixed segmentation fault with empty config on Windows.
Maxim Dounin [Tue, 27 Sep 2011 12:07:09 +0000 (12:07 +0000)]
Fixed segmentation fault with empty config on Windows.

See here for report:
http://mailman.nginx.org/pipermail/nginx-ru/2011-September/043288.html

14 years agoFix for "ssl_session_cache builtin" (broken since 1.1.1, r3993).
Maxim Dounin [Tue, 27 Sep 2011 12:06:07 +0000 (12:06 +0000)]
Fix for "ssl_session_cache builtin" (broken since 1.1.1, r3993).

14 years agoBetter handling of late upstream creation.
Maxim Dounin [Tue, 27 Sep 2011 11:18:51 +0000 (11:18 +0000)]
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.

14 years agoCache: fix for sending of stale responses.
Maxim Dounin [Tue, 27 Sep 2011 11:17:11 +0000 (11:17 +0000)]
Cache: fix for sending of stale responses.

For normal cached responses ngx_http_cache_send() sends last buffer and then
request finalized via ngx_http_finalize_request() call, i.e. everything is
ok.

But for stale responses (i.e. when upstream died, but we have something in
cache) the same ngx_http_cache_send() sends last buffer, but then in
ngx_http_upstream_finalize_request() another last buffer is send.  This
causes duplicate final chunk to appear if chunked encoding is used (and
resulting problems with keepalive connections and so on).

Fix this by not sending in ngx_http_upstream_finalize_request()
another last buffer if we know response was from cache.

14 years agoCache: fix for sending of empty responses.
Maxim Dounin [Tue, 27 Sep 2011 11:15:35 +0000 (11:15 +0000)]
Cache: fix for sending of empty responses.

Revert wrong fix for empty responses introduced in 0.8.31 and apply new one,
rewritten to match things done by static module as close as possible.

14 years agoIncorrect special case for "return 204" removed.
Maxim Dounin [Tue, 27 Sep 2011 11:14:02 +0000 (11:14 +0000)]
Incorrect special case for "return 204" removed.

The special case in question leads to replies without body in
configuration like

    location / { error_page 404 /zero; return 404; }
    location /zero { return 204; }

while replies with empty body are expected per protocol specs.

Correct one will look like

    if (status == NGX_HTTP_NO_CONTENT) {

        rc = ngx_http_send_header(r);

        if (rc == NGX_ERROR || r->header_only) {
            return rc;
        }

        return ngx_http_send_special(r, NGX_HTTP_LAST);
    }

though it looks like it's better to drop this special case at all.

14 years agoFix for "return 202" not discarding body.
Maxim Dounin [Tue, 27 Sep 2011 11:13:00 +0000 (11:13 +0000)]
Fix for "return 202" not discarding body.

Big POST (not fully preread) to a

    location / {
        return 202;
    }

resulted in incorrect behaviour due to "return" code path not calling
ngx_http_discard_request_body().  The same applies to all "return" used
with 2xx/3xx codes except 201 and 204, and to all "return ... text" uses.

Fix is to add ngx_http_discard_request_body() call to ngx_http_send_response()
function where it looks appropriate.  Discard body call from emtpy gif module
removed as it's now redundant.

Reported by Pyry Hakulinen, see
http://mailman.nginx.org/pipermail/nginx/2011-August/028503.html

14 years agoFix for double content when return is used in error_page handler.
Maxim Dounin [Tue, 27 Sep 2011 11:11:30 +0000 (11:11 +0000)]
Fix for double content when return is used in error_page handler.

Test case:

   location / {
       error_page 405 /nope;
       return 405;
   }

   location /nope {
       return 200;
   }

This is expected to return 405 with empty body, but in 0.8.42+ will return
builtin 405 error page as well (though not counted in Content-Length, thus
breaking protocol).

Fix is to use status provided by rewrite script execution in case
it's less than NGX_HTTP_BAD_REQUEST even if r->error_status set.  This
check is in line with one in ngx_http_script_return_code().

Note that this patch also changes behaviour for "return 302 ..." and
"rewrite ... redirect" used as error handler.  E.g.

    location / {
        error_page 405 /redirect;
        return 405;
    }

    location /redirect {
        rewrite ^ http://example.com/;
    }

will actually return redirect to "http://example.com/" instead of builtin 405
error page with meaningless Location header.  This looks like correct change
and it's in line with what happens on e.g. directory redirects in error
handlers.

14 years agoFix for incorrect 201 replies from dav module.
Maxim Dounin [Tue, 27 Sep 2011 11:09:55 +0000 (11:09 +0000)]
Fix for incorrect 201 replies from dav module.

Replies with 201 code contain body, and we should clearly indicate it's
empty if it's empty.  Before 0.8.32 chunked was explicitly disabled for
201 replies and as a result empty body was indicated by connection close
(not perfect, but worked).  Since 0.8.32 chunked is enabled, and this
causes incorrect responses from dav module when HTTP/1.1 is used: with
"Transfer-Encoding: chunked" but no chunks at all.

Fix is to actually return empty body in special response handler instead
of abusing r->header_only flag.

See here for initial report:
http://mailman.nginx.org/pipermail/nginx-ru/2010-October/037535.html

14 years agoProxy: logging levels tuned, double logging fixed.
Maxim Dounin [Sun, 25 Sep 2011 20:04:20 +0000 (20:04 +0000)]
Proxy: logging levels tuned, double logging fixed.

14 years agoProxy: whitespaces after chunk size allowed.
Maxim Dounin [Sun, 25 Sep 2011 20:03:27 +0000 (20:03 +0000)]
Proxy: whitespaces after chunk size allowed.

Whitespaces after chunk size seems to be be allowed by the "implied *LWS" rule
and emitted by some servers.

14 years agoUpstream: clearing of u->peer.connection on close.
Maxim Dounin [Sun, 25 Sep 2011 20:00:36 +0000 (20:00 +0000)]
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.

14 years agoFixed error message.
Ruslan Ermilov [Fri, 23 Sep 2011 20:15:27 +0000 (20:15 +0000)]
Fixed error message.

14 years agoFixed markup.
Ruslan Ermilov [Tue, 20 Sep 2011 13:15:41 +0000 (13:15 +0000)]
Fixed markup.

14 years agorelease-1.1.4 tag
Igor Sysoev [Tue, 20 Sep 2011 11:18:32 +0000 (11:18 +0000)]
release-1.1.4 tag

14 years agonginx-1.1.4-RELEASE release-1.1.4
Igor Sysoev [Tue, 20 Sep 2011 11:18:24 +0000 (11:18 +0000)]
nginx-1.1.4-RELEASE

14 years agoFix of separate pool for upstream connections (r4117).
Maxim Dounin [Tue, 20 Sep 2011 10:00:46 +0000 (10:00 +0000)]
Fix of separate pool for upstream connections (r4117).

Pool may not be created if connection was created but rejected in connect()
call.  Make sure to check if it is here before trying to destroy it.

14 years agoFixed loss of chain links in ngx_event_pipe_read_upstream().
Maxim Dounin [Tue, 20 Sep 2011 09:56:35 +0000 (09:56 +0000)]
Fixed loss of chain links in ngx_event_pipe_read_upstream().

14 years agoFixed loss of chain links in fastcgi module.
Maxim Dounin [Tue, 20 Sep 2011 09:56:05 +0000 (09:56 +0000)]
Fixed loss of chain links in fastcgi module.

14 years agoFix of cpu hog in event pipe.
Maxim Dounin [Tue, 20 Sep 2011 09:55:27 +0000 (09:55 +0000)]
Fix of cpu hog in event pipe.

If client closed connection in ngx_event_pipe_write_to_downstream(), buffers
in the "out" chain were lost.  This caused cpu hog if all available buffers
were in the "out" chain.  Fix is to call ngx_chain_update_chains() before
checking return code of output filter to avoid loosing buffers in the "out"
chain.

Note that this situation (all available buffers in the "out" chain) isn't
normal, it should be prevented by busy buffers limit.  Though right now it
may happen with complex protocols like fastcgi.  This should be addressed
separately.

14 years agoThe "worker_aio_requests" directive.
Igor Sysoev [Tue, 20 Sep 2011 07:30:09 +0000 (07:30 +0000)]
The "worker_aio_requests" directive.

The default value is 32 AIO simultaneous requests per worker. Previously
they were hardcoded to 1024, and it was too large, since Linux allocated
them early on io_setup(), but not on request itself. So with default value
of /proc/sys/fs/aio-max-nr equal to 65536 only 64 worker processes could
be run simultaneously. 32 AIO requests are enough for modern disks even if
server runs only 1 worker.

14 years agoReplaced "can not" with "cannot" and "could not" in a bunch of places.
Ruslan Ermilov [Mon, 19 Sep 2011 14:48:29 +0000 (14:48 +0000)]
Replaced "can not" with "cannot" and "could not" in a bunch of places.
Fixed nearby grammar errors.

14 years agoCosmetics: replaced NGX_CONF_TAKE1 to NGX_CONF_FLAG for "sendfile"
Ruslan Ermilov [Mon, 19 Sep 2011 12:41:13 +0000 (12:41 +0000)]
Cosmetics: replaced NGX_CONF_TAKE1 to NGX_CONF_FLAG for "sendfile"
and "chunked_transfer_encoding" directives, to be in line with all
directives taking a boolean argument.  Both flags will ensure that
a directive takes one argument.

14 years agoOverhauled diagnostic messages.
Ruslan Ermilov [Mon, 19 Sep 2011 12:37:22 +0000 (12:37 +0000)]
Overhauled diagnostic messages.

14 years agoFixing Linux AIO initiatialization: AIO operations are disabled if kernel
Igor Sysoev [Fri, 16 Sep 2011 13:41:52 +0000 (13:41 +0000)]
Fixing Linux AIO initiatialization: AIO operations are disabled if kernel
does not support them.  Previously worker just exited.

14 years agoFixing Linux AIO syscalls return value handling:
Igor Sysoev [Fri, 16 Sep 2011 12:43:16 +0000 (12:43 +0000)]
Fixing Linux AIO syscalls return value handling:
syscall(2) uses usual libc convention, it returns -1 on error and
sets errno. Obsolete _syscall(2) returns negative value of error.

Thanks to Hagai Avrahami.

14 years agoTrailing space fix.
Maxim Dounin [Fri, 16 Sep 2011 12:08:52 +0000 (12:08 +0000)]
Trailing space fix.

14 years agoUpstream keepalive module.
Maxim Dounin [Thu, 15 Sep 2011 19:28:18 +0000 (19:28 +0000)]
Upstream keepalive module.

14 years agoProxy: basic HTTP/1.1 support (including keepalive).
Maxim Dounin [Thu, 15 Sep 2011 19:23:20 +0000 (19:23 +0000)]
Proxy: basic HTTP/1.1 support (including keepalive).

By default we still send requests using HTTP/1.0.  This may be changed with
new proxy_http_version directive.

14 years agoProtocol version parsing in ngx_http_parse_status_line().
Maxim Dounin [Thu, 15 Sep 2011 19:22:35 +0000 (19:22 +0000)]
Protocol version parsing in ngx_http_parse_status_line().

Once we know protocol version, set u->headers_in.connection_close to indicate
implicitly assumed connection close with HTTP before 1.1.

14 years agoUpstream: Connection header processing.
Maxim Dounin [Thu, 15 Sep 2011 19:21:19 +0000 (19:21 +0000)]
Upstream: Connection header processing.

14 years agoUpstream: Transfer-Encoding header processing.
Maxim Dounin [Thu, 15 Sep 2011 19:20:08 +0000 (19:20 +0000)]
Upstream: Transfer-Encoding header processing.

14 years agoKeepalive support in fastcgi.
Maxim Dounin [Thu, 15 Sep 2011 19:05:23 +0000 (19:05 +0000)]
Keepalive support in fastcgi.

By default follow the old behaviour, i.e. FASTCGI_KEEP_CONN flag isn't set
in request and application is responsible for closing connection once request
is done.  To keep connections alive fastcgi_keep_conn must be activated.

14 years agoKeepalive support in memcached.
Maxim Dounin [Thu, 15 Sep 2011 19:04:25 +0000 (19:04 +0000)]
Keepalive support in memcached.

14 years agoUpstream: keepalive flag.
Maxim Dounin [Thu, 15 Sep 2011 19:03:15 +0000 (19:03 +0000)]
Upstream: keepalive flag.

This patch introduces r->upstream->keepalive flag, which is set by protocol
handlers if connection to upstream is in good state and can be kept alive.

14 years agoUpstream: pipe length and input_filter_init in buffered mode.
Maxim Dounin [Thu, 15 Sep 2011 19:00:47 +0000 (19:00 +0000)]
Upstream: pipe length and input_filter_init in buffered mode.

As long as ngx_event_pipe() has more data read from upstream than specified
in p->length it's passed to input filter even if buffer isn't yet full.  This
allows to process data with known length without relying on connection close
to signal data end.

By default p->length is set to -1 in upstream module, i.e. end of data is
indicated by connection close.  To set it from per-protocol handlers upstream
input_filter_init() now called in buffered mode (as well as in
unbuffered mode).

14 years agoUpstream: r->upstream->length type change to off_t.
Maxim Dounin [Thu, 15 Sep 2011 18:43:19 +0000 (18:43 +0000)]
Upstream: r->upstream->length type change to off_t.

Previous use of size_t may cause wierd effects on 32bit platforms with certain
big responses transferred in unbuffered mode.

Nuke "if (size > u->length)" check as it's not usefull anyway (preread
body data isn't subject to this check) and now requires additional check
for u->length being positive.

14 years agoUpstream: content_length_n API change.
Maxim Dounin [Thu, 15 Sep 2011 18:33:43 +0000 (18:33 +0000)]
Upstream: content_length_n API change.

We no longer use r->headers_out.content_length_n as a primary source of
backend's response length.  Instead we parse response length to
u->headers_in.content_length_n and copy to r->headers_out.content_length_n
when needed.

14 years agoUpstream: separate pool for peer connections.
Maxim Dounin [Thu, 15 Sep 2011 18:21:24 +0000 (18:21 +0000)]
Upstream: separate pool for peer connections.

This is required to support persistent https connections as various ssl
structures are allocated from connection's pool.

14 years agoWorkaround for cpu hog on errors with cached connections.
Maxim Dounin [Thu, 15 Sep 2011 18:12:58 +0000 (18:12 +0000)]
Workaround for cpu hog on errors with cached connections.

Just doing another connect isn't safe as peer.get() may expect peer.tries
to be strictly positive (this is the case e.g. with round robin with multiple
upstream servers).  Increment peer.tries to at least avoid cpu hog in
round robin balancer (with the patch alert will be seen instead).

This is not enough to fully address the problem though, hence TODO.  We
should be able to inform balancer that the error wasn't considered fatal
and it may make sense to retry the same peer.

14 years agoAPI change: ngx_chain_update_chains() now requires pool.
Maxim Dounin [Thu, 15 Sep 2011 16:03:17 +0000 (16:03 +0000)]
API change: ngx_chain_update_chains() now requires pool.

The ngx_chain_update_chains() needs pool to free chain links used for buffers
with non-matching tags.  Providing one helps to reduce memory consumption
for long-lived requests.

14 years agoBuffers reuse in chunked filter.
Maxim Dounin [Thu, 15 Sep 2011 15:25:42 +0000 (15:25 +0000)]
Buffers reuse in chunked filter.

There were 2 buffers allocated on each buffer chain sent through chunked
filter (one buffer for chunk size, another one for trailing CRLF, about
120 bytes in total on 32-bit platforms).  This resulted in large memory
consumption with long-lived requests sending many buffer chains.  Usual
example of problematic scenario is streaming though proxy with
proxy_buffering set to off.

Introduced buffers reuse reduces memory consumption in the above problematic
scenario.

See here for initial report:
http://mailman.nginx.org/pipermail/nginx/2010-April/019814.html

14 years agoMP4 co64 atom support added.
Igor Sysoev [Thu, 15 Sep 2011 13:23:03 +0000 (13:23 +0000)]
MP4 co64 atom support added.

14 years agoRegenerated after previous commit.
Ruslan Ermilov [Thu, 15 Sep 2011 08:59:38 +0000 (08:59 +0000)]
Regenerated after previous commit.

14 years agoAdded ngx_http_mp4_module documentation.
Ruslan Ermilov [Thu, 15 Sep 2011 08:59:13 +0000 (08:59 +0000)]
Added ngx_http_mp4_module documentation.

14 years agoRegenerated after previous commit.
Ruslan Ermilov [Thu, 15 Sep 2011 08:33:25 +0000 (08:33 +0000)]
Regenerated after previous commit.

14 years ago- The module name is now also output as an HTML header.
Ruslan Ermilov [Thu, 15 Sep 2011 08:24:33 +0000 (08:24 +0000)]
- The module name is now also output as an HTML header.
- Agreed that examples can only contain literal text.
- Agreed to call modules "ngx_*_module".
- Renamed XML element "http-error" to a more general "http-status".
- Fixed text of error codes to match the actual code.

14 years agoFix of struct field name.
Igor Sysoev [Thu, 15 Sep 2011 05:15:16 +0000 (05:15 +0000)]
Fix of struct field name.

14 years agoStyle fix.
Igor Sysoev [Wed, 14 Sep 2011 15:26:11 +0000 (15:26 +0000)]
Style fix.