summaryrefslogtreecommitdiffhomepage
path: root/src/core/ngx_resolver.h (follow)
AgeCommit message (Collapse)AuthorFilesLines
2022-07-12The "ipv4=" parameter of the "resolver" directive.Ruslan Ermilov1-1/+3
When set to "off", only IPv6 addresses will be resolved, and no A queries are ever sent (ticket #2196).
2017-07-04Resolver: cancelable resend timer event.Ruslan Ermilov1-0/+1
It is safe because re-sending still works during graceful shutdown as long as resolving takes place (and resolve tasks set their own timeouts that are not cancelable). Also, the new ctx->cancelable flag can be set to make resolve task's timeout event cancelable.
2017-06-14Resolver: added the "async" flag to resolver context.Roman Arutyunyan1-1/+2
The flag indicates that the resolve handler is called asynchronously after the resolve function ngx_resolve_name()/ngx_resolve_addr() exited.
2016-09-29Resolver: introduced state field in ngx_resolver_srv_name_t.Dmitry Volyntsev1-0/+1
It keeps the actual state value of a DNS SRV subrequest and can be used to report a more detailed log for failed SRV records.
2016-03-23Resolver: added support for SRV records.Dmitry Volyntsev1-2/+45
2016-03-23Resolver: introduced valid field in resolver responses.Dmitry Volyntsev1-0/+1
It hints the amount of time a response could be considered as valid.
2016-01-28Resolver: TCP support.Roman Arutyunyan1-2/+15
Resend DNS query over TCP once UDP response came truncated.
2016-01-28Resolver: per-request DNS server balancer.Roman Arutyunyan1-0/+2
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.
2016-01-28Resolver: renamed UDP-specific structures, fields and variables.Roman Arutyunyan1-3/+3
They will be used for TCP connections as well.
2016-01-28Resolver: removed unused field from ngx_resolver_ctx_t.Roman Arutyunyan1-3/+1
2016-01-26Resolver: fixed use-after-free memory accesses with CNAME.Roman Arutyunyan1-0/+2
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: fixed crashes in timeout handler.Ruslan Ermilov1-7/+6
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.
2014-11-20Resolver: fixed debug event logging.Ruslan Ermilov1-7/+8
In 954867a2f0a6, we switched to using resolver node as the timer event data. This broke debug event logging. Replaced now unused ngx_resolver_ctx_t.ident with ngx_resolver_node_t.ident so that ngx_event_ident() extracts something sensible when accessing ngx_resolver_node_t as ngx_connection_t.
2013-12-09The "ipv6=" boolean parameter of the "resolver" directive.Ruslan Ermilov1-0/+1
When set to "off", only IPv4 addresses will be resolved, and no AAAA queries are ever sent.
2013-12-09Resolver: implemented IPv6 name to address resolving.Ruslan Ermilov1-1/+17
2013-12-06Resolver: implemented IPv6 address to name resolving.Ruslan Ermilov1-0/+12
2013-12-06Changed resolver API to use ngx_addr_t.Ruslan Ermilov1-2/+3
2012-01-18Copyright updated.Maxim Konovalov1-0/+1
2011-10-24Support of several servers in the "resolver" directive.Igor Sysoev1-8/+7
Patch by Kirill A. Korinskiy.
2010-01-11add context to a resolver logIgor Sysoev1-1/+1
2009-11-02rename ngx_peer_addr_t to ngx_addr_tIgor Sysoev1-1/+1
2008-04-12limit CNAME recursionIgor Sysoev1-0/+3
2008-04-10take into account DNAMEIgor Sysoev1-0/+1
2008-03-04use cf->cycle->new_log because at merge stage cf->pool->log is old logIgor Sysoev1-1/+1
2008-02-28cleanup resolverIgor Sysoev1-1/+1
2008-02-28static ngx_resolver_calloc()Igor Sysoev1-1/+0
2007-12-03allow to use IP addresses without defined resolverIgor Sysoev1-0/+3
2007-11-23resolverIgor Sysoev1-0/+142