-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(proxy-wasm) resume content phase after request_body read EAGAIN
- Loading branch information
1 parent
b1315fa
commit b4c035a
Showing
9 changed files
with
164 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
# vim:set ft= ts=4 sw=4 et fdm=marker: | ||
|
||
BEGIN { | ||
$ENV{MOCKEAGAIN} = 'rw'; | ||
$ENV{MOCKEAGAIN_VERBOSE} ||= 0; | ||
$ENV{TEST_NGINX_EVENT_TYPE} = 'poll'; | ||
} | ||
|
||
use strict; | ||
use lib '.'; | ||
use t::TestWasmX; | ||
|
||
plan_tests(5); | ||
run_tests(); | ||
|
||
__DATA__ | ||
|
||
=== TEST 1: EAGAIN - reading request body | ||
--- load_nginx_modules: ngx_http_echo_module | ||
--- wasm_modules: on_phases | ||
--- config | ||
location /t { | ||
proxy_wasm on_phases; | ||
echo_sleep 0.3; | ||
echo ok; | ||
} | ||
--- request | ||
POST /t | ||
|
||
Hello world | ||
--- response_body | ||
ok | ||
--- grep_error_log eval: qr/#\d+ on_(request|log).*?(?=(, client|\s+while))/ | ||
--- grep_error_log_out eval | ||
qr/\A#\d+ on_request_headers, 3 headers, eof: false | ||
#\d+ on_request_body, 11 bytes, eof: true | ||
#\d+ on_log\Z/ | ||
--- no_error_log | ||
[error] | ||
[crit] | ||
|
||
|
||
|
||
=== TEST 2: EAGAIN - reading request body in subrequest | ||
--- load_nginx_modules: ngx_http_echo_module | ||
--- wasm_modules: on_phases | ||
--- config | ||
location /subrequest { | ||
internal; | ||
proxy_wasm on_phases; | ||
echo_sleep 0.3; | ||
echo ok; | ||
} | ||
|
||
location /t { | ||
echo_subrequest POST '/subrequest' -b 'Hello world'; | ||
} | ||
--- response_body | ||
ok | ||
--- grep_error_log eval: qr/#\d+ on_(request|log).*?(?=(, client|\s+while))/ | ||
--- grep_error_log_out eval | ||
qr/\A#\d+ on_request_headers, 3 headers, eof: false | ||
#\d+ on_request_body, 11 bytes, eof: true\Z/ | ||
--- no_error_log | ||
[error] | ||
[crit] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters