diff --git a/src/client/Process.cxx b/src/client/Process.cxx index 401244eef..f8b4340a6 100644 --- a/src/client/Process.cxx +++ b/src/client/Process.cxx @@ -55,6 +55,16 @@ Client::ProcessCommandList(bool list_ok, CommandResult Client::ProcessLine(char *line) noexcept { + 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\"", + num, line); + return CommandResult::CLOSE; + } + CommandResult ret; if (StringIsEqual(line, "noidle")) { @@ -119,14 +129,6 @@ Client::ProcessLine(char *line) noexcept } else if (StringIsEqual(line, CLIENT_LIST_OK_MODE_BEGIN)) { 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\"", - num, line); - ret = CommandResult::CLOSE; } else { FormatDebug(client_domain, "[%u] process command \"%s\"",