Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Icecast-Server
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
93
Issues
93
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
External Wiki
External Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Xiph.Org
Icecast-Server
Commits
6c0b0e29
Commit
6c0b0e29
authored
May 28, 2018
by
Philipp Schafft
🦁
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update: Make the alias dereferencing loop more easy
parent
306cc58d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
13 deletions
+28
-13
src/connection.c
src/connection.c
+28
-13
No files found.
src/connection.c
View file @
6c0b0e29
...
...
@@ -1107,11 +1107,28 @@ static int _handle_aliases(client_t *client, char **uri)
alias
=
config
->
aliases
;
while
(
alias
)
{
if
(
strcmp
(
*
uri
,
alias
->
source
)
==
0
&&
(
alias
->
port
==
-
1
||
alias
->
port
==
serverport
)
&&
(
alias
->
bind_address
==
NULL
||
(
serverhost
!=
NULL
&&
strcmp
(
alias
->
bind_address
,
serverhost
)
==
0
))
&&
(
alias
->
vhost
==
NULL
||
(
vhost
!=
NULL
&&
strcmp
(
alias
->
vhost
,
vhost
)
==
0
))
)
{
/* We now go thru all aliases and see if any matches. */
for
(;
alias
;
alias
=
alias
->
next
)
{
/* We check for several aspects, if they DO NOT match, we continue with our search. */
/* Check for the URI to match. */
if
(
strcmp
(
*
uri
,
alias
->
source
)
!=
0
)
continue
;
/* Check for the server's port to match. */
if
(
alias
->
port
!=
-
1
&&
alias
->
port
!=
serverport
)
continue
;
/* Check for the server's bind address to match. */
if
(
alias
->
bind_address
!=
NULL
&&
serverhost
!=
NULL
&&
strcmp
(
alias
->
bind_address
,
serverhost
)
!=
0
)
continue
;
/* Check for the vhost to match. */
if
(
alias
->
vhost
!=
NULL
&&
vhost
!=
NULL
&&
strcmp
(
alias
->
vhost
,
vhost
)
!=
0
)
continue
;
/* Ok, we found a matching entry. */
if
(
alias
->
destination
)
new_uri
=
strdup
(
alias
->
destination
);
if
(
alias
->
omode
!=
OMODE_DEFAULT
)
...
...
@@ -1119,8 +1136,6 @@ static int _handle_aliases(client_t *client, char **uri)
ICECAST_LOG_DEBUG
(
"alias has made %s into %s"
,
*
uri
,
new_uri
);
break
;
}
alias
=
alias
->
next
;
}
config_release_config
();
...
...
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