Ticket #1511: patch

File patch, 1.3 KB (added by Ruslan Ermilov, 8 years ago)
  • src/core/ngx_resolver.c

    # 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 b ngx_resolve_name_locked(ngx_resolver_t *  
    852852#endif
    853853    rn->nsrvs = 0;
    854854
    855     if (ngx_resolver_send_query(r, rn) != NGX_OK) {
    856         goto failed;
    857     }
     855    (void) ngx_resolver_send_query(r, rn);
    858856
    859857    if (ngx_resolver_set_timeout(r, ctx) != NGX_OK) {
    860858        goto failed;
    ngx_resolve_addr(ngx_resolver_ctx_t *ctx  
    10561054#endif
    10571055    rn->nsrvs = 0;
    10581056
    1059     if (ngx_resolver_send_query(r, rn) != NGX_OK) {
    1060         goto failed;
    1061     }
     1057    (void) ngx_resolver_send_query(r, rn);
    10621058
    10631059    if (ngx_resolver_set_timeout(r, ctx) != NGX_OK) {
    10641060        goto failed;