Skip to content

Commit

Permalink
Replace : with _ in filename on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
mxinden committed Aug 7, 2024
1 parent 0f960e9 commit 8a0cfb0
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions neqo-bin/src/client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,15 @@ fn qlog_new(args: &Args, hostname: &str, cid: &ConnectionId) -> Res<NeqoQlog> {
let Some(qlog_dir) = args.shared.qlog_dir.clone() else {
return Ok(NeqoQlog::disabled());
};

// hostname might be an IPv6 address, e.g. `[::1]`. `:` is an invalid
// Windows file name character.
#[cfg(windows)]
let hostname: String = hostname
.chars()
.map(|c| if c == ':' { '_' } else { c })
.collect();

NeqoQlog::enabled_with_file(
qlog_dir,
Role::Client,
Expand Down

0 comments on commit 8a0cfb0

Please sign in to comment.