wasm: fix getHeaderMapValue() in case of early client disconnect.#15224
Merged
lizan merged 1 commit intoenvoyproxy:mainfrom Mar 2, 2021
Merged
wasm: fix getHeaderMapValue() in case of early client disconnect.#15224lizan merged 1 commit intoenvoyproxy:mainfrom
lizan merged 1 commit intoenvoyproxy:mainfrom
Conversation
Previously, getHeaderMapValuei() would incorrectly return BadArgument when called in the access log phase after an early client disconnect, because the code assumed that a HeaderMap can point to a nullptr only when called from a callback in which given map is not available. Fixes proxy-wasm/proxy-wasm-rust-sdk#82. Signed-off-by: Piotr Sikora <piotrsikora@google.com>
mathetake
reviewed
Mar 1, 2021
| if (!map) { | ||
| if (access_log_phase_) { | ||
| // Maps might point to nullptr in the access log phase. | ||
| if (wasm()->abiVersion() == proxy_wasm::AbiVersion::ProxyWasm_0_1_0) { |
Member
There was a problem hiding this comment.
Is it necessary to return Ok on 0.1.0?
Contributor
Author
There was a problem hiding this comment.
Yes, see the happy path a few lines below.
lizan
approved these changes
Mar 2, 2021
Contributor
Author
|
/backport |
Shikugawa
pushed a commit
to Shikugawa/envoy
that referenced
this pull request
Mar 10, 2021
…voyproxy#15224) Previously, getHeaderMapValuei() would incorrectly return BadArgument when called in the access log phase after an early client disconnect, because the code assumed that a HeaderMap can point to a nullptr only when called from a callback in which given map is not available. Fixes proxy-wasm/proxy-wasm-rust-sdk#82. Signed-off-by: Piotr Sikora <piotrsikora@google.com> Signed-off-by: Shikugawa <rei@tetrate.io>
Shikugawa
added a commit
that referenced
this pull request
Mar 15, 2021
…5224) (#15395) Previously, getHeaderMapValuei() would incorrectly return BadArgument when called in the access log phase after an early client disconnect, because the code assumed that a HeaderMap can point to a nullptr only when called from a callback in which given map is not available. Fixes proxy-wasm/proxy-wasm-rust-sdk#82. Signed-off-by: Piotr Sikora <piotrsikora@google.com> Signed-off-by: Shikugawa <rei@tetrate.io> Co-authored-by: Piotr Sikora <piotrsikora@google.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previously, getHeaderMapValuei() would incorrectly return BadArgument
when called in the access log phase after an early client disconnect,
because the code assumed that a HeaderMap can point to a nullptr only
when called from a callback in which given map is not available.
Fixes proxy-wasm/proxy-wasm-rust-sdk#82.
Signed-off-by: Piotr Sikora piotrsikora@google.com