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
7adfea8c
Commit
7adfea8c
authored
Nov 04, 2013
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
system/resolver: return path of UNIX domain sockets
getnameinfo() doesn't work well - it always returns "localhost".
parent
eab1a776
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
7 deletions
+17
-7
NEWS
NEWS
+2
-0
Resolver.cxx
src/system/Resolver.cxx
+15
-7
No files found.
NEWS
View file @
7adfea8c
ver 0.18.1 (2013/11/??)
ver 0.18.1 (2013/11/??)
* protocol:
* protocol:
- always ignore whitespace at the end of the line
- always ignore whitespace at the end of the line
* networking:
- log UNIX domain path names instead of "localhost"
* filter:
* filter:
- autoconvert: fix "volume_normalization" with mp3 files
- autoconvert: fix "volume_normalization" with mp3 files
* add missing files to source tarball
* add missing files to source tarball
...
...
src/system/Resolver.cxx
View file @
7adfea8c
...
@@ -32,6 +32,10 @@
...
@@ -32,6 +32,10 @@
#include <winsock.h>
#include <winsock.h>
#endif
#endif
#ifdef HAVE_UN
#include <sys/un.h>
#endif
#include <string.h>
#include <string.h>
#include <stdio.h>
#include <stdio.h>
...
@@ -40,6 +44,17 @@ const Domain resolver_domain("resolver");
...
@@ -40,6 +44,17 @@ const Domain resolver_domain("resolver");
char
*
char
*
sockaddr_to_string
(
const
struct
sockaddr
*
sa
,
size_t
length
,
Error
&
error
)
sockaddr_to_string
(
const
struct
sockaddr
*
sa
,
size_t
length
,
Error
&
error
)
{
{
#ifdef HAVE_UN
if
(
sa
->
sa_family
==
AF_UNIX
)
{
/* return path of UNIX domain sockets */
const
sockaddr_un
&
s_un
=
*
(
const
sockaddr_un
*
)
sa
;
if
(
length
<
sizeof
(
s_un
)
||
s_un
.
sun_path
[
0
]
==
0
)
return
g_strdup
(
"local"
);
return
g_strdup
(
s_un
.
sun_path
);
}
#endif
#if defined(HAVE_IPV6) && defined(IN6_IS_ADDR_V4MAPPED)
#if defined(HAVE_IPV6) && defined(IN6_IS_ADDR_V4MAPPED)
const
struct
sockaddr_in6
*
a6
=
(
const
struct
sockaddr_in6
*
)
sa
;
const
struct
sockaddr_in6
*
a6
=
(
const
struct
sockaddr_in6
*
)
sa
;
struct
sockaddr_in
a4
;
struct
sockaddr_in
a4
;
...
@@ -70,13 +85,6 @@ sockaddr_to_string(const struct sockaddr *sa, size_t length, Error &error)
...
@@ -70,13 +85,6 @@ sockaddr_to_string(const struct sockaddr *sa, size_t length, Error &error)
return
NULL
;
return
NULL
;
}
}
#ifdef HAVE_UN
if
(
sa
->
sa_family
==
AF_UNIX
)
/* "serv" contains corrupt information with unix
sockets */
return
g_strdup
(
host
);
#endif
#ifdef HAVE_IPV6
#ifdef HAVE_IPV6
if
(
strchr
(
host
,
':'
)
!=
NULL
)
if
(
strchr
(
host
,
':'
)
!=
NULL
)
return
g_strconcat
(
"["
,
host
,
"]:"
,
serv
,
NULL
);
return
g_strconcat
(
"["
,
host
,
"]:"
,
serv
,
NULL
);
...
...
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