Skip to content
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

Add support for actual hostnames in MPD_HOST #50

Merged
merged 1 commit into from
Jan 28, 2024

Conversation

Polochon-street
Copy link
Owner

No description provided.

@Polochon-street Polochon-street force-pushed the mpd-host-actual-hostname-support branch 2 times, most recently from 1eb4588 to 3236f63 Compare January 24, 2024 20:34
Copy link

@toofar toofar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I cherry picked and tested and it worked for me, thank you!

I tested:

  • remote host by hostname and IP address with and without MPD_PORT set
  • local host by hostname and IP address with and without MPD_PORT
  • unix socket
  • failed connections for TCP (connection refused) and unix socket (no such file or directory)

But this is where MPD parses it: https://github.com/MusicPlayerDaemon/MPD/blob/master/src/config/Net.cxx#L14-L16
So you might want to match that. Looks like paths can theoretically start with ~ and @, examples are in the docs here: https://github.com/MusicPlayerDaemon/MPD/blob/c71e586c530e1d066efde7c2ca40c363f74100c7/doc/user.rst#L779

I'm not sure if rust supports whatever those "abstract sockets" are. rust-lang/rust#14194 is marked as done but apparently you are supposed to pass the name as null? Or the first byte as null? I tried that and it doesn't seem to work (failed to lookup address information: Name or service not known).

@Polochon-street
Copy link
Owner Author

thanks a lot for double-checking - I could make it work with abstract sockets by following rust-lang/rust#42048 (comment)
I tested the various use cases, and everything seems to work 🤞 I'll merge it :)

@Polochon-street Polochon-street merged commit 27f4a42 into master Jan 28, 2024
1 check passed
@Polochon-street Polochon-street deleted the mpd-host-actual-hostname-support branch January 28, 2024 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants