bugfix: applied Lanshun Zhou's run_posted_requests_in_resolver patch to the Nginx core: http://mailman.nginx.org/pipermail/nginx-devel/2013-March/003476.html

pull/34/merge
agentzh (Yichun Zhang) 12 years ago
parent d91993fc38
commit a925be09c9

@ -0,0 +1,46 @@
diff -ruNp nginx-1.2.7/src/http/ngx_http_upstream.c nginx-1.2.7_zls/src/http/ngx_http_upstream.c
--- nginx-1.2.7/src/http/ngx_http_upstream.c 2013-02-18 23:08:46.000000000 +0800
+++ nginx-1.2.7_zls/src/http/ngx_http_upstream.c 2013-03-13 00:01:01.490582380 +0800
@@ -878,11 +878,13 @@ ngx_http_upstream_cache_send(ngx_http_re
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;
@@ -894,7 +896,8 @@ ngx_http_upstream_resolve_handler(ngx_re
ngx_resolver_strerror(ctx->state));
ngx_http_upstream_finalize_request(r, u, NGX_HTTP_BAD_GATEWAY);
- return;
+
+ goto posted_requests;
}
ur->naddrs = ctx->naddrs;
@@ -919,13 +922,17 @@ ngx_http_upstream_resolve_handler(ngx_re
if (ngx_http_upstream_create_round_robin_peer(r, ur) != NGX_OK) {
ngx_http_upstream_finalize_request(r, u,
NGX_HTTP_INTERNAL_SERVER_ERROR);
- return;
+ goto posted_requests;
}
ngx_resolve_name_done(ctx);
ur->ctx = NULL;
ngx_http_upstream_connect(r, u);
+
+posted_requests:
+
+ ngx_http_run_posted_requests(c);
}

@ -139,6 +139,10 @@ if [ "$answer" = "N" ]; then
echo
fi
echo "$info_txt applying the run_posted_requests_in_resolver patch for nginx"
patch -p1 < $root/patches/nginx-$main_ver-run_posted_requests_in_resolver.patch || exit 1
echo
rm -f *.patch || exit 1
cd .. || exit 1

@ -2,7 +2,7 @@
#main_ver=1.3.11
main_ver=1.2.7
minor_ver=3rc3
minor_ver=3rc4
version=$main_ver.$minor_ver
echo $version

Loading…
Cancel
Save