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 is produced from the address
specification.
  • Loading branch information
jokeyrhyme committed Dec 14, 2024
1 parent a694629 commit 1a91de1
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/bus/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,16 @@ impl Bus {
let (listener, auth_mechanism) = match address.transport() {
#[cfg(unix)]
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 1a91de1

Please sign in to comment.