]> git.kaiwu.me - nginx.git/log
nginx.git
11 years agoThread pools: keep waiting tasks mutex in ngx_thread_pool_t.
Valentin Bartenev [Mon, 23 Mar 2015 14:51:21 +0000 (17:51 +0300)]
Thread pools: keep waiting tasks mutex in ngx_thread_pool_t.

It's not needed for completed tasks queue since the previous change.

No functional changes.

11 years agoThread pools: replaced completed tasks queue mutex with spinlock.
Valentin Bartenev [Mon, 23 Mar 2015 14:51:21 +0000 (17:51 +0300)]
Thread pools: replaced completed tasks queue mutex with spinlock.

11 years agoRemoved stub implementation of win32 mutexes.
Ruslan Ermilov [Mon, 23 Mar 2015 10:52:47 +0000 (13:52 +0300)]
Removed stub implementation of win32 mutexes.

11 years agoUpdated OpenSSL used for win32 builds.
Maxim Dounin [Sun, 22 Mar 2015 23:44:41 +0000 (02:44 +0300)]
Updated OpenSSL used for win32 builds.

11 years agoSSL: use of SSL_MODE_NO_AUTO_CHAIN.
Maxim Dounin [Sun, 22 Mar 2015 23:42:35 +0000 (02:42 +0300)]
SSL: use of SSL_MODE_NO_AUTO_CHAIN.

The SSL_MODE_NO_AUTO_CHAIN mode prevents OpenSSL from automatically
building a certificate chain on the fly if there is no certificate chain
explicitly provided.  Before this change, certificates provided via the
ssl_client_certificate and ssl_trusted_certificate directives were
used by OpenSSL to automatically build certificate chains, resulting
in unexpected (and in some cases unneeded) chains being sent to clients.

11 years agoSSL: avoid SSL_CTX_set_tmp_rsa_callback() call with LibreSSL.
Maxim Dounin [Sun, 22 Mar 2015 23:42:34 +0000 (02:42 +0300)]
SSL: avoid SSL_CTX_set_tmp_rsa_callback() call with LibreSSL.

LibreSSL removed support for export ciphers and a call to
SSL_CTX_set_tmp_rsa_callback() results in an error left in the error
queue.  This caused alerts "ignoring stale global SSL error (...called
a function you should not call) while SSL handshaking" on a first connection
in each worker process.

11 years agoSSL: clear protocol options.
Maxim Dounin [Sun, 22 Mar 2015 23:42:32 +0000 (02:42 +0300)]
SSL: clear protocol options.

LibreSSL 2.1.1+ started to set SSL_OP_NO_SSLv3 option by default on
new contexts.  This makes sure to clear it to make it possible to use SSLv3
with LibreSSL if enabled in nginx config.

Prodded by Kuramoto Eiji.

11 years agoCore: added cyclic memory buffer support for error_log.
Valentin Bartenev [Thu, 19 Mar 2015 16:29:43 +0000 (19:29 +0300)]
Core: added cyclic memory buffer support for error_log.

Example of usage:

  error_log memory:16m debug;

This allows to configure debug logging with minimum impact on performance.
It's especially useful when rare crashes are experienced under high load.

The log can be extracted from a coredump using the following gdb script:

  set $log = ngx_cycle->log

  while $log->writer != ngx_log_memory_writer
      set $log = $log->next
  end

  set $buf = (ngx_log_memory_buf_t *) $log->wdata
  dump binary memory debug_log.txt $buf->start $buf->end

11 years agoRemoved busy locks.
Ruslan Ermilov [Fri, 20 Mar 2015 03:45:32 +0000 (06:45 +0300)]
Removed busy locks.

11 years agoRemoved ngx_connection_t.lock.
Ruslan Ermilov [Fri, 20 Mar 2015 03:43:19 +0000 (06:43 +0300)]
Removed ngx_connection_t.lock.

11 years agoRemoved unix ngx_threaded and related ngx_process_changes.
Ruslan Ermilov [Fri, 20 Mar 2015 03:43:19 +0000 (06:43 +0300)]
Removed unix ngx_threaded and related ngx_process_changes.

11 years agoRemoved old pthread implementation.
Ruslan Ermilov [Fri, 20 Mar 2015 03:43:19 +0000 (06:43 +0300)]
Removed old pthread implementation.

11 years agoRemoved old FreeBSD rfork() thread implementation.
Ruslan Ermilov [Fri, 20 Mar 2015 03:43:19 +0000 (06:43 +0300)]
Removed old FreeBSD rfork() thread implementation.

11 years agoThread pools: silence warning on process exit.
Ruslan Ermilov [Thu, 19 Mar 2015 20:20:18 +0000 (23:20 +0300)]
Thread pools: silence warning on process exit.

Work around pthread_cond_destroy() and pthread_mutex_destroy() returning
EBUSY.  A proper solution would be to ensure all threads are terminated.

11 years agoThread pools: fixed the waiting tasks accounting.
Ruslan Ermilov [Thu, 19 Mar 2015 10:00:48 +0000 (13:00 +0300)]
Thread pools: fixed the waiting tasks accounting.

Behave like POSIX semaphores.  If N worker threads are waiting for tasks,
at least that number of tasks should be allowed to be put into the queue.

11 years agoThread pools: keep waiting tasks counter in ngx_thread_pool_t.
Ruslan Ermilov [Thu, 19 Mar 2015 20:19:35 +0000 (23:19 +0300)]
Thread pools: keep waiting tasks counter in ngx_thread_pool_t.

It's not needed for completed tasks queue.

No functional changes.

11 years agoSPDY: fixed format specifier in logging.
Xiaochen Wang [Sun, 15 Mar 2015 13:46:21 +0000 (21:46 +0800)]
SPDY: fixed format specifier in logging.

11 years agoAdded support for offloading Linux sendfile() in thread pools.
Valentin Bartenev [Sat, 14 Mar 2015 14:37:30 +0000 (17:37 +0300)]
Added support for offloading Linux sendfile() in thread pools.

11 years agoAdded support for offloading read() in thread pools.
Valentin Bartenev [Sat, 14 Mar 2015 14:37:25 +0000 (17:37 +0300)]
Added support for offloading read() in thread pools.

11 years agoEvents: implemented eventport notification mechanism.
Ruslan Ermilov [Sat, 14 Mar 2015 14:37:21 +0000 (17:37 +0300)]
Events: implemented eventport notification mechanism.

11 years agoEvents: implemented kqueue notification mechanism.
Valentin Bartenev [Sat, 14 Mar 2015 14:37:16 +0000 (17:37 +0300)]
Events: implemented kqueue notification mechanism.

11 years agoEvents: implemented epoll notification mechanism.
Valentin Bartenev [Sat, 14 Mar 2015 14:37:13 +0000 (17:37 +0300)]
Events: implemented epoll notification mechanism.

11 years agoThread pools implementation.
Valentin Bartenev [Sat, 14 Mar 2015 14:37:07 +0000 (17:37 +0300)]
Thread pools implementation.

11 years agoConfigure: removed obsolete threads bits.
Ruslan Ermilov [Fri, 13 Mar 2015 16:08:27 +0000 (19:08 +0300)]
Configure: removed obsolete threads bits.

11 years agoRenamed NGX_THREADS to NGX_OLD_THREADS because of deprecation.
Ruslan Ermilov [Wed, 4 Mar 2015 15:26:25 +0000 (18:26 +0300)]
Renamed NGX_THREADS to NGX_OLD_THREADS because of deprecation.

It's mostly dead code and the original idea of worker threads has been rejected.

11 years agoConfigure: fixed type max value detection.
Ruslan Ermilov [Tue, 17 Mar 2015 23:04:39 +0000 (02:04 +0300)]
Configure: fixed type max value detection.

The code tried to use suffixes for "long" and "long long" types, but
it never worked as intended due to the bug in the shell code.  Also,
the max value for any 64-bit type other than "long long" on platforms
with 32-bit "long" would be incorrect if the bug was fixed.

So instead of fixing the bug in the shell code, always use the "int"
constant for 32-bit types, and "long long" constant for 64-bit types.

11 years agoOverflow detection in ngx_http_parse_chunked().
Ruslan Ermilov [Mon, 16 Mar 2015 21:26:27 +0000 (00:26 +0300)]
Overflow detection in ngx_http_parse_chunked().

11 years agoOverflow detection in ngx_http_range_parse().
Ruslan Ermilov [Mon, 16 Mar 2015 21:26:24 +0000 (00:26 +0300)]
Overflow detection in ngx_http_range_parse().

11 years agoOverflow detection in ngx_inet_addr().
Ruslan Ermilov [Mon, 16 Mar 2015 21:26:22 +0000 (00:26 +0300)]
Overflow detection in ngx_inet_addr().

11 years agoCore: overflow detection in ngx_parse_time() (ticket #732).
Ruslan Ermilov [Mon, 16 Mar 2015 21:26:20 +0000 (00:26 +0300)]
Core: overflow detection in ngx_parse_time() (ticket #732).

11 years agoRefactored ngx_parse_time().
Ruslan Ermilov [Mon, 16 Mar 2015 21:26:18 +0000 (00:26 +0300)]
Refactored ngx_parse_time().

No functional changes.

11 years agoCore: overflow detection in number parsing functions.
Ruslan Ermilov [Mon, 16 Mar 2015 21:26:15 +0000 (00:26 +0300)]
Core: overflow detection in number parsing functions.

11 years agoCore: expose maximum values of time_t and ngx_int_t.
Ruslan Ermilov [Mon, 16 Mar 2015 21:24:34 +0000 (00:24 +0300)]
Core: expose maximum values of time_t and ngx_int_t.

These are needed to detect overflows.

11 years agoConfigure: removed redundant auto/have call.
Ruslan Ermilov [Fri, 13 Mar 2015 13:43:01 +0000 (16:43 +0300)]
Configure: removed redundant auto/have call.

The auto/feature call above is enough to set NGX_HAVE_SENDFILE.

11 years agoThe "aio" directive parser made smarter.
Ruslan Ermilov [Fri, 13 Mar 2015 13:42:52 +0000 (16:42 +0300)]
The "aio" directive parser made smarter.

It now prints meaningful warnings on all platforms.

No functional changes.

11 years agoEvents: fixed typo in the error message.
Ruslan Ermilov [Thu, 12 Mar 2015 20:03:03 +0000 (23:03 +0300)]
Events: fixed typo in the error message.

11 years agoDeprecated "aio sendfile".
Ruslan Ermilov [Thu, 12 Mar 2015 17:06:04 +0000 (20:06 +0300)]
Deprecated "aio sendfile".

Specifying "sendfile on" along with "aio on" activates the
aio pre-loading mode for sendfile().

11 years agoProxy: use an appropriate error on memory allocation failure.
Ruslan Ermilov [Wed, 4 Mar 2015 05:12:53 +0000 (08:12 +0300)]
Proxy: use an appropriate error on memory allocation failure.

11 years agoStyle: moved ngx_http_ephemeral() macro to ngx_http_request.h.
Ruslan Ermilov [Wed, 4 Mar 2015 05:10:40 +0000 (08:10 +0300)]
Style: moved ngx_http_ephemeral() macro to ngx_http_request.h.

11 years agoStyle: use %*s format, as in 68d21fd1dc64.
Ruslan Ermilov [Wed, 4 Mar 2015 05:05:38 +0000 (08:05 +0300)]
Style: use %*s format, as in 68d21fd1dc64.

11 years agoLog: use ngx_cpymem() in a couple of places, no functional changes.
Valentin Bartenev [Wed, 4 Mar 2015 16:20:30 +0000 (19:20 +0300)]
Log: use ngx_cpymem() in a couple of places, no functional changes.

11 years agoUpstream keepalive: drop ready flag on EAGAIN from recv(MSG_PEEK).
Valentin Bartenev [Tue, 3 Mar 2015 14:48:57 +0000 (17:48 +0300)]
Upstream keepalive: drop ready flag on EAGAIN from recv(MSG_PEEK).

Keeping the ready flag in this case might results in missing notification of
broken connection until nginx tried to use it again.

While there, stale comment about stale event was removed since this function
is also can be called directly.

11 years agoEvents: simplified ngx_event_aio_t definition.
Ruslan Ermilov [Tue, 3 Mar 2015 15:09:13 +0000 (18:09 +0300)]
Events: simplified ngx_event_aio_t definition.

No functional changes.

11 years agoRefactored ngx_linux_sendfile_chain() even more.
Valentin Bartenev [Fri, 27 Feb 2015 16:19:08 +0000 (19:19 +0300)]
Refactored ngx_linux_sendfile_chain() even more.

The code that calls sendfile() was cut into a separate function.
This simplifies EINTR processing, yet is needed for the following
changes that add threads support.

11 years agoStyle.
Maxim Dounin [Mon, 2 Mar 2015 22:15:21 +0000 (01:15 +0300)]
Style.

Noted by Ruslan Ermilov.

11 years agoUpstream: upstream argument in ngx_http_upstream_process_request().
Maxim Dounin [Mon, 2 Mar 2015 18:44:42 +0000 (21:44 +0300)]
Upstream: upstream argument in ngx_http_upstream_process_request().

In case of filter finalization, r->upstream might be changed during
the ngx_event_pipe() call.  Added an argument to preserve it while
calling the ngx_http_upstream_process_request() function.

11 years agoUpstream: avoid duplicate finalization.
Maxim Dounin [Mon, 2 Mar 2015 18:44:32 +0000 (21:44 +0300)]
Upstream: avoid duplicate finalization.

A request may be already finalized when ngx_http_upstream_finalize_request()
is called, due to filter finalization: after filter finalization upstream
can be finalized via ngx_http_upstream_cleanup(), either from
ngx_http_terminate_request(), or because a new request was initiated
to an upstream.  Then the upstream code will see an error returned from
the filter chain and will call the ngx_http_upstream_finalize_request()
function again.

To prevent corruption of various upstream data in this situation, make sure
to do nothing but merely call ngx_http_finalize_request().

Prodded by Yichun Zhang, for details see the thread at
http://nginx.org/pipermail/nginx-devel/2015-February/006539.html.

11 years agoSSL: reset ready flag if recv(MSG_PEEK) found no bytes in socket.
Roman Arutyunyan [Mon, 2 Mar 2015 18:15:46 +0000 (21:15 +0300)]
SSL: reset ready flag if recv(MSG_PEEK) found no bytes in socket.

Previously, connection hung after calling ngx_http_ssl_handshake() with
rev->ready set and no bytes in socket to read.  It's possible in at least the
following cases:

 - when processing a connection with expired TCP_DEFER_ACCEPT on Linux
 - after parsing PROXY protocol header if it arrived in a separate TCP packet

Thanks to James Hamlin.

11 years agoCache: do not inherit last_modified and etag from stale response.
Roman Arutyunyan [Mon, 2 Mar 2015 16:47:13 +0000 (19:47 +0300)]
Cache: do not inherit last_modified and etag from stale response.

When replacing a stale cache entry, its last_modified and etag could be
inherited from the old entry if the response code is not 200 or 206.  Moreover,
etag could be inherited with any response code if it's missing in the new
response.  As a result, the cache entry is left with invalid last_modified or
etag which could lead to broken revalidation.

For example, when a file is deleted from backend, its last_modified is copied to
the new 404 cache entry and is used later for revalidation.  Once the old file
appears again with its original timestamp, revalidation succeeds and the cached
404 response is sent to client instead of the file.

The problem appeared with etags in 44b9ab7752e3 (1.7.3) and affected
last_modified in 1573fc7875fa (1.7.9).

11 years agoUpstream hash: speedup consistent hash init.
Roman Arutyunyan [Mon, 2 Mar 2015 15:41:29 +0000 (18:41 +0300)]
Upstream hash: speedup consistent hash init.

Repeatedly calling ngx_http_upstream_add_chash_point() to create
the points array in sorted order, is O(n^2) to the total weight.
This can cause nginx startup and reconfigure to be substantially
delayed.  For example, when total weight is 1000, startup takes
5s on a modern laptop.

Replace this with a linear insertion followed by QuickSort and
duplicates removal.  Startup for total weight of 1000 reduces to 40ms.

Based on a patch by Wai Keen Woon.

11 years agoMail: don't emit Auth-SSL-Verify with disabled ssl_verify_client.
Sergey Kandaurov [Fri, 27 Feb 2015 13:28:31 +0000 (16:28 +0300)]
Mail: don't emit Auth-SSL-Verify with disabled ssl_verify_client.

Previously, the Auth-SSL-Verify header with the "NONE" value was always passed
to the auth_http script if verification of client certificates is disabled.

11 years agoMail: client SSL certificates support.
Maxim Dounin [Wed, 25 Feb 2015 14:48:05 +0000 (17:48 +0300)]
Mail: client SSL certificates support.

The "ssl_verify_client", "ssl_verify_depth", "ssl_client_certificate",
"ssl_trusted_certificate", and "ssl_crl" directives introduced to control
SSL client certificate verification in mail proxy module.

If there is a certificate, detail of the certificate are passed to
the auth_http script configured via Auth-SSL-Verify, Auth-SSL-Subject,
Auth-SSL-Issuer, Auth-SSL-Serial, Auth-SSL-Fingerprint headers.  If
the auth_http_pass_client_cert directive is set, client certificate
in PEM format will be passed in the Auth-SSL-Cert header (urlencoded).

If there is no required certificate provided during an SSL handshake
or certificate verification fails then a protocol-specific error is
returned after the SSL handshake and the connection is closed.

Based on previous work by Sven Peter, Franck Levionnois and Filipe Da Silva.

11 years agoMail: added Auth-SSL header to indicate SSL.
Maxim Dounin [Wed, 25 Feb 2015 14:47:49 +0000 (17:47 +0300)]
Mail: added Auth-SSL header to indicate SSL.

Based on a patch by Filipe da Silva.

11 years agoMail: fixed buffer allocation for CRLF after Auth-SMTP-* headers.
Maxim Dounin [Wed, 25 Feb 2015 14:47:43 +0000 (17:47 +0300)]
Mail: fixed buffer allocation for CRLF after Auth-SMTP-* headers.

There were no buffer overruns in real life as there is extra space
allocated for the Auth-Login-Attempt counter.

11 years agoSSL: account sent bytes in ngx_ssl_write().
Ruslan Ermilov [Tue, 24 Feb 2015 20:52:47 +0000 (23:52 +0300)]
SSL: account sent bytes in ngx_ssl_write().

11 years agoCore: fixed potential buffer overrun when initializing hash.
Maxim Dounin [Tue, 24 Feb 2015 15:37:14 +0000 (18:37 +0300)]
Core: fixed potential buffer overrun when initializing hash.

Initial size as calculated from the number of elements may be bigger
than max_size.  If this happens, make sure to set size to max_size.

Reported by Chris West.

11 years agoCache: reduced diffs to the plus version of nginx.
Ruslan Ermilov [Tue, 17 Feb 2015 13:27:52 +0000 (16:27 +0300)]
Cache: reduced diffs to the plus version of nginx.

No functional changes.

11 years agoCore: make ngx_connection_local_sockaddr() always assign address.
Roman Arutyunyan [Tue, 17 Feb 2015 11:26:44 +0000 (14:26 +0300)]
Core: make ngx_connection_local_sockaddr() always assign address.

Previously, this function checked for connection local address existence
and returned error if it was missing.  Now a new address is assigned in this
case making it possible to call this function not only for accepted connections.

11 years agoConfigure: typo fixed.
Sergey Kandaurov [Wed, 11 Feb 2015 17:18:55 +0000 (20:18 +0300)]
Configure: typo fixed.

11 years agoUnbreak building on FreeBSD without file AIO.
Valentin Bartenev [Wed, 11 Feb 2015 17:00:07 +0000 (20:00 +0300)]
Unbreak building on FreeBSD without file AIO.

It appeared that the NGX_HAVE_AIO_SENDFILE macro was defined regardless of
the "--with-file-aio" configure option and the NGX_HAVE_FILE_AIO macro.

Now they are related.

Additionally, fixed one macro.

11 years agoRefactored sendfile() AIO preload.
Valentin Bartenev [Wed, 11 Feb 2015 14:52:15 +0000 (17:52 +0300)]
Refactored sendfile() AIO preload.

This reduces layering violation and simplifies the logic of AIO preread, since
it's now triggered by the send chain function itself without falling back to
the copy filter.  The context of AIO operation is now stored per file buffer,
which makes it possible to properly handle cases when multiple buffers come
from different locations, each with its own configuration.

11 years agoMail: fixed the duplicate listen address detection.
Ruslan Ermilov [Fri, 23 Jan 2015 12:23:29 +0000 (15:23 +0300)]
Mail: fixed the duplicate listen address detection.

11 years agoMail: fixed a comment.
Ruslan Ermilov [Fri, 23 Jan 2015 12:23:27 +0000 (15:23 +0300)]
Mail: fixed a comment.

11 years agoUpstream: detect port absence in fastcgi_pass with IP literal.
Ruslan Ermilov [Thu, 22 Jan 2015 13:23:32 +0000 (16:23 +0300)]
Upstream: detect port absence in fastcgi_pass with IP literal.

If fastcgi_pass (or any look-alike that doesn't imply a default
port) is specified as an IP literal (as opposed to a hostname),
port absence was not detected at configuration time and could
result in EADDRNOTAVAIL at run time.

Fixed this in such a way that configs like

http {
    server {
        location / {
            fastcgi_pass 127.0.0.1;
        }
    }

    upstream 127.0.0.1 {
        server 10.0.0.1:12345;
    }
}

still work.  That is, port absence check is delayed until after
we make sure there's no explicit upstream with such a name.

11 years agoVersion bump.
Ruslan Ermilov [Wed, 11 Feb 2015 12:51:03 +0000 (15:51 +0300)]
Version bump.

11 years agorelease-1.7.10 tag
Maxim Dounin [Tue, 10 Feb 2015 14:33:32 +0000 (17:33 +0300)]
release-1.7.10 tag

11 years agonginx-1.7.10-RELEASE release-1.7.10
Maxim Dounin [Tue, 10 Feb 2015 14:33:32 +0000 (17:33 +0300)]
nginx-1.7.10-RELEASE

11 years agoUpdated OpenSSL used for win32 builds.
Maxim Dounin [Tue, 10 Feb 2015 13:54:12 +0000 (16:54 +0300)]
Updated OpenSSL used for win32 builds.

11 years agoCore: fixed build on Tru64 UNIX.
Sergey Kandaurov [Mon, 9 Feb 2015 22:51:08 +0000 (01:51 +0300)]
Core: fixed build on Tru64 UNIX.

There was a typo in NGX_EACCES.

Reported by Goetz T. Fischer.

11 years agoFixed try_files directory test to match only a directory.
Damien Tournoud [Tue, 20 Jan 2015 23:26:32 +0000 (00:26 +0100)]
Fixed try_files directory test to match only a directory.

Historically, it was possible to match either a file or directory
in the following configuration:

    location / {
        try_files $uri/ =404;
    }

11 years agoCore: fixed a race resulting in extra sem_post()'s.
Roman Arutyunyan [Wed, 4 Feb 2015 13:22:43 +0000 (16:22 +0300)]
Core: fixed a race resulting in extra sem_post()'s.

The mtx->wait counter was not decremented if we were able to obtain the lock
right after incrementing it.  This resulted in unneeded sem_post() calls,
eventually leading to EOVERFLOW errors being logged, "sem_post() failed
while wake shmtx (75: Value too large for defined data type)".

To close the race, mtx->wait is now decremented if we obtain the lock right
after incrementing it in ngx_shmtx_lock().  The result can become -1 if a
concurrent ngx_shmtx_unlock() decrements mtx->wait before the added code does.
However, that only leads to one extra iteration in the next call of
ngx_shmtx_lock().

11 years agoCore: reverted prefix-based temp files (a9138c35120d).
Roman Arutyunyan [Mon, 2 Feb 2015 18:28:09 +0000 (21:28 +0300)]
Core: reverted prefix-based temp files (a9138c35120d).

The use_temp_path http cache feature is now implemented using a separate temp
hierarchy in cache directory.  Prefix-based temp files are no longer needed.

11 years agoCache: added temp_path to file cache.
Roman Arutyunyan [Mon, 2 Feb 2015 16:38:35 +0000 (19:38 +0300)]
Cache: added temp_path to file cache.

If use_temp_path is set to off, a subdirectory "temp" is created in the cache
directory.  It's used instead of proxy_temp_path and friends for caching
upstream response.

11 years agoCore: supported directory skipping in ngx_walk_tree().
Roman Arutyunyan [Mon, 2 Feb 2015 16:38:32 +0000 (19:38 +0300)]
Core: supported directory skipping in ngx_walk_tree().

If pre_tree_handler() returns NGX_DECLINED, the directory is ignored.

11 years agoFixed AIO handling in the output chain.
Valentin Bartenev [Wed, 28 Jan 2015 18:33:06 +0000 (21:33 +0300)]
Fixed AIO handling in the output chain.

The ctx->aio flag must be taken into account in the short path too.

11 years agoA bounds check of %N format on Windows.
Igor Sysoev [Tue, 27 Jan 2015 12:38:15 +0000 (15:38 +0300)]
A bounds check of %N format on Windows.
Thanks to Joe Bialek, Adam Zabrocki and Microsoft Vulnerability Research.

11 years agoUpstream: $upstream_header_time variable.
Vladimir Homutov [Wed, 14 Jan 2015 06:03:35 +0000 (09:03 +0300)]
Upstream: $upstream_header_time variable.

Keeps time spent on obtaining the header from an upstream server.  The value is
formatted similar to the $upstream_response_time variable.

11 years agoYear 2015.
Valentin Bartenev [Tue, 13 Jan 2015 17:13:16 +0000 (20:13 +0300)]
Year 2015.

11 years agoCore: added disk_full_time checks to error log.
Maxim Dounin [Tue, 13 Jan 2015 16:51:37 +0000 (19:51 +0300)]
Core: added disk_full_time checks to error log.

11 years agoFixed sendfile() trailers on OS X (8e903522c17a, 1.7.8).
Maxim Dounin [Tue, 13 Jan 2015 15:58:23 +0000 (18:58 +0300)]
Fixed sendfile() trailers on OS X (8e903522c17a, 1.7.8).

The trailer.count variable was not initialized if there was a header,
resulting in "sendfile() failed (22: Invalid argument)" alerts on OS X
if the "sendfile" directive was used.  The bug was introduced
in 8e903522c17a (1.7.8).

11 years agoUpstream: use_temp_path parameter of proxy_cache_path and friends.
Valentin Bartenev [Fri, 26 Dec 2014 13:22:59 +0000 (16:22 +0300)]
Upstream: use_temp_path parameter of proxy_cache_path and friends.

When set to "off", temporary files for cacheable responses will be stored
inside cache directory.

11 years agoCache: update variant while setting header.
Valentin Bartenev [Fri, 26 Dec 2014 13:22:56 +0000 (16:22 +0300)]
Cache: update variant while setting header.

Some parts of code related to handling variants of a resource moved into
a separate function that is called earlier.  This allows to use cache file
name as a prefix for temporary file in the following patch.

11 years agoCore: added prefix-based temporary files.
Valentin Bartenev [Fri, 26 Dec 2014 13:22:54 +0000 (16:22 +0300)]
Core: added prefix-based temporary files.

Now, if the "path" parameter is NULL, ngx_create_temp_file() will use
file->name as a predefined file path prefix.

11 years agoUnified handling of ngx_create_temp_file() return value.
Valentin Bartenev [Fri, 26 Dec 2014 13:22:50 +0000 (16:22 +0300)]
Unified handling of ngx_create_temp_file() return value.

The original check for NGX_AGAIN was surplus, since the function returns
only NGX_OK or NGX_ERROR.  Now it looks similar to other places.

No functional changes.

11 years agoTrailing space fix.
Maxim Dounin [Wed, 24 Dec 2014 16:02:58 +0000 (19:02 +0300)]
Trailing space fix.

11 years agoFixed building with musl libc (ticket #685).
Maxim Dounin [Wed, 24 Dec 2014 16:01:22 +0000 (19:01 +0300)]
Fixed building with musl libc (ticket #685).

11 years agoVersion bump.
Maxim Dounin [Wed, 24 Dec 2014 15:53:38 +0000 (18:53 +0300)]
Version bump.

11 years agorelease-1.7.9 tag
Maxim Dounin [Tue, 23 Dec 2014 15:28:38 +0000 (18:28 +0300)]
release-1.7.9 tag

11 years agonginx-1.7.9-RELEASE release-1.7.9
Maxim Dounin [Tue, 23 Dec 2014 15:28:37 +0000 (18:28 +0300)]
nginx-1.7.9-RELEASE

11 years agoUpstream: added variables support to proxy_cache and friends.
Valentin Bartenev [Mon, 22 Dec 2014 09:59:09 +0000 (12:59 +0300)]
Upstream: added variables support to proxy_cache and friends.

11 years agoUpstream: preset some cache configuration when bypassing.
Valentin Bartenev [Mon, 22 Dec 2014 09:59:06 +0000 (12:59 +0300)]
Upstream: preset some cache configuration when bypassing.

No functional changes.

11 years agoUpstream: refactored proxy_cache and friends.
Valentin Bartenev [Mon, 22 Dec 2014 09:59:02 +0000 (12:59 +0300)]
Upstream: refactored proxy_cache and friends.

The configuration handling code has changed to look similar to the proxy_store
directive and friends.  This simplifies adding variable support in the following
patch.

No functional changes.

11 years agoUpstream: mutually exclusive inheritance of "cache" and "store".
Valentin Bartenev [Mon, 22 Dec 2014 09:58:59 +0000 (12:58 +0300)]
Upstream: mutually exclusive inheritance of "cache" and "store".

Currently, storing and caching mechanisms cannot work together, and a
configuration error is thrown when the proxy_store and proxy_cache
directives (as well as their friends) are configured on the same level.

But configurations like in the example below were allowed and could result
in critical errors in the error log:

    proxy_store on;

    location / {
        proxy_cache one;
    }

Only proxy_store worked in this case.

For more predictable and errorless behavior these directives now prevent
each other from being inherited from the previous level.

11 years agoUpstream: simplified proxy_store and friends configuration code.
Valentin Bartenev [Mon, 22 Dec 2014 09:58:56 +0000 (12:58 +0300)]
Upstream: simplified proxy_store and friends configuration code.

This changes internal API related to handling of the "store"
flag in ngx_http_upstream_conf_t.  Previously, a non-null value
of "store_lengths" was enough to enable store functionality with
custom path.  Now, the "store" flag is also required to be set.

No functional changes.

11 years agoSSL: safeguard use of SSL3_FLAGS_NO_RENEGOTIATE_CIPHERS.
Lukas Tribus [Wed, 17 Dec 2014 14:12:50 +0000 (15:12 +0100)]
SSL: safeguard use of SSL3_FLAGS_NO_RENEGOTIATE_CIPHERS.

The flag was recently removed by BoringSSL.

11 years agoAutoindex: implemented XML output format.
Valentin Bartenev [Fri, 12 Dec 2014 17:25:42 +0000 (20:25 +0300)]
Autoindex: implemented XML output format.

11 years agoAutoindex: implemented JSON output format.
Valentin Bartenev [Fri, 12 Dec 2014 17:25:35 +0000 (20:25 +0300)]
Autoindex: implemented JSON output format.

11 years agoAutoindex: rendering code moved to a separate function.
Valentin Bartenev [Fri, 12 Dec 2014 17:25:28 +0000 (20:25 +0300)]
Autoindex: rendering code moved to a separate function.

No functional changes.

11 years agoHeaders filter: variables support in expires (ticket #113).
Maxim Dounin [Thu, 11 Dec 2014 20:42:11 +0000 (23:42 +0300)]
Headers filter: variables support in expires (ticket #113).

11 years agoHeaders filter: local variables for config, no functional changes.
Maxim Dounin [Thu, 11 Dec 2014 20:42:06 +0000 (23:42 +0300)]
Headers filter: local variables for config, no functional changes.