Skip to content

Commit

Permalink
More edits
Browse files Browse the repository at this point in the history
  • Loading branch information
maddeleine committed Mar 1, 2025
1 parent 6bac050 commit b836698
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
10 changes: 5 additions & 5 deletions quic/s2n-quic-core/src/connection/limits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,18 +57,18 @@ impl<'a> ConnectionInfo<'a> {

#[non_exhaustive]
#[derive(Debug)]
pub struct PostHandshakeInfo<'a> {
pub struct HandshakeInfo<'a> {
pub remote_address: SocketAddress<'a>,
pub server_name: Option<&'a ServerName>,
pub application_protocol: &'a Bytes,
}

impl<'a> PostHandshakeInfo<'a> {
impl<'a> HandshakeInfo<'a> {
pub fn new(
remote_address: &'a inet::SocketAddress,
server_name: Option<&'a ServerName>,
application_protocol: &'a Bytes,
) -> PostHandshakeInfo<'a> {
) -> HandshakeInfo<'a> {
Self {
remote_address: remote_address.into_event(),
server_name,
Expand Down Expand Up @@ -442,7 +442,7 @@ pub trait Limiter: 'static + Send {
/// Provides another opportunity to change connection limits with information
/// from the handshake
#[inline]
fn on_post_handshake(&mut self, info: &PostHandshakeInfo, limits: &mut UpdatableLimits) {
fn on_post_handshake(&mut self, info: &HandshakeInfo, limits: &mut UpdatableLimits) {
let _ = info;
let _ = limits;
}
Expand All @@ -454,7 +454,7 @@ impl Limiter for Limits {
*self
}

fn on_post_handshake(&mut self, _info: &PostHandshakeInfo, _limits: &mut UpdatableLimits) {}
fn on_post_handshake(&mut self, _info: &HandshakeInfo, _limits: &mut UpdatableLimits) {}
}

#[cfg(test)]
Expand Down
7 changes: 2 additions & 5 deletions quic/s2n-quic-transport/src/space/session_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use s2n_quic_core::{
ack,
application::ServerName,
connection::{
limits::{Limiter, PostHandshakeInfo, UpdatableLimits},
limits::{HandshakeInfo, Limiter, UpdatableLimits},
InitialId, PeerId,
},
crypto::{
Expand Down Expand Up @@ -418,7 +418,7 @@ impl<Config: endpoint::Config, Pub: event::ConnectionPublisher>
};

let remote_address = self.path_manager.active_path().remote_address().0;
let info = PostHandshakeInfo::new(
let info = HandshakeInfo::new(
&remote_address,
self.server_name.as_ref(),
self.application_protocol,
Expand All @@ -427,8 +427,6 @@ impl<Config: endpoint::Config, Pub: event::ConnectionPublisher>
self.limits_endpoint
.on_post_handshake(&info, &mut updatable_limits);

println!("{:?}", self.limits);

self.local_id_registry
.set_active_connection_id_limit(active_connection_id_limit.as_u64());

Expand Down Expand Up @@ -516,7 +514,6 @@ impl<Config: endpoint::Config, Pub: event::ConnectionPublisher>
chosen_server_name: &server_name,
});
*self.server_name = Some(server_name);
println!("SERVER NAME: {:?}", self.server_name);

Ok(())
}
Expand Down
2 changes: 1 addition & 1 deletion quic/s2n-quic/src/provider/limits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//! Provides limits support for a connection
pub use s2n_quic_core::connection::limits::{
ConnectionInfo, Limiter, Limits, PostHandshakeInfo, UpdatableLimits,
ConnectionInfo, Limiter, Limits, HandshakeInfo, UpdatableLimits,
};

pub trait Provider {
Expand Down

0 comments on commit b836698

Please sign in to comment.