-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(proxy-wasm) implement response body buffering
First, this commit fixes `on_response_body` execution of requests when they issue subrequests that produce a body (see 004-on_http_phases.t). This unlocks testing of response body buffering via subrequests producing chunked responses (`ngx_chain_t` buffers). Response body buffering itself is implemented as part of ngx_http_wasm_filter_module, so as to be usable from other components than just proxy-wasm. Response body buffering is enabled via `rctx->resp_buffering` which is enabled when `ngx_wasm_ops_resume` returns `NGX_AGAIN`, which for filters translates to returning `PAUSE` from `on_http_response_body`. If and when the response body buffers are full, then the next `on_http_response_body` call will have `eof=false`, and more invocations can be expected, as the body *must* be proxied in chunks. If the response body fit in the buffers, then the next `on_http_response_body` call will have `eof=true` as one would expected. We catch "response body already requested" in ngx_proxy_wasm to produce a proxy-wasm error message, as this feature is currently only exposed through it.
- Loading branch information
1 parent
bd1b5b8
commit 4cea1cb
Showing
13 changed files
with
871 additions
and
52 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
Oops, something went wrong.