Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Xiph.Org
Icecast-Server
Commits
a6ff1cb2
Commit
a6ff1cb2
authored
May 10, 2018
by
Philipp Schafft
🦁
Browse files
Update: Moved compare of two listeners into __listener_cmp()
parent
e661e14b
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/listensocket.c
View file @
a6ff1cb2
...
...
@@ -62,6 +62,25 @@ static inline const char * __string_default(const char *str, const char *def)
return
str
!=
NULL
?
str
:
def
;
}
static
inline
int
__listener_cmp
(
const
listener_t
*
a
,
const
listener_t
*
b
)
{
if
(
a
==
b
)
return
1
;
if
(
a
->
port
!=
b
->
port
)
return
0
;
if
((
a
->
bind_address
==
NULL
&&
b
->
bind_address
!=
NULL
)
||
(
a
->
bind_address
!=
NULL
&&
b
->
bind_address
==
NULL
))
return
0
;
if
(
a
->
bind_address
!=
NULL
&&
b
->
bind_address
!=
NULL
&&
strcmp
(
a
->
bind_address
,
b
->
bind_address
)
!=
0
)
return
0
;
return
1
;
}
static
inline
void
__call_sockcount_cb
(
listensocket_container_t
*
self
)
{
if
(
self
->
sockcount_cb
==
NULL
)
...
...
@@ -358,25 +377,12 @@ static int listensocket_apply_config(listensocket_t *self, const li
return
-
1
;
if
(
listener
!=
self
->
listener
)
{
if
(
listener
->
port
!=
self
->
listener
->
port
)
{
ICECAST_LOG_ERROR
(
"Tried to apply incomplete configuration to listensocket: port missmatch: have %i, got %i"
,
self
->
listener
->
port
,
listener
->
port
);
return
-
1
;
}
if
((
listener
->
bind_address
==
NULL
&&
self
->
listener
->
bind_address
!=
NULL
)
||
(
listener
->
bind_address
!=
NULL
&&
self
->
listener
->
bind_address
==
NULL
)
)
{
ICECAST_LOG_ERROR
(
"Tried to apply incomplete configuration to listensocket: bind address nature missmatch: have %s, got %s"
,
__string_default
(
self
->
listener
->
bind_address
,
"<ANY>"
),
__string_default
(
listener
->
bind_address
,
"<ANY>"
)
);
return
-
1
;
}
if
(
listener
->
bind_address
!=
NULL
&&
self
->
listener
->
bind_address
!=
NULL
&&
strcmp
(
listener
->
bind_address
,
self
->
listener
->
bind_address
)
!=
0
)
{
ICECAST_LOG_ERROR
(
"Tried to apply incomplete configuration to listensocket: bind address value missmatch: have %s, got %s"
,
if
(
__listener_cmp
(
listener
,
self
->
listener
)
!=
1
)
{
ICECAST_LOG_ERROR
(
"Tried to apply incomplete configuration to listensocket: bind address missmatch: have %s:%i, got %s:%i"
,
__string_default
(
self
->
listener
->
bind_address
,
"<ANY>"
),
__string_default
(
listener
->
bind_address
,
"<ANY>"
)
self
->
listener
->
port
,
__string_default
(
listener
->
bind_address
,
"<ANY>"
),
listener
->
port
);
return
-
1
;
}
...
...
Write
Preview
Supports
Markdown
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