Skip to content

wasi-http: Send error to guest from forwarded body - #15042

Open
adamrk wants to merge 4 commits into
bytecodealliance:mainfrom
adamrk:abk/hyper-error-to-guest
Open

adamrk wants to merge 4 commits into
bytecodealliance:mainfrom
adamrk:abk/hyper-error-to-guest

Conversation

@adamrk

@adamrk adamrk commented Oct 28, 2026 •

Copy link
Copy Markdown
Member

Ensure that an error encountered when sending a request or response body is delivered to the associated transmit future when the body is coming from another host body which has been forwarded.

Previously a guest which forwards a request or response would have no way to see if the request/response body was delivered without error. For example, if the original sender passed a body with incorrect content length or if it dropped the connection before completion, the guest would still receive Ok(()) on the transmission future.

Depends on #15041 for testing.

@adamrk
adamrk requested review from a team as code owners October 28, 2026 12:58
@adamrk
adamrk requested review from cfallin and rvolosatovs and removed request for a team October 28, 2026 12:58
@adamrk
adamrk force-pushed the abk/hyper-error-to-guest branch from a7ac3aa to e4f0989 Compare October 29, 2026 12:57
The `run_http` test helper currently takes a channel and sends the
uncollected http request down that channel for the caller to see. But
only a few tests actually use that and it can otherwise be difficult
because the request body many never actually be read and a guest program
can be left hanging if it awaits that.

This change hopefully makes `run_http` more intuitive by not taking the
channel and in general reading the full request body. The new version
`run_http_get_forwarded_request` can be used if the caller needs to see
how the request was passed along and the new endpoint
`p3-test-immediate-response` can be used when the test needs a response
to be sent without the body being read.
Ensure that an error encountered when sending a request or response body
is delivered to the associated `transmit` future when the body is coming
from another host body which has been forwarded.

Previously a guest which forwards a request or response would have
no way to see if the request/response body was delivered without error.
For example, if the original sender passed a body with incorrect content
length or if it dropped the connection before completion, the guest
would still receive `Ok(())` on the transmission future.
@adamrk
adamrk force-pushed the abk/hyper-error-to-guest branch from e4f0989 to f742a25 Compare October 29, 2026 19:19
@adamrk
adamrk force-pushed the abk/hyper-error-to-guest branch from f742a25 to 9dd3d9b Compare October 29, 2026 19:31

This branch has not been deployed

No deployments
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.

1 participant