Skip to content

Commit

Permalink
πŸ› Expose the socket address clients can use
Browse files Browse the repository at this point in the history
Until now, `--print-address` would print the address specification,
that is, the input used to determine how and where the server would
listen. This would be useful for clients for `unix:path=...`, but for
`unix:dir=...` and `unix:tmpdir=...` this would not work. So now we
share the socket address that we produce from the address
specification.
  • Loading branch information
jokeyrhyme committed Jan 8, 2025
1 parent 2e7f073 commit 4bee358
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/bus/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,14 @@ impl Bus {
Transport::Unix(unix) => {
// Resolve address specification into address that clients can use.
let addr = Self::unix_addr(unix)?;

(Self::unix_stream(addr).await?, AuthMechanism::External)
address = Address::try_from(
format!("unix:path={}", addr.as_pathname().unwrap().display()).as_str(),
)?;

(
Self::unix_stream(addr.clone()).await?,
AuthMechanism::External,
)
}
Transport::Tcp(tcp) => {
#[cfg(not(windows))]
Expand Down

0 comments on commit 4bee358

Please sign in to comment.