From a925be09c9ce29ce4a0a0f095c064dbcf1cab751 Mon Sep 17 00:00:00 2001 From: "agentzh (Yichun Zhang)" Date: Wed, 20 Mar 2013 18:48:27 -0700 Subject: [PATCH] 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 --- ....2.7-run_posted_requests_in_resolver.patch | 46 +++++++++++++++++++ util/mirror-tarballs | 4 ++ util/ver | 2 +- 3 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 patches/nginx-1.2.7-run_posted_requests_in_resolver.patch diff --git a/patches/nginx-1.2.7-run_posted_requests_in_resolver.patch b/patches/nginx-1.2.7-run_posted_requests_in_resolver.patch new file mode 100644 index 0000000..5f92deb --- /dev/null +++ b/patches/nginx-1.2.7-run_posted_requests_in_resolver.patch @@ -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); + } + + diff --git a/util/mirror-tarballs b/util/mirror-tarballs index fe43fd4..14f1344 100755 --- a/util/mirror-tarballs +++ b/util/mirror-tarballs @@ -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 diff --git a/util/ver b/util/ver index d835cdc..8762ba4 100755 --- a/util/ver +++ b/util/ver @@ -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