]> git.kaiwu.me - nginx.git/log
nginx.git
12 years agoAPI change: removed the ngx_conf_full_name() function.
Valentin Bartenev [Tue, 6 Aug 2013 15:58:40 +0000 (19:58 +0400)]
API change: removed the ngx_conf_full_name() function.

The ngx_get_full_name() should be used instead.

12 years agoReplaced ngx_conf_full_name() with ngx_get_full_name().
Valentin Bartenev [Tue, 6 Aug 2013 15:58:40 +0000 (19:58 +0400)]
Replaced ngx_conf_full_name() with ngx_get_full_name().

The ngx_get_full_name() function takes more readable arguments list.

12 years agoFixed memory leaks in the root and auth_basic_user_file directives.
Valentin Bartenev [Tue, 6 Aug 2013 15:58:40 +0000 (19:58 +0400)]
Fixed memory leaks in the root and auth_basic_user_file directives.

If a relative path is set by variables, then the ngx_conf_full_name()
function was called while processing requests, which causes allocations
from the cycle pool.

A new function that takes pool as an argument was introduced.

12 years agoImage filter: use "application/json" MIME type for JSON output.
Valentin Bartenev [Mon, 5 Aug 2013 10:30:03 +0000 (14:30 +0400)]
Image filter: use "application/json" MIME type for JSON output.

As it is defined by RFC 4627, and allows for various browser tools like
JSONView to display JSON well-formatted.

12 years agoCore: guard use of AI_ADDRCONFIG.
Ruslan Ermilov [Mon, 5 Aug 2013 09:44:56 +0000 (13:44 +0400)]
Core: guard use of AI_ADDRCONFIG.

Some systems (notably NetBSD and OpenBSD) lack AI_ADDRCONFIG support.

Reported by Piotr Sikora.

12 years agoFixed build with signed socklen_t and unix sockets.
Maxim Dounin [Mon, 5 Aug 2013 07:40:33 +0000 (11:40 +0400)]
Fixed build with signed socklen_t and unix sockets.

This seems to be the case at least under Cygwin, where build was broken
by 05ba5bce31e0 (1.5.3).

Reported by Kevin Worthington,
http://mailman.nginx.org/pipermail/nginx/2013-August/040028.html.

12 years agoCore: only resolve address families configured on the local system.
Ruslan Ermilov [Mon, 5 Aug 2013 06:55:59 +0000 (10:55 +0400)]
Core: only resolve address families configured on the local system.

This is done by passing AI_ADDRCONFIG to getaddrinfo().

On Linux, setting net.ipv6.conf.all.disable_ipv6 to 1 will now be
respected.

On FreeBSD, AI_ADDRCONFIG filtering is currently implemented by
attempting to create a datagram socket for the corresponding family,
which succeeds even if the system doesn't in fact have any addresses
of that family configured.  That is, if the system with IPv6 support
in the kernel doesn't have IPv6 addresses configured, AI_ADDRCONFIG
will filter out IPv6 only inside a jail without IPv6 addresses or
with IPv6 disabled.

12 years agoMIME: use "application/javascript" for .js files.
Valentin Bartenev [Wed, 31 Jul 2013 19:40:46 +0000 (23:40 +0400)]
MIME: use "application/javascript" for .js files.

Though there are several MIME types commonly used for JavaScript nowadays,
the most common being "text/javascript", "application/javascript", and
currently used by nginx "application/x-javascript", RFC 4329 prefers
"application/javascript".

The "charset_types" directive's default value was adjusted accordingly.

12 years agoVersion bump.
Sergey Kandaurov [Wed, 31 Jul 2013 14:35:57 +0000 (18:35 +0400)]
Version bump.

12 years agoConfigure: fixed autotest cleanup commands.
Sergey Kandaurov [Wed, 31 Jul 2013 14:16:40 +0000 (18:16 +0400)]
Configure: fixed autotest cleanup commands.

Previously, if configured with --with-cc="clang -g", the autotest.dSYM
directories were left unremoved.

12 years agorelease-1.5.3 tag
Maxim Dounin [Tue, 30 Jul 2013 13:27:55 +0000 (17:27 +0400)]
release-1.5.3 tag

12 years agonginx-1.5.3-RELEASE release-1.5.3
Maxim Dounin [Tue, 30 Jul 2013 13:27:55 +0000 (17:27 +0400)]
nginx-1.5.3-RELEASE

12 years agoPerl: fixed syntax usage for C preprocessor directives.
Sergey Kandaurov [Mon, 29 Jul 2013 13:30:01 +0000 (17:30 +0400)]
Perl: fixed syntax usage for C preprocessor directives.

As per perlxs, C preprocessor directives should be at the first
non-whitespace of a line to avoid interpreting them as comments.

#if and #endif are moved so that there are no blank lines before them
to retain them as part of the function body.

12 years agoUpstream: reliably detect connection failures with SSL peers.
Ruslan Ermilov [Mon, 29 Jul 2013 09:23:16 +0000 (13:23 +0400)]
Upstream: reliably detect connection failures with SSL peers.

12 years agoUpstream: no last buffer on errors.
Maxim Dounin [Thu, 25 Jul 2013 11:00:41 +0000 (15:00 +0400)]
Upstream: no last buffer on errors.

Previously, after sending a header we always sent a last buffer and
finalized a request with code 0, even in case of errors.  In some cases
this resulted in a loss of ability to detect the response wasn't complete
(e.g. if Content-Length was removed from a response by gzip filter).

This change tries to propogate to a client information that a response
isn't complete in such cases.  In particular, with this change we no longer
pretend a returned response is complete if we wasn't able to create
a temporary file.

If an error code suggests the error wasn't fatal, we flush buffered data
and disable keepalive, then finalize request normally.  This allows to to
propogate information about a problem to a client, while still sending all
the data we've got from an upstream.

12 years agoUpstream: request finalization rework.
Maxim Dounin [Thu, 25 Jul 2013 11:00:29 +0000 (15:00 +0400)]
Upstream: request finalization rework.

No semantic changes expected, though some checks are done differently.
In particular, the r->cached flag is no longer explicitly checked.  Instead,
we relay on u->header_sent not being set if a response is sent from
a cache.

12 years agoUpstream: NGX_HTTP_CLIENT_CLOSED_REQUEST no longer reset to 0.
Maxim Dounin [Thu, 25 Jul 2013 11:00:25 +0000 (15:00 +0400)]
Upstream: NGX_HTTP_CLIENT_CLOSED_REQUEST no longer reset to 0.

The NGX_HTTP_CLIENT_CLOSED_REQUEST code is allowed to happen after we
started sending a response (much like NGX_HTTP_REQUEST_TIME_OUT), so there
is no need to reset response code to 0 in this case.

12 years agoUpstream: added check if a response is complete.
Maxim Dounin [Thu, 25 Jul 2013 11:00:12 +0000 (15:00 +0400)]
Upstream: added check if a response is complete.

Checks were added to both buffered and unbuffered code paths to detect
and complain if a response is incomplete.  Appropriate error codes are
now passed to ngx_http_upstream_finalize_request().

With this change in unbuffered mode we now use u->length set to -1 as an
indicator that EOF is allowed per protocol and used to indicate response
end (much like its with p->length in buffered mode).  Proxy module was
changed to set u->length to 1 (instead of previously used -1) in case of
chunked transfer encoding used to comply with the above.

12 years agoUpstream: u->length now defaults to -1 (API change).
Maxim Dounin [Thu, 25 Jul 2013 10:58:11 +0000 (14:58 +0400)]
Upstream: u->length now defaults to -1 (API change).

That is, by default we assume that response end is signalled by
a connection close.  This seems to be better default, and in line
with u->pipe->length behaviour.

Memcached module was modified accordingly.

12 years agoUpstream: fixed store/cache of unfinished responses.
Maxim Dounin [Thu, 25 Jul 2013 10:56:59 +0000 (14:56 +0400)]
Upstream: fixed store/cache of unfinished responses.

In case of upstream eof, only responses with u->pipe->length == -1
are now cached/stored.  This ensures that unfinished chunked responses
are not cached.

Note well - previously used checks for u->headers_in.content_length_n are
preserved.  This provides an additional level of protection if protol data
disagree with Content-Length header provided (e.g., a FastCGI response
is sent with wrong Content-Length, or an incomple SCGI or uwsgi response),
as well as protects from storing of responses to HEAD requests.  This should
be reconsidered if we'll consider caching of responses to HEAD requests.

12 years agoUpstream: replaced u->pipe->temp_file with p->temp_file.
Maxim Dounin [Thu, 25 Jul 2013 10:56:49 +0000 (14:56 +0400)]
Upstream: replaced u->pipe->temp_file with p->temp_file.

While here, redundant parentheses removed.  No functional changes.

12 years agoUpstream: NGX_ERROR after pipe errors.
Maxim Dounin [Thu, 25 Jul 2013 10:56:41 +0000 (14:56 +0400)]
Upstream: NGX_ERROR after pipe errors.

12 years agoUpstream: NGX_HTTP_GATEWAY_TIME_OUT after upstream timeouts.
Maxim Dounin [Thu, 25 Jul 2013 10:56:20 +0000 (14:56 +0400)]
Upstream: NGX_HTTP_GATEWAY_TIME_OUT after upstream timeouts.

There is no real difference from previously used 0 as NGX_HTTP_* will
become 0 in ngx_http_upstream_finalize_request(), but the change
preserves information about a timeout a bit longer.  Previous use of
ETIMEDOUT in one place was just wrong.

Note well that with cacheable responses there will be a difference
(code in ngx_http_upstream_finalize_request() will store the error
in cache), though this change doesn't touch cacheable case.

12 years agoUpstream: ngx_http_upstream_finalize_request(NGX_ERROR) on errors.
Maxim Dounin [Thu, 25 Jul 2013 10:56:13 +0000 (14:56 +0400)]
Upstream: ngx_http_upstream_finalize_request(NGX_ERROR) on errors.

Previously, ngx_http_upstream_finalize_request(0) was used in most
cases after errors.  While with current code there is no difference,
use of NGX_ERROR allows to pass a bit more information into
ngx_http_upstream_finalize_request().

12 years agoUpstream: consistent error handling after u->input_filter_init().
Maxim Dounin [Thu, 25 Jul 2013 10:56:00 +0000 (14:56 +0400)]
Upstream: consistent error handling after u->input_filter_init().

In all cases ngx_http_upstream_finalize_request() with NGX_ERROR now used.
Previously used NGX_HTTP_INTERNAL_SERVER_ERROR in the subrequest in memory
case don't cause any harm, but inconsistent with other uses.

12 years agoUpstream: busy lock remnants removed.
Maxim Dounin [Thu, 25 Jul 2013 10:55:59 +0000 (14:55 +0400)]
Upstream: busy lock remnants removed.

12 years agoUpstream: stale comments removed.
Maxim Dounin [Thu, 13 Jun 2013 15:52:31 +0000 (19:52 +0400)]
Upstream: stale comments removed.

12 years agoGzip: clearing of c->buffered if all data are flushed.
Maxim Dounin [Thu, 25 Jul 2013 10:55:32 +0000 (14:55 +0400)]
Gzip: clearing of c->buffered if all data are flushed.

This allows to finalize unfinished responses while still sending as
much data as available.

12 years agoEvent pipe: fixed writing cache header to a temp file.
Maxim Dounin [Thu, 25 Jul 2013 10:55:09 +0000 (14:55 +0400)]
Event pipe: fixed writing cache header to a temp file.

With previous code the p->temp_file->offset wasn't adjusted if a temp
file was written by the code in ngx_event_pipe_write_to_downstream()
after an EOF, resulting in cache not being used with empty scgi and uwsgi
responses with Content-Length set to 0.

Fix it to call ngx_event_pipe_write_chain_to_temp_file() there instead
of calling ngx_write_chain_to_temp_file() directly.

12 years agoFixed ngx_http_test_reading() to finalize request properly.
Maxim Dounin [Fri, 14 Jun 2013 16:56:07 +0000 (20:56 +0400)]
Fixed ngx_http_test_reading() to finalize request properly.

Previous code called ngx_http_finalize_request() with rc = 0.  This is
ok if a response status was already set, but resulted in "000" being
logged if it wasn't.  In particular this happened with limit_req
if a connection was prematurely closed during limit_req delay.

12 years agoSub filter: fixed matching after a partial match.
Maxim Dounin [Thu, 25 Jul 2013 10:54:53 +0000 (14:54 +0400)]
Sub filter: fixed matching after a partial match.

After a failed partial match we now check if there is another partial
match in previously matched substring to fix cases like "aab" in "aaab".

The ctx->saved string is now always sent if it's present on return
from the ngx_http_sub_parse() function (and reset accordingly).  This
allows to release parts of previously matched data.

12 years agoSub filter: fixed incomplete last buffer on partial match.
Maxim Dounin [Thu, 25 Jul 2013 10:54:48 +0000 (14:54 +0400)]
Sub filter: fixed incomplete last buffer on partial match.

If a pattern was partially matched at a response end, partially matched
string wasn't send.  E.g., a response "fo" was truncated to an empty response
if partially mathed by a pattern "foo".

12 years agoSub filter: flush buffers handling.
Maxim Dounin [Thu, 25 Jul 2013 10:54:47 +0000 (14:54 +0400)]
Sub filter: flush buffers handling.

12 years agoSub filter: switched to ngx_chain_get_free_buf().
Maxim Dounin [Thu, 25 Jul 2013 10:54:45 +0000 (14:54 +0400)]
Sub filter: switched to ngx_chain_get_free_buf().

No functional changes.

12 years agoSub filter: stale comments removed.
Maxim Dounin [Thu, 25 Jul 2013 10:54:43 +0000 (14:54 +0400)]
Sub filter: stale comments removed.

12 years agoOn DragonFlyBSD, TCP_KEEPIDLE and TCP_KEEPINTVL are in msecs.
Ruslan Ermilov [Thu, 25 Jul 2013 08:46:03 +0000 (12:46 +0400)]
On DragonFlyBSD, TCP_KEEPIDLE and TCP_KEEPINTVL are in msecs.

Based on a patch by Sepherosa Ziehau.

12 years agoStyle: reuse one int variable in ngx_configure_listening_sockets().
Ruslan Ermilov [Thu, 25 Jul 2013 08:46:02 +0000 (12:46 +0400)]
Style: reuse one int variable in ngx_configure_listening_sockets().

No functional changes.

12 years agoSPDY: fixed segfault with "client_body_in_file_only" enabled.
Valentin Bartenev [Wed, 24 Jul 2013 18:24:25 +0000 (22:24 +0400)]
SPDY: fixed segfault with "client_body_in_file_only" enabled.

It is possible to send FLAG_FIN in additional empty data frame, even if it is
known from the content-length header that request body is empty.  And Firefox
actually behaves like this (see ticket #357).

To simplify code we sacrificed our microoptimization that did not work right
due to missing check in the ngx_http_spdy_state_data() function for rb->buf
set to NULL.

12 years agoXslt: exsltRegisterAll() moved to preconfiguration.
Maxim Dounin [Fri, 19 Jul 2013 11:59:50 +0000 (15:59 +0400)]
Xslt: exsltRegisterAll() moved to preconfiguration.

The exsltRegisterAll() needs to be called before XSLT stylesheets
are compiled, else stylesheet compilation hooks will not work.  This
change fixes EXSLT Functions extension.

12 years agoEvents: honor NGX_USE_GREEDY_EVENT when kqueue support is enabled.
Valentin Bartenev [Fri, 12 Jul 2013 23:24:30 +0000 (03:24 +0400)]
Events: honor NGX_USE_GREEDY_EVENT when kqueue support is enabled.

Currently this flag is needed for epoll and rtsig, and though these methods
usually present on different platforms than kqueue, nginx can be compiled to
support all of them.

12 years agoStyle.
Maxim Dounin [Thu, 11 Jul 2013 16:38:27 +0000 (20:38 +0400)]
Style.

12 years agoConfigure: perl Makefile rebuild after configure.
Maxim Dounin [Thu, 11 Jul 2013 16:34:02 +0000 (20:34 +0400)]
Configure: perl Makefile rebuild after configure.

The $NGX_AUTO_CONFIG_H added to perl module Makefile dependencies to
make sure it's always rebuild after a configure.  It is needed as we
expand various variables used for Makefile generation during configure
(in particular, nginx version).

12 years agoCore: fixed possible use of an uninitialized variable.
Vladimir Homutov [Thu, 11 Jul 2013 15:50:19 +0000 (19:50 +0400)]
Core: fixed possible use of an uninitialized variable.

The call to ngx_sock_ntop() in ngx_connection_local_sockaddr() might be
performed with the uninitialized "len" variable.  The fix is to initialize
variable to the size of corresponding socket address type.

The issue was introduced in commit 05ba5bce31e0.

12 years agoCore: extended ngx_sock_ntop() with socklen parameter.
Vladimir Homutov [Thu, 11 Jul 2013 12:07:25 +0000 (16:07 +0400)]
Core: extended ngx_sock_ntop() with socklen parameter.

On Linux, sockaddr length is required to process unix socket addresses properly
due to unnamed sockets (which don't have sun_path set at all) and abstract
namespace sockets.

12 years agoMake macros safe.
Gleb Smirnoff [Fri, 5 Jul 2013 07:42:25 +0000 (11:42 +0400)]
Make macros safe.

12 years agoUpstream: updated list of ngx_event_connect_peer() return values.
Ruslan Ermilov [Wed, 3 Jul 2013 08:04:13 +0000 (12:04 +0400)]
Upstream: updated list of ngx_event_connect_peer() return values.

ngx_http_upstream_get_keepalive_peer() may return NGX_DONE to
indicate that the cached keepalive connection is reused.

12 years agoCore: consolidated log-related code.
Vladimir Homutov [Fri, 28 Jun 2013 13:24:54 +0000 (17:24 +0400)]
Core: consolidated log-related code.

The stderr redirection code is moved to ngx_log_redirect_stderr().
The opening of the default log code is moved to ngx_log_open_default().

12 years agoVersion bump.
Maxim Dounin [Tue, 2 Jul 2013 16:05:49 +0000 (20:05 +0400)]
Version bump.

12 years agorelease-1.5.2 tag
Maxim Dounin [Tue, 2 Jul 2013 12:28:51 +0000 (16:28 +0400)]
release-1.5.2 tag

12 years agonginx-1.5.2-RELEASE release-1.5.2
Maxim Dounin [Tue, 2 Jul 2013 12:28:50 +0000 (16:28 +0400)]
nginx-1.5.2-RELEASE

12 years agoFixed ngx_http_parse_chunked() minimal length calculation.
Maxim Dounin [Fri, 28 Jun 2013 09:55:05 +0000 (13:55 +0400)]
Fixed ngx_http_parse_chunked() minimal length calculation.

Minimal data length we expect for further calls was calculated incorrectly
if parsing stopped right after parsing chunk size.  This might in theory
affect clients and/or backends using LF instead of CRLF.

Patch by Dmitry Popov.

12 years agoFixed build on Linux with x32 ABI.
Maxim Dounin [Wed, 26 Jun 2013 11:47:27 +0000 (15:47 +0400)]
Fixed build on Linux with x32 ABI.

On Linux x32 inclusion of sys/sysctl.h produces an error.  As sysctl() is
only used by rtsig event method code, which is legacy and not compiled
in by default on modern linuxes, the sys/sysctl.h file now only included
if rtsig support is enabled.

Based on patch by Serguei I. Ivantsov.

12 years agoCore: support several "error_log" directives.
Vladimir Homutov [Thu, 20 Jun 2013 16:47:39 +0000 (20:47 +0400)]
Core: support several "error_log" directives.

When several "error_log" directives are specified in the same configuration
block, logs are written to all files with a matching log level.

All logs are stored in the singly-linked list that is sorted by log level in
the descending order.

Specific debug levels (NGX_LOG_DEBUG_HTTP,EVENT, etc.) are not supported
if several "error_log" directives are specified.  In this case all logs
will use debug level that has largest absolute value.

12 years agoSimplified ngx_list_create().
Ruslan Ermilov [Wed, 19 Jun 2013 04:55:08 +0000 (08:55 +0400)]
Simplified ngx_list_create().

12 years agoValgrind: another complaint about uninitialized bytes.
Tatsuhiko Kubo [Tue, 11 Jun 2013 15:41:24 +0000 (00:41 +0900)]
Valgrind: another complaint about uninitialized bytes.

12 years agoSPDY: fixed code style, no functional changes.
Valentin Bartenev [Thu, 13 Jun 2013 12:28:42 +0000 (16:28 +0400)]
SPDY: fixed code style, no functional changes.

12 years agoCore: moved initialization of log level.
Vladimir Homutov [Thu, 13 Jun 2013 10:50:10 +0000 (14:50 +0400)]
Core: moved initialization of log level.

The cycle->new_log->log_level should only be initialized by ngx_init_cycle()
if no error logs were found in the configuration.  This move allows to get rid
of extra initialization in ngx_error_log().

12 years agoSPDY: pass through the full status when available.
Jim Radford [Fri, 7 Jun 2013 20:16:00 +0000 (13:16 -0700)]
SPDY: pass through the full status when available.

Avoid stripping the status text when proxying for compatibility with http.

12 years agoPerl: fixed r->header_in("Cookie") (ticket #351).
Maxim Dounin [Mon, 10 Jun 2013 10:35:00 +0000 (14:35 +0400)]
Perl: fixed r->header_in("Cookie") (ticket #351).

It was broken by X-Forwarded-For related changes in f7fe817c92a2 (1.3.14)
as hh->offset is no longer 0 for Cookie.

12 years agoFixed debug logging in ngx_http_parse_complex_uri().
Maxim Dounin [Wed, 5 Jun 2013 15:45:08 +0000 (19:45 +0400)]
Fixed debug logging in ngx_http_parse_complex_uri().

The *u previously logged isn't yet initialized at this point, and
Valgrind complains.

12 years agoMail: fixed possible uninitialized memory access.
Maxim Dounin [Wed, 5 Jun 2013 15:44:23 +0000 (19:44 +0400)]
Mail: fixed possible uninitialized memory access.

Found by Valgrind.

12 years agoValgrind: supressed complaints about uninitialized bytes.
Maxim Dounin [Wed, 5 Jun 2013 15:44:22 +0000 (19:44 +0400)]
Valgrind: supressed complaints about uninitialized bytes.

Valgrind complains if we pass uninitialized memory to a syscall:

==36492== Syscall param sendmsg(msg.msg_iov[0]) points to uninitialised byte(s)
==36492==    at 0x6B5E6A: sendmsg (in /usr/lib/system/libsystem_kernel.dylib)
==36492==    by 0x10004288E: ngx_signal_worker_processes (ngx_process_cycle.c:527)
==36492==    by 0x1000417A7: ngx_master_process_cycle (ngx_process_cycle.c:203)
==36492==    by 0x100001F10: main (nginx.c:410)
==36492==  Address 0x7fff5fbff71c is on thread 1's stack

Even initialization of all members of the structure passed isn't enough, as
there is padding which still remains uninitialized and results in Valgrind
complaint.  Note there is no real problem here as data from uninitialized
memory isn't used.

12 years agoValgrind: sigaction() failure now ignored.
Maxim Dounin [Wed, 5 Jun 2013 15:44:20 +0000 (19:44 +0400)]
Valgrind: sigaction() failure now ignored.

Valgrind intercepts SIGUSR2 in some cases, and nginx might not be able to
start due to sigaction() failure.  If compiled with NGX_VALGRIND defined,
we now ignore the failure of sigaction().

12 years agoStatus: the "last_in_chain" flag must be set.
Valentin Bartenev [Wed, 5 Jun 2013 12:22:40 +0000 (16:22 +0400)]
Status: the "last_in_chain" flag must be set.

The module always produces only one and obviously the last buffer in chain.

12 years agoSPDY: use proper macros for value length and headers counter.
Valentin Bartenev [Tue, 4 Jun 2013 22:13:52 +0000 (02:13 +0400)]
SPDY: use proper macros for value length and headers counter.

Currently these macros are synonyms, but this may change in the future
(in particular, spdy/3 uses 4 bytes for lengths).

12 years agoVersion bump.
Maxim Dounin [Tue, 4 Jun 2013 15:38:20 +0000 (19:38 +0400)]
Version bump.

12 years agoCore: fixed handling of "stderr" in error_log.
Vladimir Homutov [Tue, 4 Jun 2013 07:27:36 +0000 (11:27 +0400)]
Core: fixed handling of "stderr" in error_log.

If "stderr" was specified in one of the "error_log" directives,
stderr is not redirected to the first error_log on startup,
configuration reload, and reopening log files.

12 years agoCore: fixed stderr redirection on win32 in ngx_reopen_files().
Vladimir Homutov [Mon, 3 Jun 2013 12:54:28 +0000 (16:54 +0400)]
Core: fixed stderr redirection on win32 in ngx_reopen_files().

On win32 stderr was not redirected into a file specified by "error_log"
while reopening files.  Fix is to use platform-independent functions to
work with stderr, as already used by ngx_init_cycle() and main() since
rev. d8316f307b6a.

12 years agorelease-1.5.1 tag
Maxim Dounin [Tue, 4 Jun 2013 13:21:52 +0000 (17:21 +0400)]
release-1.5.1 tag

12 years agonginx-1.5.1-RELEASE release-1.5.1
Maxim Dounin [Tue, 4 Jun 2013 13:21:52 +0000 (17:21 +0400)]
nginx-1.5.1-RELEASE

12 years agoUpdated zlib used for win32 builds.
Maxim Dounin [Tue, 4 Jun 2013 12:16:51 +0000 (16:16 +0400)]
Updated zlib used for win32 builds.

12 years agoWin32: accept_mutex now always disabled (ticket #362).
Maxim Dounin [Fri, 31 May 2013 10:59:26 +0000 (14:59 +0400)]
Win32: accept_mutex now always disabled (ticket #362).

Use of accept mutex on win32 may result in a deadlock if there are multiple
worker_processes configured and the mutex is grabbed by a process which
can't accept connections.

12 years agoOCSP stapling: fixed incorrect debug level.
Ruslan Ermilov [Fri, 31 May 2013 09:30:37 +0000 (13:30 +0400)]
OCSP stapling: fixed incorrect debug level.

12 years agoAccess: support for UNIX-domain client addresses (ticket #359).
Ruslan Ermilov [Thu, 30 May 2013 14:23:05 +0000 (18:23 +0400)]
Access: support for UNIX-domain client addresses (ticket #359).

12 years agoWin32: added missing reset of wev->ready on WSAEWOULDBLOCK.
Maxim Dounin [Wed, 29 May 2013 15:18:22 +0000 (19:18 +0400)]
Win32: added missing reset of wev->ready on WSAEWOULDBLOCK.

This fixes connection hang with websockets proxy, and likely some other
places as well.

12 years agoUpstream: http_403 support in proxy_next_upstream (and friends).
Maxim Dounin [Mon, 27 May 2013 12:54:09 +0000 (16:54 +0400)]
Upstream: http_403 support in proxy_next_upstream (and friends).

The parameter is mostly identical to http_404, and is expected to
be used in similar situations.  The 403 code might be returned by
a backend instead of 404 on initial sync of new directories with rsync.

See here for feature request and additional details:
http://mailman.nginx.org/pipermail/nginx-ru/2013-April/050920.html

12 years agoXslt: xslt_last_modified directive.
Maxim Dounin [Fri, 24 May 2013 18:28:09 +0000 (22:28 +0400)]
Xslt: xslt_last_modified directive.

Directive is similar to ssi_last_modified and sub_filter_last_modified
directives introduced by previous commits.

12 years agoSub filter: sub_filter_last_modified directive.
Maxim Dounin [Fri, 24 May 2013 18:27:30 +0000 (22:27 +0400)]
Sub filter: sub_filter_last_modified directive.

Directive is similar to ssi_last_modified introduced by previous commit.

Patch by Alexey Kolpakov.

12 years agoSSI: ssi_last_modified directive.
Maxim Dounin [Fri, 24 May 2013 18:27:23 +0000 (22:27 +0400)]
SSI: ssi_last_modified directive.

The "ssi_last_modified" directive allows to preserve Last-Modified header
in SSI responses.  The directive is similar to SSILastModified one available
in Apache:

http://httpd.apache.org/docs/2.4/mod/mod_include.html#ssilastmodified

Patch by Alexey Kolpakov.

12 years agoCore: strengthen configuration syntax checker.
Valentin Bartenev [Thu, 23 May 2013 16:30:27 +0000 (20:30 +0400)]
Core: strengthen configuration syntax checker.

It is now a syntax error if tokens passed to a custom configuration
handler are terminated by "{".

The following incorrect configuration is now properly rejected:

  map $v $v2 {
      a b {
      c d {
      e f {
  }

12 years agoMemcached: stricten header validation.
Ruslan Ermilov [Thu, 23 May 2013 12:26:10 +0000 (16:26 +0400)]
Memcached: stricten header validation.

An invalid memcached reply that started with '\n' could cause
segmentation fault.

An invalid memcached reply "VALUE / 0 2\r?ok\r\nEND\r\n" was
considered as a valid response.

In addition, if memcached reports that the key was not found,
set u->headers_in.content_length_n to 0.  This ensures that
ngx_http_memcached_filter() will not be called while previous
code relied on always intercepting 404.  Initialization of
ctx->rest was moved to where it belongs.

12 years agoUse "void" for functions with empty parameter list.
Sergey Kandaurov [Thu, 23 May 2013 11:47:58 +0000 (15:47 +0400)]
Use "void" for functions with empty parameter list.

12 years agoConfigure: fixed test of OS X atomic(3).
Ruslan Ermilov [Thu, 23 May 2013 06:23:21 +0000 (10:23 +0400)]
Configure: fixed test of OS X atomic(3).

12 years agoStyle: replace SSL *ssl with ngx_ssl_conn_t *ssl_conn.
Piotr Sikora [Wed, 22 May 2013 01:45:07 +0000 (18:45 -0700)]
Style: replace SSL *ssl with ngx_ssl_conn_t *ssl_conn.

No functional changes.

Signed-off-by: Piotr Sikora <piotr@cloudflare.com>
12 years agoStyle: remove unnecessary references to HTTP from non-HTTP modules.
Piotr Sikora [Wed, 22 May 2013 01:43:43 +0000 (18:43 -0700)]
Style: remove unnecessary references to HTTP from non-HTTP modules.

No functional changes.

Signed-off-by: Piotr Sikora <piotr@cloudflare.com>
12 years agoReferer module: added $invalid_referer to variables hash.
Maxim Dounin [Wed, 22 May 2013 18:31:53 +0000 (22:31 +0400)]
Referer module: added $invalid_referer to variables hash.

This makes it accessible via dynamic lookup with ngx_http_get_variable()
from Perl, SSI, etc.

Patch by Yichun Zhang (agentzh).

12 years agoUpstream: fixed fail_timeout and max_fails > 1.
Maxim Dounin [Tue, 21 May 2013 17:47:50 +0000 (21:47 +0400)]
Upstream: fixed fail_timeout and max_fails > 1.

Due to peer->checked always set since rev. c90801720a0c (1.3.0)
by round-robin and least_conn balancers (ip_hash not affected),
the code in ngx_http_upstream_free_round_robin_peer() function
incorrectly reset peer->fails too often.

Reported by Dmitry Popov,
http://mailman.nginx.org/pipermail/nginx-devel/2013-May/003720.html

13 years agoMail: missing ngx_ssl_ecdh_curve() call.
F. da Silva [Fri, 10 May 2013 14:53:45 +0000 (16:53 +0200)]
Mail: missing ngx_ssl_ecdh_curve() call.

12 years agoFixed error logging.
Sergey Kandaurov [Tue, 21 May 2013 13:30:19 +0000 (17:30 +0400)]
Fixed error logging.

The provided argument list didn't follow a used format string.

12 years agoUpstream: slightly optimized ngx_http_upstream_process_header().
Ruslan Ermilov [Tue, 21 May 2013 08:54:27 +0000 (12:54 +0400)]
Upstream: slightly optimized ngx_http_upstream_process_header().

12 years agoUpstream: made the assignment more obvious.
Ruslan Ermilov [Tue, 21 May 2013 08:54:26 +0000 (12:54 +0400)]
Upstream: made the assignment more obvious.

No functional changes.

12 years agoOCSP stapling: fix error logging of successful OCSP responses.
Piotr Sikora [Thu, 16 May 2013 22:37:13 +0000 (15:37 -0700)]
OCSP stapling: fix error logging of successful OCSP responses.

Due to a bad argument list, nginx worker would crash (SIGSEGV) while
trying to log the fact that it received OCSP response with "revoked"
or "unknown" certificate status.

While there, fix similar (but non-crashing) error a few lines above.

Signed-off-by: Piotr Sikora <piotr@cloudflare.com>
13 years agoMail: removed surplus ngx_close_connection() call.
Filipe Da Silva [Thu, 9 May 2013 08:54:28 +0000 (10:54 +0200)]
Mail: removed surplus ngx_close_connection() call.

It is already called for a peer connection a few lines above.

13 years agoUpstream keepalive: slightly simplified code.
Ruslan Ermilov [Wed, 15 May 2013 11:04:49 +0000 (15:04 +0400)]
Upstream keepalive: slightly simplified code.

13 years agoRemoved vestiges of SVN.
Ruslan Ermilov [Thu, 25 Apr 2013 13:41:45 +0000 (17:41 +0400)]
Removed vestiges of SVN.

13 years agoProxy: clear script engine used to calculate lengths.
Maxim Dounin [Wed, 15 May 2013 08:23:44 +0000 (12:23 +0400)]
Proxy: clear script engine used to calculate lengths.

Previous code is believed to be safe, but might access uninitialized
memory (e.g., e->quote).

13 years agoFixed lingering_time check.
Maxim Dounin [Mon, 13 May 2013 13:39:45 +0000 (17:39 +0400)]
Fixed lingering_time check.

There are two significant changes in this patch:

1) The <= 0 comparison is done with a signed type.  This fixes the case
   of ngx_time() being larger than r->lingering_time.

2) Calculation of r->lingering_time - ngx_time() is now always done
   in the ngx_msec_t type.  This ensures the calculation is correct
   even if time_t is unsigned and differs in size from ngx_msec_t.

Thanks to Lanshun Zhou.

13 years agoUpstream: allow to intercept responses with status 300.
Ruslan Ermilov [Mon, 13 May 2013 10:10:22 +0000 (14:10 +0400)]
Upstream: allow to intercept responses with status 300.

This fixes an omission made in 9e7926763f87 where all 3XX statuses
were allowed for "error_page".

13 years agoPCRE: retain input pattern for all regular expressions.
Piotr Sikora [Thu, 2 May 2013 10:26:36 +0000 (03:26 -0700)]
PCRE: retain input pattern for all regular expressions.

Previously, input pattern was kept only for regular expressions
with named captures, which resulted in error log entries without
input pattern for PCRE errors that occured while processing
regular expressions without them.

Signed-off-by: Piotr Sikora <piotr@cloudflare.com>
13 years agoProxy: $proxy_internal_body_length fixed.
Maxim Dounin [Sat, 11 May 2013 17:12:24 +0000 (21:12 +0400)]
Proxy: $proxy_internal_body_length fixed.

The $proxy_internal_body_length value might change during request lifetime,
notably if proxy_set_body used, and use of a cached value might result in
incorrect upstream requests.

Patch by Lanshun Zhou.