]> git.kaiwu.me - nginx.git/commitdiff
fix segfault in resolver:
authorIgor Sysoev <igor@sysoev.ru>
Mon, 9 Nov 2009 17:45:56 +0000 (17:45 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Mon, 9 Nov 2009 17:45:56 +0000 (17:45 +0000)
ngx_resolve_name_done() and ngx_resolve_addr_done() did not delete
contexts from a resolver node waiting list.

src/core/ngx_resolver.c

index 9adc2d223549cae93e64e2fcc474ffa57b09a96e..82785c276043344ceb76d1a59acfaf7c6a3e99e1 100644 (file)
@@ -464,6 +464,7 @@ ngx_resolve_name_locked(ngx_resolver_t *r, ngx_resolver_ctx_t *ctx)
 
             ctx->next = rn->waiting;
             rn->waiting = ctx;
+            ctx->state = NGX_AGAIN;
 
             return NGX_AGAIN;
         }
@@ -625,6 +626,7 @@ ngx_resolve_addr(ngx_resolver_ctx_t *ctx)
 
             ctx->next = rn->waiting;
             rn->waiting = ctx;
+            ctx->state = NGX_AGAIN;
 
             /* unlock addr mutex */