Skip to content

Commit

Permalink
fixed the CPS-style chained subrequest model for the "echo_location" …
Browse files Browse the repository at this point in the history
…and "echo_subrequest" directives. they are now working with nginx 0.8.27 now. yay!
  • Loading branch information
agentzh committed Nov 19, 2009
1 parent 1025afd commit e73092f
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 8 deletions.
8 changes: 7 additions & 1 deletion src/location.c
Expand Up @@ -134,11 +134,17 @@ static ngx_int_t
ngx_http_echo_post_subrequest(ngx_http_request_t *r,
void *data, ngx_int_t rc) {
ngx_http_echo_ctx_t *ctx;
ngx_int_t parent_rc;

ctx = data;
ctx->next_handler_cmd++;

return ngx_http_echo_handler(r->parent);
parent_rc = ngx_http_echo_handler(r->parent);
if (parent_rc != NGX_DONE) {
ngx_http_finalize_request(r->parent, parent_rc);
}

return rc;
}

static ngx_int_t
Expand Down
8 changes: 7 additions & 1 deletion src/subrequest.c
Expand Up @@ -151,11 +151,17 @@ static ngx_int_t
ngx_http_echo_post_subrequest(ngx_http_request_t *r,
void *data, ngx_int_t rc) {
ngx_http_echo_ctx_t *ctx;
ngx_int_t parent_rc;

ctx = data;
ctx->next_handler_cmd++;

return ngx_http_echo_handler(r->parent);
parent_rc = ngx_http_echo_handler(r->parent);
if (parent_rc != NGX_DONE) {
ngx_http_finalize_request(r->parent, parent_rc);
}

return rc;
}

static ngx_int_t
Expand Down
3 changes: 1 addition & 2 deletions test/t/echo-location.t
Expand Up @@ -2,8 +2,7 @@

use lib 'lib';

use Test::Nginx::Echo skip_all =>
"echo_subrequest is now deprecated.";
use Test::Nginx::Echo;

plan tests => 1 * blocks();

Expand Down
3 changes: 1 addition & 2 deletions test/t/echo-subrequest.t
Expand Up @@ -2,8 +2,7 @@

use lib 'lib';

use Test::Nginx::Echo skip_all =>
"echo_subrequest is now deprecated.";
use Test::Nginx::Echo;

plan tests => 1 * blocks();

Expand Down
4 changes: 2 additions & 2 deletions util/build.sh
Expand Up @@ -14,8 +14,8 @@ if [[ "$BUILD_CLEAN" -eq 1 || ! -f Makefile \
|| "$root/util/build.sh" -nt Makefile ]]; then
./configure --prefix=/opt/nginx \
--with-http_addition_module \
--add-module=$root $opts #\
#--with-debug
--add-module=$root $opts \
--with-debug
#--without-http_ssi_module # we cannot disable ssi because echo_location_async depends on it (i dunno why?!)

fi
Expand Down

0 comments on commit e73092f

Please sign in to comment.