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
5aa1afe6
Commit
5aa1afe6
authored
Dec 16, 2008
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
command: reject unsupported URI schemes
When a client-specified URI has a scheme which is not supported, do not try to open it as a local file, but provide a meaningful error message.
parent
c50115f9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
1 deletion
+11
-1
command.c
src/command.c
+11
-1
No files found.
src/command.c
View file @
5aa1afe6
...
...
@@ -450,6 +450,12 @@ handle_add(struct client *client, G_GNUC_UNUSED int argc, char *argv[])
if
(
isRemoteUrl
(
path
))
return
addToPlaylist
(
path
,
NULL
);
if
(
uri_has_scheme
(
path
))
{
command_error
(
client
,
ACK_ERROR_NO_EXIST
,
"unsupported URI scheme"
);
return
COMMAND_RETURN_ERROR
;
}
result
=
addAllIn
(
path
);
if
(
result
==
(
enum
playlist_result
)
-
1
)
{
command_error
(
client
,
ACK_ERROR_NO_EXIST
,
...
...
@@ -1223,7 +1229,11 @@ handle_playlistadd(struct client *client, G_GNUC_UNUSED int argc, char *argv[])
if
(
isRemoteUrl
(
path
))
result
=
spl_append_uri
(
path
,
playlist
);
else
else
if
(
uri_has_scheme
(
path
))
{
command_error
(
client
,
ACK_ERROR_NO_EXIST
,
"unsupported URI scheme"
);
return
COMMAND_RETURN_ERROR
;
}
else
result
=
addAllInToStoredPlaylist
(
path
,
playlist
);
if
(
result
==
(
enum
playlist_result
)
-
1
)
{
...
...
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