Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

bugfix: ngx.flush(true) could not be used before I/O calls like ngx.l…

…ocation.capture. this bug had appeared in v0.3.1rc34.
  • Loading branch information...
commit b1d8d622702d2a6d628c596271576304f53943f3 1 parent 8153df5
@agentzh agentzh authored
Showing with 24 additions and 1 deletion.
  1. +1 −0  src/ngx_http_lua_util.c
  2. +23 −1 t/056-flush.t
View
1  src/ngx_http_lua_util.c
@@ -1043,6 +1043,7 @@ ngx_http_lua_wev_handler(ngx_http_request_t *r)
if (ctx->waiting_flush) {
+ ctx->waiting_flush = 0;
nret = 0;
goto run;
View
24 t/056-flush.t
@@ -37,7 +37,7 @@ hiya
=== TEST 2: flush no wait - content
--- config
- send_timeout 100ms;
+ send_timeout 500ms;
location /test {
content_by_lua '
ngx.say("hello, world")
@@ -122,3 +122,25 @@ hello, world
hiya
--- SKIP
+
+
+=== TEST 7: flush wait - content
+--- config
+ location /test {
+ content_by_lua '
+ ngx.say("hello, world")
+ ngx.flush(true)
+ local res = ngx.location.capture("/sub")
+ ngx.print(res.body)
+ ngx.flush(true)
+ ';
+ }
+ location /sub {
+ echo sub;
+ }
+--- request
+GET /test
+--- response_body
+hello, world
+sub
+
Please sign in to comment.
Something went wrong with that request. Please try again.