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
spr0cketeer
Icecast-Server
Commits
4e69f554
Commit
4e69f554
authored
Sep 19, 2018
by
Philipp Schafft
🦁
Browse files
Feature: Make the message header configurable
parent
8a08ae25
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/auth_url.c
View file @
4e69f554
...
...
@@ -105,6 +105,7 @@ typedef struct {
/* new style */
char
*
header_auth
;
char
*
header_timelimit
;
char
*
header_message
;
char
*
userpwd
;
CURL
*
handle
;
...
...
@@ -138,6 +139,7 @@ static void auth_url_clear(auth_t *self)
free
(
url
->
timelimit_header
);
free
(
url
->
header_auth
);
free
(
url
->
header_timelimit
);
free
(
url
->
header_message
);
free
(
url
->
userpwd
);
free
(
url
);
}
...
...
@@ -211,9 +213,13 @@ static void handle_returned_header__complete(auth_client *auth_user)
}
}
tmp
=
httpp_getvar
(
au_url
->
parser
,
DEFAULT_HEADER_NEW_MESSAGE
);
if
(
!
tmp
)
tmp
=
httpp_getvar
(
au_url
->
parser
,
DEFAULT_HEADER_OLD_MESSAGE
);
if
(
url
->
header_message
)
{
tmp
=
httpp_getvar
(
au_url
->
parser
,
url
->
header_message
);
}
else
{
tmp
=
httpp_getvar
(
au_url
->
parser
,
DEFAULT_HEADER_NEW_MESSAGE
);
if
(
!
tmp
)
tmp
=
httpp_getvar
(
au_url
->
parser
,
DEFAULT_HEADER_OLD_MESSAGE
);
}
if
(
tmp
)
{
snprintf
(
url
->
errormsg
,
sizeof
(
url
->
errormsg
),
"%s"
,
tmp
);
}
...
...
@@ -597,6 +603,8 @@ int auth_get_url_auth(auth_t *authenticator, config_options_t *options)
replace_string
(
&
(
url_info
->
header_auth
),
options
->
value
);
}
else
if
(
strcmp
(
options
->
name
,
"header_timelimit"
)
==
0
)
{
replace_string
(
&
(
url_info
->
header_timelimit
),
options
->
value
);
}
else
if
(
strcmp
(
options
->
name
,
"header_message"
)
==
0
)
{
replace_string
(
&
(
url_info
->
header_message
),
options
->
value
);
}
else
{
ICECAST_LOG_ERROR
(
"Unknown option: %s"
,
options
->
name
);
}
...
...
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