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
08e6d222
Commit
08e6d222
authored
Aug 25, 2013
by
Maarten de Vries
Committed by
Max Kellermann
Sep 12, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Listen: Allow tilde paths for socket.
parent
cf98b0e2
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
23 additions
and
4 deletions
+23
-4
NEWS
NEWS
+2
-0
mpd.conf.5
doc/mpd.conf.5
+3
-2
ConfigGlobal.cxx
src/ConfigGlobal.cxx
+6
-0
ConfigGlobal.hxx
src/ConfigGlobal.hxx
+8
-0
Listen.cxx
src/Listen.cxx
+4
-2
No files found.
NEWS
View file @
08e6d222
ver 0.18 (2012/??/??)
* configuration:
- allow tilde paths for socket
* protocol:
- new command "toggleoutput"
* innput:
...
...
doc/mpd.conf.5
View file @
08e6d222
...
...
@@ -77,8 +77,9 @@ 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".
To bind to a Unix domain socket, specify an absolute path or a path starting
with a tilde (~). For a system-wide MPD, we suggest the path
"\fB/var/run/mpd/socket\fP".
.TP
.B port <port>
This specifies the port that mpd listens on. The default is 6600.
...
...
src/ConfigGlobal.cxx
View file @
08e6d222
...
...
@@ -105,6 +105,12 @@ config_get_path(ConfigOption option, Error &error)
if
(
param
==
nullptr
)
return
Path
::
Null
();
return
config_parse_path
(
param
,
error
);
}
Path
config_parse_path
(
const
struct
config_param
*
param
,
Error
&
error
)
{
Path
path
=
ParsePath
(
param
->
value
,
error
);
if
(
gcc_unlikely
(
path
.
IsNull
()))
error
.
FormatPrefix
(
"Invalid path at line %i: "
,
...
...
src/ConfigGlobal.hxx
View file @
08e6d222
...
...
@@ -72,6 +72,14 @@ config_get_string(enum ConfigOption option, const char *default_value);
Path
config_get_path
(
enum
ConfigOption
option
,
Error
&
error
);
/**
* Parse a configuration parameter as a path.
* If there is a tilde prefix, it is expanded. If the path could
* not be parsed, returns Path::Null() and sets the error.
*/
Path
config_parse_path
(
const
struct
config_param
*
param
,
Error
&
error_r
);
gcc_pure
unsigned
config_get_unsigned
(
enum
ConfigOption
option
,
unsigned
default_value
);
...
...
src/Listen.cxx
View file @
08e6d222
...
...
@@ -27,6 +27,7 @@
#include "ConfigOption.hxx"
#include "event/ServerSocket.hxx"
#include "util/Error.hxx"
#include "fs/Path.hxx"
#include <string.h>
#include <assert.h>
...
...
@@ -64,8 +65,9 @@ listen_add_config_param(unsigned int port,
if
(
0
==
strcmp
(
param
->
value
,
"any"
))
{
return
listen_socket
->
AddPort
(
port
,
error_r
);
}
else
if
(
param
->
value
[
0
]
==
'/'
)
{
return
listen_socket
->
AddPath
(
param
->
value
,
error_r
);
}
else
if
(
param
->
value
[
0
]
==
'/'
||
param
->
value
[
0
]
==
'~'
)
{
Path
path
=
config_parse_path
(
param
,
error_r
);
return
!
path
.
IsNull
()
&&
listen_socket
->
AddPath
(
path
.
c_str
(),
error_r
);
}
else
{
return
listen_socket
->
AddHost
(
param
->
value
,
port
,
error_r
);
}
...
...
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