aboutsummaryrefslogtreecommitdiff
path: root/src/core
Commit message (Collapse)AuthorAge
* Resolver: added support for SRV records.Dmitry Volyntsev2016-03-23
|
* Resolver: do not enable resolve timer if provided timeout is zero.Dmitry Volyntsev2016-03-23
|
* Resolver: introduced valid field in resolver responses.Dmitry Volyntsev2016-03-23
| | | | | It hints the amount of time a response could be considered as valid.
* Core: introduced the NGX_DEBUG_PALLOC macro.Valentin Bartenev2016-03-23
| | | | | | | It allows to turn off accumulation of small pool allocations into a big preallocated chunk of memory. This is useful for debugging memory access with sanitizer, since such accumulation can cover buffer overruns from being detected.
* Core: use ngx_palloc_small() to allocate ngx_pool_large_t.Valentin Bartenev2016-03-23
| | | | | | | | This structure cannot be allocated as a large block anyway, otherwise that will result in infinite recursion, since each large allocation requires to allocate another ngx_pool_large_t. The room for the structure is guaranteed by the NGX_MIN_POOL_SIZE constant.
* Core: introduced the ngx_palloc_small() function.Valentin Bartenev2016-03-23
| | | | | It deduplicates some code for allocations from memory pool. No functional changes.
* Core: moved logging before freeing large blocks of pool.Valentin Bartenev2016-03-23
| | | | | This fixes use-after-free memory access with enabled debug log when pool->log is allocated as a large block.
* Fix build with -Wmissing-prototypes.Piotr Sikora2016-03-18
| | | | | | Broken in 5eb4d7541107 (1.9.6), fix somehow missed in 3600bbfb43e3. Signed-off-by: Piotr Sikora <piotrsikora@google.com>
* Threads: offloading of temp files writing to thread pools.Maxim Dounin2016-03-18
| | | | | | | | | | | | | | | | | The ngx_thread_write_chain_to_file() function introduced, which uses ngx_file_t thread_handler, thread_ctx and thread_task fields. The task context structure (ngx_thread_file_ctx_t) is the same for both reading and writing, and can be safely shared as long as operations are serialized. The task->handler field is now always set (and not only when task is allocated), as the same task can be used with different handlers. The thread_write flag is introduced in the ngx_temp_file_t structure to explicitly enable use of ngx_thread_write_chain_to_file() in ngx_write_chain_to_temp_file() when supported by caller. In collaboration with Valentin Bartenev.
* Threads: task pointer stored in ngx_file_t.Maxim Dounin2016-03-18
| | | | | | | | | | | | | | This simplifies the interface of the ngx_thread_read() function. Additionally, most of the thread operations now explicitly set file->thread_task, file->thread_handler and file->thread_ctx, to facilitate use of thread operations in other places. (Potential problems remain with sendfile in threads though - it uses file->thread_handler as set in ngx_output_chain(), and it should not be overwritten to an incompatible one.) In collaboration with Valentin Bartenev.
* Stream: UDP proxy.Roman Arutyunyan2016-01-20
|
* Fixed compilation with -Wmissing-prototypes.Sergey Kandaurov2016-03-14
|
* Copy filter: fixed sendfile aio handlers to set ctx->aio.Maxim Dounin2016-03-03
| | | | | | | | | | | | | | | | | | | Sendfile handlers (aio preload and thread handler) are called within ctx->output_filter() in ngx_output_chain(), and hence ctx->aio cannot be set directly in ngx_output_chain(). Meanwhile, it must be set to make sure loop within ngx_output_chain() will be properly terminated. There are no known cases that trigger the problem, though in theory something like aio + sub filter (something that needs body in memory, and can also free some memory buffers) + sendfile can result in "task already active" and "second aio post" alerts. The fix is to set ctx->aio in ngx_http_copy_aio_sendfile_preload() and ngx_http_copy_thread_handler(). For consistency, ctx->aio is no longer set explicitly in ngx_output_chain_copy_buf(), as it's now done in ngx_http_copy_thread_handler().
* Dynamic modules: removed unnecessary initialization.Ruslan Ermilov2016-02-25
| | | | It became unnecessary after 85dea406e18f.
* Version bump.Ruslan Ermilov2016-02-25
|
* Core: added support for more than 64 CPUs in worker_cpu_affinity.Vladimir Homutov2016-02-18
|
* Core: improved logging on invalid NGINX variable (ticket #900).Maxim Dounin2016-02-15
|
* Dynamic modules: fixed a version mismatch message (ticket #898).Ruslan Ermilov2016-02-11
| | | | Based on a patch by Takashi Takizawa.
* Core: ngx_module_t compatibility with C++.Piotr Sikora2016-02-09
| | | | | | | | Changes to NGX_MODULE_V1 and ngx_module_t in 85dea406e18f (1.9.11) broke all modules written in C++, because ISO C++11 does not allow conversion from string literal to char *. Signed-off-by: Piotr Sikora <piotrsikora@google.com>
* Version bump.Maxim Dounin2016-02-10
|
* Dynamic modules.Maxim Dounin2016-02-04
| | | | | | | | | | | | | | | | | | | The auto/module script is extended to understand ngx_module_link=DYNAMIC. When set, it links the module as a shared object rather than statically into nginx binary. The module can later be loaded using the "load_module" directive. New auto/module parameter ngx_module_order allows to define module loading order in complex cases. By default the order is set based on ngx_module_type. 3rd party modules can be compiled dynamically using the --add-dynamic-module configure option, which will preset ngx_module_link to "DYNAMIC" before calling the module config script. Win32 support is rudimentary, and only works when using MinGW gcc (which is able to handle exports/imports automatically). In collaboration with Ruslan Ermilov.
* Dynamic modules: dlopen() support.Maxim Dounin2016-02-04
|
* Dynamic modules: changed ngx_modules to cycle->modules.Maxim Dounin2016-02-04
|
* Dynamic modules: moved module-related stuff to separate files.Maxim Dounin2016-02-04
|
* Resolver: style.Ruslan Ermilov2015-12-17
| | | | | Use the original query name in error and debug messages when processing PTR responses.
* Resolver: improved PTR response processing.Ruslan Ermilov2015-12-17
| | | | | | | | | | | | | | The previous code only parsed the first answer, without checking its type, and required a compressed RR name. The new code checks the RR type, supports responses with multiple answers, and doesn't require the RR name to be compressed. This has a side effect in limited support of CNAME. If a response includes both CNAME and PTR RRs, like when recursion is enabled on the server, PTR RR is handled. Full CNAME support in PTR response is not implemented in this change.
* Resolver: style.Ruslan Ermilov2015-12-17
| | | | Renamed argument in ngx_resolver_process_a() for consistency.
* Resolver: free TCP buffers on resolver cleanup.Roman Arutyunyan2016-02-02
|
* Resolver: fixed possible resource leak introduced in 5a16d40c63de.Ruslan Ermilov2016-02-02
| | | | Found by Coverity (CID 1351175).
* Resolver: TCP support.Roman Arutyunyan2016-01-28
| | | | Resend DNS query over TCP once UDP response came truncated.
* Resolver: per-request DNS server balancer.Roman Arutyunyan2016-01-28
| | | | | | | | | | | Previously, a global server balancer was used to assign the next DNS server to send a query to. That could lead to a non-uniform distribution of servers per request. A request could be assigned to the same dead server several times in a row and wait longer for a valid server or even time out without being processed. Now each query is sent to all servers sequentially in a circle until a response is received or timeout expires. Initial server for each request is still globally balanced.
* Resolver: renamed UDP-specific structures, fields and variables.Roman Arutyunyan2016-01-28
| | | | They will be used for TCP connections as well.
* Resolver: removed unused field from ngx_resolver_ctx_t.Roman Arutyunyan2016-01-28
|
* Version bump.Roman Arutyunyan2016-01-28
|
* Resolver: limited CNAME recursion.Ruslan Ermilov2016-01-26
| | | | Previously, the recursion was only limited for cached responses.
* Resolver: fixed use-after-free memory accesses with CNAME.Roman Arutyunyan2016-01-26
| | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Resolver: changed the ngx_resolver_create_*_query() arguments.Roman Arutyunyan2016-01-26
| | | | | | No functional changes. This is needed by the following change.
* Resolver: fixed CNAME processing for several requests.Ruslan Ermilov2016-01-26
| | | | | | 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.
* Resolver: fixed crashes in timeout handler.Ruslan Ermilov2016-01-26
| | | | | | | | | | | | | | | | | 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.
* Resolver: fixed possible segmentation fault on DNS format error.Roman Arutyunyan2016-01-26
|
* Core: worker_cpu_affinity auto.Maxim Dounin2016-01-11
| | | | | | | | | | | 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.
* Version bump.Maxim Dounin2015-12-17
|
* Version bump.Ruslan Ermilov2015-12-09
|
* Style: NGX_PTR_SIZE replaced with sizeof(void *).Maxim Dounin2015-12-03
| | | | | The NGX_PTR_SIZE macro is only needed in preprocessor directives where it's not possible to use sizeof().
* Core: enabled "include" inside http upstreams (ticket #635).Ruslan Ermilov2015-11-23
| | | | The directive already works inside stream upstream blocks.
* Version bump.Valentin Bartenev2015-11-17
|
* Fixed ngx_parse_time() out of bounds access (ticket #821).Maxim Dounin2015-10-30
| | | | | | | | | The code failed to ensure that "s" is within the buffer passed for parsing when checking for "ms", and this resulted in unexpected errors when parsing non-null-terminated strings with trailing "m". The bug manifested itself when the expires directive was used with variables. Found by Roman Arutyunyan.
* Syslog: added "nohostname" option.Vladimir Homutov2015-10-26
| | | | | The option disables sending hostname in the syslog message header. This is useful with syslog daemons that do not expect it (tickets #677 and #783).
* Version bump.Valentin Bartenev2015-10-27
|
* Core: read/write locks are also required by the Stream module.Piotr Sikora2015-10-23
| | | | Signed-off-by: Piotr Sikora <piotrsikora@google.com>