# HG changeset patch # User Igor Sysoev # Date 1207750817 0 # Node ID 4f16186f560323d72a21ac3019b819c2701a2592 # Parent 3e9e4581fbba8a97a779b44761e1eafc547b2ea7 quick resolving handles u->resolved->ctx by itself diff --git a/src/http/ngx_http_upstream.c b/src/http/ngx_http_upstream.c --- a/src/http/ngx_http_upstream.c +++ b/src/http/ngx_http_upstream.c @@ -421,13 +421,14 @@ ngx_http_upstream_init(ngx_http_request_ ctx->data = r; ctx->timeout = clcf->resolver_timeout; + u->resolved->ctx = ctx; + if (ngx_resolve_name(ctx) != NGX_OK) { + u->resolved->ctx = NULL; ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR); return; } - u->resolved->ctx = ctx; - return; }