-
Notifications
You must be signed in to change notification settings - Fork 4
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
Update integration tests, fix some networking bugs #19
Conversation
b992ced
to
bcada81
Compare
4a343cb
to
774a171
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 see now that I forgot to submit my review earlier 😅
/// | ||
/// - a stream of incoming QUIC connections | ||
/// - server certificate serialized into DER format | ||
#[allow(unused)] |
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.
This allow
attribute can be deleted?
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.
Yes, should be fixed in a follow-up commit
#[allow(unused)] | ||
pub fn make_server_endpoint( | ||
bind_addr: SocketAddr, | ||
) -> Result<(Endpoint, Vec<u8>), Error> { |
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.
Should drop the Vec<u8>
parameter here imo, as it's just swallowed in Net::new
let connecting = self.client.connect(addr, "localhost")?; | ||
let connecting = self.server.connect(addr, "localhost")?; |
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.
It looks like this is the actual "meat" of the commit? For next time it'd be grand to have those things in separate commits
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.
Spent some time poking around here before I actually understood what's new, and what's just refactors
/// Saturating predecessor of a log level | ||
fn saturating_pred_level(log_level: tracing::Level) -> tracing::Level { | ||
match log_level { | ||
tracing::Level::TRACE => tracing::Level::DEBUG, | ||
tracing::Level::DEBUG => tracing::Level::INFO, | ||
tracing::Level::INFO => tracing::Level::WARN, | ||
tracing::Level::WARN => tracing::Level::ERROR, | ||
tracing::Level::ERROR => tracing::Level::ERROR, | ||
} | ||
} | ||
|
||
/// The empty string target `""` can be used to set a default level. | ||
fn targets_directive_str<'a, Targets>(targets: Targets) -> String | ||
where | ||
Targets: IntoIterator<Item = (&'a str, tracing::Level)>, | ||
{ | ||
targets | ||
.into_iter() | ||
.map(|(target, level)| { | ||
let level = level.as_str().to_ascii_lowercase(); | ||
if target.is_empty() { | ||
level | ||
} else { | ||
format!("{target}={level}") | ||
} | ||
}) | ||
.collect::<Vec<_>>() | ||
.join(",") | ||
} | ||
|
||
// Configure logger. | ||
fn set_tracing_subscriber(log_level: tracing::Level) -> anyhow::Result<()> { |
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.
A bunch of this log configuration logic feels like it should be possible to deduplicate. Aren't we doing more or less the exact same thing multiple places now?
No description provided.