Permalink
Browse files

now we disable subrequest in memory by default.

  • Loading branch information...
1 parent 2e12518 commit 501c9e46236a2e8e36b9813de9a63518c93f5470 @agentzh agentzh committed Jan 12, 2011
Showing with 28 additions and 4 deletions.
  1. +6 −3 ngx_http_eval_module.c
  2. +22 −1 test/t/sanity.t
View
@@ -211,11 +211,14 @@ ngx_http_eval_handler(ngx_http_request_t *r)
return NGX_DECLINED;
}
+ dd("status: %d", (int) ctx->status);
+
return ctx->status;
}
if(ctx->in_progress) {
- return NGX_AGAIN;
+ dd("still in progress");
+ return NGX_DONE;
}
psr = ngx_palloc(r->pool, sizeof(ngx_http_post_subrequest_t));
@@ -248,7 +251,7 @@ ngx_http_eval_handler(ngx_http_request_t *r)
psr->handler = ngx_http_eval_post_subrequest_handler;
psr->data = ctx;
- flags |= NGX_HTTP_SUBREQUEST_WAITED;
+ /* flags |= NGX_HTTP_SUBREQUEST_WAITED; */
if (ecf->subrequest_in_memory) {
flags |= NGX_HTTP_SUBREQUEST_IN_MEMORY;
@@ -555,7 +558,7 @@ ngx_http_eval_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
ngx_conf_merge_str_value(conf->override_content_type, prev->override_content_type, "");
ngx_conf_merge_size_value(conf->buffer_size, prev->buffer_size, (size_t) ngx_pagesize);
ngx_conf_merge_value(conf->subrequest_in_memory,
- prev->subrequest_in_memory, 1);
+ prev->subrequest_in_memory, 0);
return NGX_CONF_OK;
}
View
@@ -1,4 +1,4 @@
-# vi:filetype=perl
+# vi:ft=
use lib 'lib';
use Test::Nginx::Socket;
@@ -220,3 +220,24 @@ GET /echo
!!! [helloooooooooooooooooooo]
--- timeout: 10
+
+
+=== TEST 11: eval with subrequest in memory
+--- config
+ location /echo {
+ eval_subrequest_in_memory on;
+ eval $a {
+ proxy_connect_timeout 10ms;
+ proxy_pass http://www.taobao.com:1234;
+ }
+ echo '!!! [$a]';
+ }
+ location /hi {
+ echo hi;
+ }
+--- request
+GET /echo
+--- response_body
+!!! [hi]
+--- SKIP
+

0 comments on commit 501c9e4

Please sign in to comment.