changeset 1959:4f16186f5603

quick resolving handles u->resolved->ctx by itself
author Igor Sysoev <igor@sysoev.ru>
date Wed, 09 Apr 2008 14:20:17 +0000
parents 3e9e4581fbba
children 1609b3c3d604
files src/http/ngx_http_upstream.c
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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;
     }