Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
a3f7947a
Commit
a3f7947a
authored
Sep 20, 2011
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server_socket: use resolve_host_port() instead of getaddrinfo()
Allow port specification in "bind_to_address" settings.
parent
7d9d459a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
17 deletions
+9
-17
NEWS
NEWS
+1
-0
mpd.conf.5
doc/mpd.conf.5
+4
-0
server_socket.c
src/server_socket.c
+4
-17
No files found.
NEWS
View file @
a3f7947a
...
...
@@ -20,6 +20,7 @@ ver 0.17 (2011/??/??)
- roar: new output plugin for RoarAudio
* state_file: add option "restore_paused"
* cue: show CUE track numbers
* allow port specification in "bind_to_address" settings
ver 0.16.5 (2010/??/??)
...
...
doc/mpd.conf.5
View file @
a3f7947a
...
...
@@ -83,6 +83,10 @@ This specifies which address mpd binds to and listens on. Multiple
bind_to_address parameters may be specified. The default is "any", which binds
to all available addresses.
You can set a port that is different from the global port setting,
e.g. "localhost:6602". IPv6 addresses must be enclosed in square
brackets if you want to configure a port, e.g. "[::1]:6602".
To bind to a Unix domain socket, specify an absolute path. For a
system-wide MPD, we suggest the path "\fB/var/run/mpd/socket\fP".
.TP
...
...
src/server_socket.c
View file @
a3f7947a
...
...
@@ -380,24 +380,11 @@ server_socket_add_host(struct server_socket *ss, const char *hostname,
unsigned
port
,
GError
**
error_r
)
{
#ifdef HAVE_TCP
struct
addrinfo
hints
;
memset
(
&
hints
,
0
,
sizeof
(
hints
));
hints
.
ai_flags
=
AI_PASSIVE
;
hints
.
ai_family
=
PF_UNSPEC
;
hints
.
ai_socktype
=
SOCK_STREAM
;
hints
.
ai_protocol
=
IPPROTO_TCP
;
char
service
[
20
];
g_snprintf
(
service
,
sizeof
(
service
),
"%u"
,
port
);
struct
addrinfo
*
ai
;
int
ret
=
getaddrinfo
(
hostname
,
service
,
&
hints
,
&
ai
);
if
(
ret
!=
0
)
{
g_set_error
(
error_r
,
server_socket_quark
(),
ret
,
"Failed to look up host
\"
%s
\"
: %s"
,
hostname
,
gai_strerror
(
ret
));
struct
addrinfo
*
ai
=
resolve_host_port
(
hostname
,
port
,
AI_PASSIVE
,
SOCK_STREAM
,
error_r
);
if
(
ai
==
NULL
)
return
false
;
}
for
(
const
struct
addrinfo
*
i
=
ai
;
i
!=
NULL
;
i
=
i
->
ai_next
)
server_socket_add_address
(
ss
,
i
->
ai_addr
,
i
->
ai_addrlen
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment