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
a8545958
Commit
a8545958
authored
Mar 20, 2019
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
event/ServerSocket: runtime error if abstract sockets are unavailable
parent
8fc3c5c6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
9 deletions
+5
-9
Net.cxx
src/config/Net.cxx
+0
-2
ServerSocket.cxx
src/event/ServerSocket.cxx
+5
-5
ServerSocket.hxx
src/event/ServerSocket.hxx
+0
-2
No files found.
src/config/Net.cxx
View file @
a8545958
...
...
@@ -29,10 +29,8 @@ 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 @
a8545958
...
...
@@ -397,12 +397,14 @@ ServerSocket::AddPath(AllocatedPath &&path)
}
#ifdef __linux__
void
ServerSocket
::
AddAbstract
(
const
char
*
name
)
{
#if !defined(HAVE_UN)
#if !defined(__linux__)
(
void
)
name
;
throw
std
::
runtime_error
(
"Abstract sockets are only available on Linux"
);
#elif !defined(HAVE_UN)
(
void
)
name
;
throw
std
::
runtime_error
(
"Local socket support is disabled"
);
...
...
@@ -416,5 +418,3 @@ ServerSocket::AddAbstract(const char *name)
AddAddress
(
std
::
move
(
address
));
#endif
}
#endif
src/event/ServerSocket.hxx
View file @
a8545958
...
...
@@ -99,7 +99,6 @@ public:
*/
void
AddPath
(
AllocatedPath
&&
path
);
#ifdef __linux__
/**
* Add a listener on an abstract local socket (Linux specific).
*
...
...
@@ -109,7 +108,6 @@ public:
* instead of a null byte
*/
void
AddAbstract
(
const
char
*
name
);
#endif
/**
* Add a socket descriptor that is accepting connections. After this
...
...
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