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

proto: Minor refactors to Endpoint.handle #2112

Merged
merged 2 commits into from
Dec 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 8 additions & 15 deletions quinn-proto/src/endpoint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ impl Endpoint {
first_decode,
remaining,
};
match route_to {
return match route_to {
RouteDatagramTo::Incoming(incoming_idx) => {
let incoming_buffer = &mut self.incoming_buffers[incoming_idx];
let config = &self.server_config.as_ref().unwrap();
Expand All @@ -226,15 +226,13 @@ impl Endpoint {
self.all_incoming_buffers_total_bytes += datagram_len as u64;
}

return None;
}
RouteDatagramTo::Connection(ch) => {
return Some(DatagramEvent::ConnectionEvent(
ch,
ConnectionEvent(ConnectionEventInner::Datagram(event)),
))
None
}
}
RouteDatagramTo::Connection(ch) => Some(DatagramEvent::ConnectionEvent(
ch,
ConnectionEvent(ConnectionEventInner::Datagram(event)),
)),
};
}

//
Expand Down Expand Up @@ -301,12 +299,7 @@ impl Endpoint {
// connection. Send a stateless reset if possible.
//

if !first_decode.is_initial()
&& self
.local_cid_generator
.validate(first_decode.dst_cid())
.is_err()
{
if !first_decode.is_initial() && self.local_cid_generator.validate(dst_cid).is_err() {
debug!("dropping packet with invalid CID");
return None;
}
Expand Down
Loading