# HG changeset patch
# User Ruslan Ermilov <ru@nginx.com>
# Date 1521711799 -10800
#      Thu Mar 22 12:43:19 2018 +0300
# Node ID 12e37f92d9f27695785b82a2be1cf5a5993a254d
# Parent  190591ab0d76cef420f666522a0b1ccd70d33e3f
Resolver: ignore error on sending a DNS query (ticket #1511).

If an error happens when sending a DNS query for the first time, the
resolving process would terminate with an error, and no resending to
other DNS servers would happen.  The fix is to ignore the errors and
let the resend timer to expire.  While resending, we already ignored
such errors.

diff --git a/src/core/ngx_resolver.c b/src/core/ngx_resolver.c
--- a/src/core/ngx_resolver.c
+++ b/src/core/ngx_resolver.c
@@ -852,9 +852,7 @@ ngx_resolve_name_locked(ngx_resolver_t *
 #endif
     rn->nsrvs = 0;
 
-    if (ngx_resolver_send_query(r, rn) != NGX_OK) {
-        goto failed;
-    }
+    (void) ngx_resolver_send_query(r, rn);
 
     if (ngx_resolver_set_timeout(r, ctx) != NGX_OK) {
         goto failed;
@@ -1056,9 +1054,7 @@ ngx_resolve_addr(ngx_resolver_ctx_t *ctx
 #endif
     rn->nsrvs = 0;
 
-    if (ngx_resolver_send_query(r, rn) != NGX_OK) {
-        goto failed;
-    }
+    (void) ngx_resolver_send_query(r, rn);
 
     if (ngx_resolver_set_timeout(r, ctx) != NGX_OK) {
         goto failed;
