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
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
spr0cketeer
Icecast-Server
Commits
0bdad13f
Commit
0bdad13f
authored
Oct 26, 2018
by
Philipp Schafft
🦁
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Feature: Implemented DELETE on sources
parent
ccca2460
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
2 deletions
+20
-2
src/cfgfile.c
src/cfgfile.c
+2
-2
src/connection.c
src/connection.c
+18
-0
No files found.
src/cfgfile.c
View file @
0bdad13f
...
...
@@ -1101,7 +1101,7 @@ static void _parse_root(xmlDocPtr doc,
"legacy-global-source"
,
AUTH_TYPE_STATIC
,
"source"
,
source_password
,
NULL
,
"source,put,get"
,
0
,
"*"
);
"source,put,get
,delete
"
,
0
,
"*"
);
}
}
else
{
ICECAST_LOG_ERROR
(
"Can not find nor create default mount, but "
...
...
@@ -1990,7 +1990,7 @@ static void _parse_authentication(xmlDocPtr doc, xmlNodePtr node,
if
(
admin_password
&&
admin_username
)
__append_old_style_auth
(
&
old_style
,
"legacy-admin"
,
AUTH_TYPE_STATIC
,
admin_username
,
admin_password
,
NULL
,
"get,post,head,stats,options"
,
1
,
"*"
);
admin_username
,
admin_password
,
NULL
,
"get,post,head,stats,options
,delete
"
,
1
,
"*"
);
if
(
relay_password
&&
relay_username
)
__append_old_style_auth
(
&
old_style
,
"legacy-relay"
,
AUTH_TYPE_STATIC
,
...
...
src/connection.c
View file @
0bdad13f
...
...
@@ -1066,6 +1066,21 @@ static void _handle_get_request(client_t *client) {
}
}
static
void
_handle_delete_request
(
client_t
*
client
)
{
source_t
*
source
;
avl_tree_wlock
(
global
.
source_tree
);
source
=
source_find_mount_raw
(
client
->
uri
);
if
(
source
)
{
source
->
running
=
0
;
avl_tree_unlock
(
global
.
source_tree
);
client_send_204
(
client
);
}
else
{
avl_tree_unlock
(
global
.
source_tree
);
client_send_error_by_id
(
client
,
ICECAST_ERROR_CON_UNKNOWN_REQUEST
);
}
}
static
void
_handle_shoutcast_compatible
(
client_queue_t
*
node
)
{
char
*
http_compliant
;
...
...
@@ -1328,6 +1343,9 @@ static void _handle_authed_client(client_t *client, void *userdata, auth_result
case
httpp_req_options
:
_handle_get_request
(
client
);
break
;
case
httpp_req_delete
:
_handle_delete_request
(
client
);
break
;
default:
ICECAST_LOG_ERROR
(
"Wrong request type from client"
);
client_send_error_by_id
(
client
,
ICECAST_ERROR_CON_UNKNOWN_REQUEST
);
...
...
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