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
44422b2b
Commit
44422b2b
authored
Feb 25, 2019
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
event/ServerSocket, config/Net: abstract socket support
parent
f10afd38
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
39 additions
and
0 deletions
+39
-0
NEWS
NEWS
+1
-0
user.rst
doc/user.rst
+6
-0
Net.cxx
src/config/Net.cxx
+4
-0
ServerSocket.cxx
src/event/ServerSocket.cxx
+16
-0
ServerSocket.hxx
src/event/ServerSocket.hxx
+12
-0
No files found.
NEWS
View file @
44422b2b
ver 0.21.6 (not yet released)
* input
- cdio_paranoia: fix build failure due to missing #include
* support abstract sockets on Linux
ver 0.21.5 (2019/02/22)
* protocol
...
...
doc/user.rst
View file @
44422b2b
...
...
@@ -531,6 +531,12 @@ choice::
bind_to_address "/var/run/mpd/socket"
On Linux, local sockets can be bound to a name without a socket inode
on the filesystem; MPD implements this by prepending ``@`` to the
address::
bind_to_address "@mpd"
If no port is specified, the default port is 6600. This default can
be changed with the port setting::
...
...
src/config/Net.cxx
View file @
44422b2b
...
...
@@ -29,6 +29,10 @@ ServerSocketAddGeneric(ServerSocket &server_socket, const char *address, unsigne
server_socket
.
AddPort
(
port
);
}
else
if
(
address
[
0
]
==
'/'
||
address
[
0
]
==
'~'
)
{
server_socket
.
AddPath
(
ParsePath
(
address
));
#ifdef __linux__
}
else
if
(
address
[
0
]
==
'@'
)
{
server_socket
.
AddAbstract
(
address
);
#endif
}
else
{
server_socket
.
AddHost
(
address
,
port
);
}
...
...
src/event/ServerSocket.cxx
View file @
44422b2b
...
...
@@ -396,3 +396,19 @@ ServerSocket::AddPath(AllocatedPath &&path)
#endif
/* !HAVE_UN */
}
#ifdef __linux__
void
ServerSocket
::
AddAbstract
(
const
char
*
name
)
{
assert
(
name
!=
nullptr
);
assert
(
*
name
==
'@'
);
AllocatedSocketAddress
address
;
address
.
SetLocal
(
name
);
AddAddress
(
std
::
move
(
address
));
}
#endif
src/event/ServerSocket.hxx
View file @
44422b2b
...
...
@@ -99,6 +99,18 @@ public:
*/
void
AddPath
(
AllocatedPath
&&
path
);
#ifdef __linux__
/**
* Add a listener on an abstract local socket (Linux specific).
*
* Throws on error.
*
* @param name the abstract socket name, starting with a '@'
* instead of a null byte
*/
void
AddAbstract
(
const
char
*
name
);
#endif
/**
* Add a socket descriptor that is accepting connections. After this
* has been called, don't call server_socket_open(), because the
...
...
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