summaryrefslogtreecommitdiffhomepage
AgeCommit message (Collapse)AuthorFilesLines
2016-01-26nginx-1.9.10-RELEASErelease-1.9.10Maxim Dounin1-0/+103
2016-01-26Resolver: limited CNAME recursion.Ruslan Ermilov1-6/+22
Previously, the recursion was only limited for cached responses.
2016-01-26Resolver: fixed use-after-free memory accesses with CNAME.Roman Arutyunyan2-39/+35
When several requests were waiting for a response, then after getting a CNAME response only the last request's context had the name updated. Contexts of other requests had the wrong name. This name was used by ngx_resolve_name_done() to find the node to remove the request context from. When the name was wrong, the request could not be properly cancelled, its context was freed but stayed linked to the node's waiting list. This happened e.g. when the first request was aborted or timed out before the resolving completed. When it completed, this triggered a use-after-free memory access by calling ctx->handler of already freed request context. The bug manifests itself by "could not cancel <name> resolving" alerts in error_log. When a request was responded with a CNAME, the request context kept the pointer to the original node's rn->u.cname. If the original node expired before the resolving timed out or completed with an error, this would trigger a use-after-free memory access via ctx->name in ctx->handler(). The fix is to keep ctx->name unmodified. The name from context is no longer used by ngx_resolve_name_done(). Instead, we now keep the pointer to resolver node to which this request is linked. Keeping the original name intact also improves logging.
2016-01-26Resolver: changed the ngx_resolver_create_*_query() arguments.Roman Arutyunyan1-30/+27
No functional changes. This is needed by the following change.
2016-01-26Resolver: fixed CNAME processing for several requests.Ruslan Ermilov1-6/+15
When several requests were waiting for a response, then after getting a CNAME response only the last request was properly processed, while others were left waiting.
2016-01-26Resolver: fixed crashes in timeout handler.Ruslan Ermilov2-25/+42
If one or more requests were waiting for a response, then after getting a CNAME response, the timeout event on the first request remained active, pointing to the wrong node with an empty rn->waiting list, and that could cause either null pointer dereference or use-after-free memory access if this timeout expired. If several requests were waiting for a response, and the first request terminated (e.g., due to client closing a connection), other requests were left without a timeout and could potentially wait indefinitely. This is fixed by introducing per-request independent timeouts. This change also reverts 954867a2f0a6 and 5004210e8c78.
2016-01-26Resolver: fixed possible segmentation fault on DNS format error.Roman Arutyunyan1-1/+1
2016-01-12Request body: removed surplus assigment, no functional changes.Valentin Bartenev1-6/+0
Setting rb->bufs to NULL is surplus after ngx_http_write_request_body() has returned NGX_OK.
2016-01-11Core: worker_cpu_affinity auto.Maxim Dounin2-2/+42
If enabled, workers are bound to available CPUs, each worker to once CPU in order. If there are more workers than available CPUs, remaining are bound in a loop, starting again from the first available CPU. The optional mask parameter defines which CPUs are available for automatic binding. In collaboration with Vladimir Homutov.
2016-01-11Upstream: fixed changing method on X-Accel-Redirect.Maxim Dounin1-0/+1
Previously, only r->method was changed, resulting in handling of a request as GET within nginx itself, but not in requests to proxied servers. See http://mailman.nginx.org/pipermail/nginx/2015-December/049518.html.
2016-01-11Year 2016.Ruslan Ermilov1-2/+2
2015-12-17Upstream: don't keep connections on early responses (ticket #669).Maxim Dounin3-0/+8
2015-12-17Fixed PROXY protocol on IPv6 sockets (ticket #858).Maxim Dounin1-0/+1
2015-12-17Version bump.Maxim Dounin1-2/+2
2015-12-12Fixed a typo.Ruslan Ermilov1-1/+1
2015-12-09release-1.9.9 tagMaxim Dounin1-0/+1
2015-12-09nginx-1.9.9-RELEASErelease-1.9.9Maxim Dounin1-0/+16
2015-12-09Fixed fastcgi_pass with UNIX socket and variables (ticket #855).Ruslan Ermilov1-1/+3
This was broken in a93345ee8f52 (1.9.8).
2015-12-09Version bump.Ruslan Ermilov1-2/+2
2015-12-08release-1.9.8 tagMaxim Dounin1-0/+1
2015-12-08nginx-1.9.8-RELEASErelease-1.9.8Maxim Dounin1-0/+54
2015-12-08Slice filter: terminate first slice with last_in_chain flag.Roman Arutyunyan1-0/+1
This flag makes sub filter flush buffered data and optimizes allocation in copy filter.
2015-12-08Slice filter: never run subrequests when main request is buffered.Roman Arutyunyan1-0/+4
With main request buffered, it's possible, that a slice subrequest will send output before it. For example, while main request is waiting for aio read to complete, a slice subrequest can start an aio operation as well. The order in which aio callbacks are called is undetermined.
2015-12-08SSL: fixed possible segfault on renegotiation (ticket #845).Sergey Kandaurov1-0/+4
Skip SSL_CTX_set_tlsext_servername_callback in case of renegotiation. Do nothing in SNI callback as in this case it will be supplied with request in c->data which isn't expected and doesn't work this way. This was broken by b40af2fd1c16 (1.9.6) with OpenSSL master branch and LibreSSL.
2015-12-07Updated OpenSSL and PCRE used for win32 builds.Maxim Dounin1-2/+2
2015-12-07Added slice module to win32 builds.Maxim Dounin1-0/+1
2015-12-07Slice filter.Roman Arutyunyan6-6/+567
Splits a request into subrequests, each providing a specific range of response. The variable "$slice_range" must be used to set subrequest range and proper cache key. The directive "slice" sets slice size. The following example splits requests into 1-megabyte cacheable subrequests. server { listen 8000; location / { slice 1m; proxy_cache cache; proxy_cache_key $uri$is_args$args$slice_range; proxy_set_header Range $slice_range; proxy_cache_valid 200 206 1h; proxy_pass http://127.0.0.1:9000; } }
2015-12-07Upstream: fill r->headers_out.content_range from upstream response.Roman Arutyunyan1-0/+5
2015-12-02Core: fix typo in error message.Piotr Sikora1-1/+1
Signed-off-by: Piotr Sikora <piotrsikora@google.com>
2015-12-03Style: NGX_PTR_SIZE replaced with sizeof(void *).Maxim Dounin2-2/+2
The NGX_PTR_SIZE macro is only needed in preprocessor directives where it's not possible to use sizeof().
2015-12-02Style.Maxim Dounin1-1/+1
2015-11-30Stop emulating a space character after r->method_name.Ruslan Ermilov2-4/+1
This is an API change. The proxy module was modified to not depend on this in 44122bddd9a1. No known third-party modules seem to depend on this.
2015-11-06Proxy: improved code readability.Ruslan Ermilov1-12/+5
Do not assume that space character follows the method name, just pass it explicitly. The fuss around it has already proved to be unsafe, see bbdb172f0927 and http://mailman.nginx.org/pipermail/nginx-ru/2013-January/049692.html for details.
2015-11-30Reduced the number of GET method constants.Ruslan Ermilov1-4/+1
2015-11-30Increased the default "connection_pool_size" on 64-bit platforms.Valentin Bartenev1-1/+1
The previous default of 256 bytes isn't enough and results in two allocations on each accepted connection, which is suboptimal.
2015-11-30Configure: improved workaround for system perl on OS X.Ruslan Ermilov1-1/+1
The workaround from baf2816d556d stopped to work because the order of "-arch x86_64" and "-arch i386" has changed.
2015-11-30Configure: removed comment obsolete in 3b763d36e055.Ruslan Ermilov1-3/+0
2015-11-06Style: unified request method checks.Ruslan Ermilov5-5/+5
2015-11-23Core: enabled "include" inside http upstreams (ticket #635).Ruslan Ermilov1-1/+1
The directive already works inside stream upstream blocks.
2015-11-23Configure: fixed using OpenSSL include paths.Maxim Dounin1-0/+1
2015-11-21Upstream: fixed "no port" detection in evaluated upstreams.Ruslan Ermilov5-10/+22
If an upstream with variables evaluated to address without a port, then instead of a "no port in upstream" error an attempt was made to connect() which failed with EADDRNOTAVAIL.
2015-11-17Missing "variable" word added.Maxim Dounin1-1/+1
2015-11-17Used the pwritev() syscall for writing files where possible.Valentin Bartenev2-3/+51
It is more effective, because it doesn't require a separate lseek().
2015-11-17Moved file writev() handling code to a separate function.Valentin Bartenev1-32/+51
No functional changes.
2015-11-17Handled EINTR from write() and pwrite() syscalls.Valentin Bartenev1-3/+20
This is in addition to 6fce16b1fc10.
2015-11-17Adjusted file->sys_offset after the write() syscall.Valentin Bartenev1-0/+1
This fixes suboptimal behavior caused by surplus lseek() for sequential writes on systems without pwrite(). A consecutive read after write might result in an error on systems without pread() and pwrite(). Fortunately, at the moment there are no widely used systems without these syscalls.
2015-11-17Version bump.Valentin Bartenev1-2/+2
2015-11-17release-1.9.7 tagMaxim Dounin1-0/+1
2015-11-17nginx-1.9.7-RELEASErelease-1.9.7Maxim Dounin1-0/+76
2015-11-16Realip: the $realip_remote_addr variable.Ruslan Ermilov1-1/+71