Stream: git-wasmtime

Topic: wasmtime / PR #15027 wasi-http: Ensure buffered body read...


view this post on Zulip Wasmtime GitHub notifications bot (Oct 27 2026 at 12:52):

adamrk opened PR #15027 from adamrk:abk/http-body-peek-bug to bytecodealliance:main:

When a guest passes an http request/response to the host and the body contains a host provided StreamProducer, we take the fast path of downcasting the stream to the underlying http::Body. But if the guest read from the stream before passing it on, there may be a buffer of data that was read out of the StreamProducer, but not handled by the guest.

This change ensures that that buffered data is included when downcasting to an http::Body. Otherwise it will be silently dropped.

Resolves https://github.com/bytecodealliance/wasmtime/issues/15020

view this post on Zulip Wasmtime GitHub notifications bot (Oct 27 2026 at 12:52):

adamrk removed the review request for wasmtime-wasi-reviewers from PR #15027.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 27 2026 at 12:52):

adamrk requested rvolosatovs for a review on PR #15027.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 27 2026 at 12:52):

adamrk requested wasmtime-wasi-reviewers for a review on PR #15027.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 27 2026 at 12:52):

adamrk removed the review request for wasmtime-core-reviewers from PR #15027.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 27 2026 at 12:52):

adamrk requested wasmtime-core-reviewers for a review on PR #15027.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 27 2026 at 12:52):

adamrk requested pchickey for a review on PR #15027.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 27 2026 at 14:52):

github-actions[bot] added the label wasmtime:api on PR #15027.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 27 2026 at 18:30):

:thumbs_up: rvolosatovs submitted PR review:

LGTM, few minor comments

view this post on Zulip Wasmtime GitHub notifications bot (Oct 27 2026 at 18:30):

:speech_balloon: rvolosatovs created PR review comment:

nit; could we use saturating_add?

view this post on Zulip Wasmtime GitHub notifications bot (Oct 27 2026 at 18:30):

:speech_balloon: rvolosatovs created PR review comment:

Could we split this in at least two frames instead to test that the BodyWithPrefix actually forwards to the wrapped body correctly?

In the current test BodyWithPrefix never reads anything from the inner body, because it's read in full by HostBodyStreamProducer.

We could also consider adding trailers here

view this post on Zulip Wasmtime GitHub notifications bot (Oct 27 2026 at 18:30):

:speech_balloon: rvolosatovs created PR review comment:

What do you think about storing Bytes directly and checking for is_empty() instead of None?

view this post on Zulip Wasmtime GitHub notifications bot (Oct 27 2026 at 18:30):

:speech_balloon: rvolosatovs created PR review comment:

could oneshot::channel().0 be split into a separate assignment with a let, e.g. let (tx, _) = oneshot::channel()?

view this post on Zulip Wasmtime GitHub notifications bot (Oct 27 2026 at 18:30):

:speech_balloon: rvolosatovs created PR review comment:

Could we move this from a comment to a reason with ignore =? See https://doc.rust-lang.org/reference/attributes/testing.html#the-ignore-attribute

view this post on Zulip Wasmtime GitHub notifications bot (Oct 28 2026 at 00:54):

adamrk updated PR #15027.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 28 2026 at 01:22):

:memo: adamrk submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 28 2026 at 01:22):

:speech_balloon: adamrk created PR review comment:

Yeah I was also thinking we should refactor run_http since that channel is really only used for some of the tests. What do you think about this additionally: https://github.com/bytecodealliance/wasmtime/pull/15041 ?

view this post on Zulip Wasmtime GitHub notifications bot (Oct 28 2026 at 01:22):

adamrk requested rvolosatovs for a review on PR #15027.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 28 2026 at 15:13):

:thumbs_up: rvolosatovs submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 28 2026 at 15:13):

:speech_balloon: rvolosatovs created PR review comment:

This should have used saturating_add as well I think

view this post on Zulip Wasmtime GitHub notifications bot (Oct 28 2026 at 16:12):

:memo: rvolosatovs submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 28 2026 at 16:12):

:speech_balloon: rvolosatovs created PR review comment:

Actually, in the highly unlikely edge case of this overflowing saturating add would be wrong, we'd need to use checked_add and set this to None if it did not fit.
I think this is fine as-is.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 28 2026 at 16:12):

rvolosatovs added PR #15027 wasi-http: Ensure buffered body reads aren't dropped when guests pass a host-provided body to the merge queue.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 28 2026 at 16:12):

:speech_balloon: rvolosatovs edited PR review comment.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 28 2026 at 16:36):

:check: rvolosatovs merged PR #15027.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 28 2026 at 16:36):

rvolosatovs removed PR #15027 wasi-http: Ensure buffered body reads aren't dropped when guests pass a host-provided body from the merge queue.


Last updated: Oct 31 2026 at 23:03 UTC