Commit ab05b704 authored by Max Kellermann's avatar Max Kellermann Committed by Max Kellermann

ClientProcess: close connection when client sends HTTP request

parent b177bffa
...@@ -2,6 +2,7 @@ ver 0.21 (not yet released) ...@@ -2,6 +2,7 @@ ver 0.21 (not yet released)
* protocol * protocol
- "tagtypes" can be used to hide tags - "tagtypes" can be used to hide tags
- "find" and "search" can sort - "find" and "search" can sort
- close connection when client sends HTTP request
* tags * tags
- new tag "OriginalDate" - new tag "OriginalDate"
* decoder * decoder
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#include "command/AllCommands.hxx" #include "command/AllCommands.hxx"
#include "Log.hxx" #include "Log.hxx"
#include "util/StringAPI.hxx" #include "util/StringAPI.hxx"
#include "util/CharUtil.hxx"
#define CLIENT_LIST_MODE_BEGIN "command_list_begin" #define CLIENT_LIST_MODE_BEGIN "command_list_begin"
#define CLIENT_LIST_OK_MODE_BEGIN "command_list_ok_begin" #define CLIENT_LIST_OK_MODE_BEGIN "command_list_ok_begin"
...@@ -118,6 +119,14 @@ client_process_line(Client &client, char *line) ...@@ -118,6 +119,14 @@ client_process_line(Client &client, char *line)
} else if (StringIsEqual(line, CLIENT_LIST_OK_MODE_BEGIN)) { } else if (StringIsEqual(line, CLIENT_LIST_OK_MODE_BEGIN)) {
client.cmd_list.Begin(true); client.cmd_list.Begin(true);
ret = CommandResult::OK; ret = CommandResult::OK;
} else if (IsUpperAlphaASCII(*line)) {
/* no valid MPD command begins with an upper
case letter; this could be a badly routed
HTTP request */
FormatWarning(client_domain,
"[%u] malformed command \"%s\"",
client.num, line);
ret = CommandResult::CLOSE;
} else { } else {
FormatDebug(client_domain, FormatDebug(client_domain,
"[%u] process command \"%s\"", "[%u] process command \"%s\"",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment