]> git.kaiwu.me - nginx.git/commitdiff
quick resolving handles u->resolved->ctx by itself
authorIgor Sysoev <igor@sysoev.ru>
Wed, 9 Apr 2008 14:20:17 +0000 (14:20 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Wed, 9 Apr 2008 14:20:17 +0000 (14:20 +0000)
src/http/ngx_http_upstream.c

index 987742e0116c2ef511f2d4bbf2630a1f800bd397..ed280a8c9a114c399f213143bae479d82e918367 100644 (file)
@@ -421,13 +421,14 @@ ngx_http_upstream_init(ngx_http_request_t *r)
         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;
     }