ClientProcess: close connection when client sends HTTP request

This commit is contained in:
Max Kellermann 2014-08-12 14:39:30 +02:00 committed by Max Kellermann
parent b177bffa6a
commit ab05b70423
2 changed files with 10 additions and 0 deletions

1
NEWS
View File

@ -2,6 +2,7 @@ ver 0.21 (not yet released)
* protocol
- "tagtypes" can be used to hide tags
- "find" and "search" can sort
- close connection when client sends HTTP request
* tags
- new tag "OriginalDate"
* decoder

View File

@ -23,6 +23,7 @@
#include "command/AllCommands.hxx"
#include "Log.hxx"
#include "util/StringAPI.hxx"
#include "util/CharUtil.hxx"
#define CLIENT_LIST_MODE_BEGIN "command_list_begin"
#define CLIENT_LIST_OK_MODE_BEGIN "command_list_ok_begin"
@ -118,6 +119,14 @@ client_process_line(Client &client, char *line)
} else if (StringIsEqual(line, CLIENT_LIST_OK_MODE_BEGIN)) {
client.cmd_list.Begin(true);
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 {
FormatDebug(client_domain,
"[%u] process command \"%s\"",