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
d40c4394
Commit
d40c4394
authored
Feb 24, 2009
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
listen: don't call listen_add_config_param(NULL)
For default bind_to_address settings, don't call listen_add_config_param(NULL), use listen_add_port() directly.
parent
739c23cc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
10 deletions
+25
-10
listen.c
src/listen.c
+25
-10
No files found.
src/listen.c
View file @
d40c4394
...
...
@@ -29,6 +29,7 @@
#include <errno.h>
#include <unistd.h>
#include <stdlib.h>
#include <assert.h>
#ifdef WIN32
#include <ws2tcpip.h>
...
...
@@ -333,7 +334,9 @@ listen_add_config_param(unsigned int port,
const
struct
config_param
*
param
,
GError
**
error
)
{
if
(
!
param
||
0
==
strcmp
(
param
->
value
,
"any"
))
{
assert
(
param
!=
NULL
);
if
(
0
==
strcmp
(
param
->
value
,
"any"
))
{
return
listen_add_port
(
port
,
error
);
#ifdef HAVE_UN
}
else
if
(
param
->
value
[
0
]
==
'/'
)
{
...
...
@@ -352,18 +355,30 @@ void listen_global_init(void)
bool
success
;
GError
*
error
=
NULL
;
do
{
success
=
listen_add_config_param
(
port
,
param
,
&
error
);
if
(
!
success
)
{
if
(
param
!=
NULL
)
if
(
param
!=
NULL
)
{
/* "bind_to_address" is configured, create listeners
for all values */
do
{
success
=
listen_add_config_param
(
port
,
param
,
&
error
);
if
(
!
success
)
g_error
(
"Failed to listen on %s (line %i): %s"
,
param
->
value
,
param
->
line
,
error
->
message
);
else
g_error
(
"Failed to listen on *:%d: %s"
,
port
,
error
->
message
);
}
}
while
((
param
=
config_get_next_param
(
CONF_BIND_TO_ADDRESS
,
param
)));
param
=
config_get_next_param
(
CONF_BIND_TO_ADDRESS
,
param
);
}
while
(
param
!=
NULL
);
}
else
{
/* no "bind_to_address" configured, bind the
configured port on all interfaces */
success
=
listen_add_port
(
port
,
&
error
);
if
(
!
success
)
g_error
(
"Failed to listen on *:%d: %s"
,
port
,
error
->
message
);
}
listen_port
=
port
;
}
...
...
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