summaryrefslogtreecommitdiffhomepage
path: root/src/core/ngx_resolver.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2012-11-12Merge of r4872, r4893: resolver cached addresses random rotation.Maxim Dounin1-2/+29
Resolver: cached addresses are returned with random rotation now. This ensures balancing when working with dynamically resolved upstream servers with multiple addresses. Based on patch by Anton Jouline.
2012-09-24Merge of r4785, r4795, r4811, r4812, r4816, r4822: coverity.Maxim Dounin1-9/+9
*) Resolver: fixed possible memory leak in ngx_resolver_create(). *) Explicitly ignore returned value from unlink() in ngx_open_tempfile(). *) Explicitly ignore returned value from close() in ngx_event_core_init_conf(). *) Added three missing checks for NULL after ngx_array_push() calls. *) Crypt: fixed handling of corrupted SSHA entries in password file. *) Mark logically dead code with corresponding comment. Found by / prodded by Coverity.
2012-07-02Merge of r4654, r4672, r4684, r4685, r4692: resolver changes.Maxim Dounin1-16/+17
*) Resolver: fixed format specification. Patch by Yichun Zhang (agentzh). *) Support for IPv6 literals and an optional port in resolver. *) Fixed crash in ngx_resolver_cleanup_tree(). If sending a DNS request fails with an error (e.g., when mistakenly trying to send it to a local IP broadcast), such a request is not deleted if there are clients waiting on it. However, it was still erroneously removed from the queue. Later ngx_resolver_cleanup_tree() attempted to remove it from the queue again that resulted in a NULL pointer dereference. *) When "resolver" is configured with a domain name, only the first resolved address was used. Now all addresses will be used. *) Fixed segfault with poll and resolver used. Poll event method needs ngx_cycle->files to work, and use of ngx_exit_cycle without files set caused null pointer dereference in resolver's cleanup on udp socket close.
2012-07-02Merge of r4644:Maxim Dounin1-1/+6
Fixed potential null pointer dereference in ngx_resolver_create(). While here, improved error message.
2012-06-04Merge of r4611, r4620: resolver fixes.Maxim Dounin1-2/+14
*) Fixed segmentation fault in ngx_resolver_create_name_query(). If name passed for resolution was { 0, NULL } (e.g. as a result of name server returning CNAME pointing to ".") pointer wrapped to (void *) -1 resulting in segmentation fault on an attempt to dereference it. Reported by Lanshun Zhou. *) Resolver: protection from duplicate responses. If we already had CNAME in resolver node (i.e. rn->cnlen and rn->u.cname set), and got additional response with A record, it resulted in rn->cnlen set and rn->u.cname overwritten by rn->u.addr (or rn->u.addrs), causing segmentation fault later in ngx_resolver_free_node() on an attempt to free overwritten rn->u.cname. The opposite (i.e. CNAME got after A) might cause similar problems as well.
2012-03-22Resolver: added missing sanity checking when creating name queries.Maxim Dounin1-1/+5
Found by Veracode.
2012-02-27Fix of rbtree lookup on hash collisions.Maxim Dounin1-11/+6
Previous code incorrectly assumed that nodes with identical keys are linked together. This might not be true after tree rebalance. Patch by Lanshun Zhou.
2012-02-27Fixed null pointer dereference in resolver (ticket #91).Maxim Dounin1-5/+6
The cycle->new_log.file may not be set before config parsing finished if there are no error_log directive defined at global level. Fix is to copy it after config parsing. Patch by Roman Arutyunyan.
2012-02-13Time parsing cleanup.Maxim Dounin1-1/+1
Nuke NGX_PARSE_LARGE_TIME, it's not used since 0.6.30. The only error ngx_parse_time() can currently return is NGX_ERROR, check it explicitly and make sure to cast it to appropriate type (either time_t or ngx_msec_t) to avoid signedness warnings on platforms with unsigned time_t (notably QNX).
2012-01-18Copyright updated.Maxim Konovalov1-0/+1
2011-11-16Silenced a warning for some compilers.Ruslan Ermilov1-0/+1
2011-11-16Now nginx uses TTL of a DNS response when calculating cache validity.Ruslan Ermilov1-6/+38
Previously it used a hardcoded value of 300 seconds. Also added the "valid=" parameter to the "resolver" directive that can be used to override the cache validity time. Patch by Kirill A. Korinskiy with minor changes.
2011-11-09Fixed compression pointer processing in DNS response greater than 255 bytes.Igor Sysoev1-7/+7
Thanks to Ben Hawkes.
2011-10-24Support of several servers in the "resolver" directive.Igor Sysoev1-14/+44
Patch by Kirill A. Korinskiy.
2011-04-23fix building by gcc 4.6 without --with-debugIgor Sysoev1-4/+4
2010-09-27decrease resolver errors level to errorIgor Sysoev1-1/+1
2010-06-23style fixIgor Sysoev1-1/+1
2010-01-11add context to a resolver logIgor Sysoev1-13/+41
2009-12-02remove stale commentIgor Sysoev1-2/+0
2009-11-11use ngx_resolver_alloc() instead of ngx_resolver_calloc()Igor Sysoev1-2/+2
since all fields are filled
2009-11-11fix resolving an empty name (".")Igor Sysoev1-5/+5
2009-11-09*) fix resolving an empty name ("."),Igor Sysoev1-1/+2
*) add quotes in an error message, *) backout r3299 in ngx_mail_smtp_handler.c
2009-11-09fix "PTR ." case in address resolverIgor Sysoev1-0/+6
2009-11-09fix segfault in resolver:Igor Sysoev1-0/+2
ngx_resolve_name_done() and ngx_resolve_addr_done() did not delete contexts from a resolver node waiting list.
2009-11-02rename ngx_peer_addr_t to ngx_addr_tIgor Sysoev1-1/+1
2009-09-19fix resolver cache rbtree comparisonIgor Sysoev1-9/+3
2009-09-16fix memory leak in resolverIgor Sysoev1-0/+4
2009-04-30*) refactor error_log processing: listen socket log might inherit built-inIgor Sysoev1-3/+3
error_log with zero level, and r2447, r2466, r2467 were not enough *) remove bogus "stderr" level *) some functions and fields renames
2009-02-02fix building by msvc, introduced in r2487Igor Sysoev1-1/+1
2009-01-31fix return code, this fixes segfault when two or moreIgor Sysoev1-1/+3
simultaneous connections are resolving the same address
2009-01-30use length of uncompressed nameIgor Sysoev1-5/+4
2009-01-29store name pointer in variable allocated on stackIgor Sysoev1-4/+7
as resolver ctx may be already deallocated at this point
2009-01-29free addrs only it has been allocated before: non single addressIgor Sysoev1-1/+1
2009-01-29fix reverse resolving cache: it stored zero length namesIgor Sysoev1-1/+5
*) free name only if it has been already allocated *) store name length
2008-11-17fix compression pointer for big (>255) DNS responsesIgor Sysoev1-2/+2
2008-10-24show name for a FORMERR DNS responseIgor Sysoev1-6/+36
2008-10-24FORMERR DNS response may be equal to mininal query sizeIgor Sysoev1-1/+1
2008-05-14style fix: remove tabs and trailing spacesIgor Sysoev1-1/+1
2008-04-12limit CNAME recursionIgor Sysoev1-3/+22
2008-04-10use correct ngx_sprintf() formatsIgor Sysoev1-13/+13
2008-04-10log unexpected qtypeIgor Sysoev1-0/+4
2008-04-10take into account DNAMEIgor Sysoev1-0/+3
2008-04-09return NXDOMAIN for ".." in host nameIgor Sysoev1-1/+21
2008-04-09fix memory leak on resolver query send failureIgor Sysoev1-0/+12
2008-03-04fix previous commitIgor Sysoev1-1/+1
2008-03-04use cf->cycle->new_log because at merge stage cf->pool->log is old logIgor Sysoev1-8/+8
2008-02-28cleanup resolverIgor Sysoev1-7/+79
2008-02-28fix memory leaks, use unlocked ngx_resolver_free() for seldom failed casesIgor Sysoev1-12/+23
2008-02-28static ngx_resolver_calloc()Igor Sysoev1-1/+2
2008-02-06fix r1879Igor Sysoev1-0/+1