-
Notifications
You must be signed in to change notification settings - Fork 35
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
Add get_addr_dest_{ip,port}
hostcalls
#402
Conversation
416f605
to
6a1d87a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like your idea to encode enough information to check if set_pass
had been called -- it would be great if this was a pretty faithful reproduction of production behavior.
lib/src/upstream.rs
Outdated
} | ||
|
||
impl Connection { | ||
fn metadata(&self) -> ConnMetadata { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a mild preference for returning a &ConnMetadata
here and pushing the clone
to the callsite, but given that this isn't exported beyond this module I could go either way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in 10b6237!
Done in 270928a. I've added a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks for addressing @elliottt's comments!
This adds the
get_addr_dest_ip
andget_addr_dest_port
hostcalls which will be part of the upcoming SDK release. They allow getting the IP and port used to connect to a backend from theResponseHandle
.There is a difference in behaviour here worth calling out: in Compute, this is only currently supported when using
.set_pass(true)
on theRequest
. Since Viceroy doesn't have any concept of caching/direct pass at the moment, I wasn't sure whether I should add enough code to check whether the guest code had at least requested direct pass or not, and limit support so that things match what applications deployed to Compute will see.