@@ -55,6 +55,19 @@ handle_lsinfo2(Client &client, const char *uri, Response &r)
|
||||
return CommandResult::OK;
|
||||
}
|
||||
|
||||
static TagType
|
||||
ParseSortTag(const char *s)
|
||||
{
|
||||
if (StringIsEqualIgnoreCase(s, "Last-Modified"))
|
||||
return TagType(SORT_TAG_LAST_MODIFIED);
|
||||
|
||||
TagType tag = tag_name_parse_i(s);
|
||||
if (tag == TAG_NUM_OF_ITEM_TYPES)
|
||||
throw ProtocolError(ACK_ERROR_ARG, "Unknown sort tag");
|
||||
|
||||
return tag;
|
||||
}
|
||||
|
||||
static CommandResult
|
||||
handle_match(Client &client, Request args, Response &r, bool fold_case)
|
||||
{
|
||||
@@ -76,9 +89,7 @@ handle_match(Client &client, Request args, Response &r, bool fold_case)
|
||||
++s;
|
||||
}
|
||||
|
||||
sort = tag_name_parse_i(s);
|
||||
if (sort == TAG_NUM_OF_ITEM_TYPES)
|
||||
throw ProtocolError(ACK_ERROR_ARG, "Unknown sort tag");
|
||||
sort = ParseSortTag(s);
|
||||
|
||||
args.pop_back();
|
||||
args.pop_back();
|
||||
|
Reference in New Issue
Block a user