Skip to content

Commit

Permalink
fixed the echo_exec directive for nginx >= 0.8.11
Browse files Browse the repository at this point in the history
  • Loading branch information
agentzh committed May 6, 2010
1 parent d87e269 commit e2d1a85
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/ngx_http_echo_handler.c
Expand Up @@ -229,7 +229,14 @@ ngx_http_echo_run_cmds(ngx_http_request_t *r)

case echo_opcode_echo_exec:
rc = ngx_http_echo_exec_exec(r, ctx, computed_args);
goto done;

#if defined(nginx_version) && nginx_version >= 8011
if (rc == NGX_DONE) {
r->main->count--;
}
#endif

return rc;
break;

default:
Expand Down
1 change: 1 addition & 0 deletions test/t/echo-before-body.t
Expand Up @@ -157,6 +157,7 @@ status: 404
^status: 403.*?status: 500.*$
=== TEST 10: echo -n
--- config
location /echo {
Expand Down
25 changes: 25 additions & 0 deletions test/t/exec.t
Expand Up @@ -106,3 +106,28 @@ a: []
--- response_body
uri: [/foo]
=== TEST 7: query string ignored for named locations
--- config
location /entry {
echo_location /foo;
echo_sleep 0.001;
echo_location /foo;
}
location /foo {
echo_exec @bar;
}
location @bar {
proxy_pass http://127.0.0.1:$server_port/bar;
}
location /bar {
echo_sleep 0.01;
echo hello;
}
--- request
GET /entry
--- response_body
hello
hello

0 comments on commit e2d1a85

Please sign in to comment.