Klaus Demo nginx / 8e2949e
Resolver: report SRV resolve failure if all A resolves failed. Previously, if an SRV record was successfully resolved, but all of its A records failed to resolve, NXDOMAIN was returned to the caller, which is considered a successful resolve rather than an error. This could result in losing the result of a previous successful resolve by the caller. Now NXDOMAIN is only returned if at least one A resolve completed with this code. Otherwise the error state of the first A resolve is returned. Roman Arutyunyan 3 years ago
1 changed file(s) with 9 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
42654265 }
42664266
42674267 if (naddrs == 0) {
4268 ctx->state = NGX_RESOLVE_NXDOMAIN;
4268 ctx->state = srvs[0].state;
4269
4270 for (i = 0; i < nsrvs; i++) {
4271 if (srvs[i].state == NGX_RESOLVE_NXDOMAIN) {
4272 ctx->state = NGX_RESOLVE_NXDOMAIN;
4273 break;
4274 }
4275 }
4276
42694277 ctx->valid = ngx_time() + (r->valid ? r->valid : 10);
42704278
42714279 ctx->handler(ctx);