-
Notifications
You must be signed in to change notification settings - Fork 98
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
Implementation of endpoint_send_filter #58
Conversation
This includes passing the FilterChain into the Session, so that is can call endpoint_send_filter when sending data out through the endpoint. Work on #1
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.
Looks good! only a minor comment on possibly making send_to
return type more explicit
src/server/sessions.rs
Outdated
session.send_to(msg.as_bytes()).await.unwrap(); | ||
assert_eq!(msg, wait.await.unwrap()); | ||
|
||
// with a filters |
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.
'filters' should be 'filter' ?
src/server/sessions.rs
Outdated
return self.send.send_to(data.as_slice(), &self.dest.address).await; | ||
} | ||
|
||
Ok(0) |
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.
Could we change the return type for this function to e.g Result<Option<size>>
or similar enum that would allow the caller to differentiate between a dropped packet and a packet without payload (that could have size 0?)? In the drop case the returned value would be e.g Ok(None)
so that we won't have to worry about cases where size 0 might be special.
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.
Strong agree on this one, indeed.
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.
Excellent suggestion. Will jump on it 👍
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!
This includes passing the FilterChain into the Session, so that is can
call endpoint_send_filter when sending data out through the endpoint.
Work on #1