ClientProcess: close connection when client sends HTTP request
This commit is contained in:
parent
b177bffa6a
commit
ab05b70423
1
NEWS
1
NEWS
|
@ -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 @@
|
||||||
#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)
|
||||||
} 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\"",
|
||||||
|
|
Loading…
Reference in New Issue