Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes for use of proxy-wasm in envoy-wasm. #11

Merged
merged 3 commits into from Apr 6, 2020

Conversation

jplevyak
Copy link
Contributor

@jplevyak jplevyak commented Apr 6, 2020

Signed-off-by: John Plevyak jplevyak@gmail.com

Signed-off-by: John Plevyak <jplevyak@gmail.com>
Signed-off-by: John Plevyak <jplevyak@gmail.com>
proxy_wasm_api.h Outdated
size_t *new_size = nullptr) {
auto result = proxy_set_buffer_bytes(type, start, length, data.data(), data.size());
if (result == WasmResult::Ok && new_size)
*new_size += -length + data.size();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

length or -length?
Will the - in front of the length generate a very large number?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I should add a test. The amount in length is removed from the initial size. If length is > the initial size then result != WasmResult::Ok. So, this should be safe AFAICT.

Signed-off-by: John Plevyak <jplevyak@gmail.com>
@jplevyak jplevyak merged commit d8862bd into proxy-wasm:master Apr 6, 2020
@jplevyak jplevyak deleted the proxy-wasm-host branch April 6, 2020 22:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants