]> git.kaiwu.me - nginx.git/commitdiff
Upstream: fixed previous commit.
authorMaxim Dounin <mdounin@mdounin.ru>
Thu, 14 Mar 2013 16:22:43 +0000 (16:22 +0000)
committerMaxim Dounin <mdounin@mdounin.ru>
Thu, 14 Mar 2013 16:22:43 +0000 (16:22 +0000)
Store r->connection on stack to make sure it's still available if request
finalization happens to actually free request memory.

src/http/ngx_http_upstream.c

index 1734eae984b31e7ff2cdae99181142398fc30168..e9ea72c46304a1aa98e0a7c656b6a9b2c79660f0 100644 (file)
@@ -878,11 +878,13 @@ ngx_http_upstream_cache_send(ngx_http_request_t *r, ngx_http_upstream_t *u)
 static void
 ngx_http_upstream_resolve_handler(ngx_resolver_ctx_t *ctx)
 {
+    ngx_connection_t              *c;
     ngx_http_request_t            *r;
     ngx_http_upstream_t           *u;
     ngx_http_upstream_resolved_t  *ur;
 
     r = ctx->data;
+    c = r->connection;
 
     u = r->upstream;
     ur = u->resolved;
@@ -929,7 +931,7 @@ ngx_http_upstream_resolve_handler(ngx_resolver_ctx_t *ctx)
 
 failed:
 
-    ngx_http_run_posted_requests(r->connection);
+    ngx_http_run_posted_requests(c);
 }