db/upnp: require an empty input capability set

This commit is contained in:
Max Kellermann 2014-01-22 20:21:01 +01:00
parent 9fb5134f64
commit a5e7d0a90f
1 changed files with 2 additions and 1 deletions

View File

@ -220,6 +220,8 @@ ContentDirectoryService::getSearchCapabilities(UpnpClient_Handle hdl,
std::set<std::string> &result, std::set<std::string> &result,
Error &error) Error &error)
{ {
assert(result.empty());
IXML_Document *request = IXML_Document *request =
UpnpMakeAction("GetSearchCapabilities", m_serviceType.c_str(), UpnpMakeAction("GetSearchCapabilities", m_serviceType.c_str(),
0, 0,
@ -244,7 +246,6 @@ ContentDirectoryService::getSearchCapabilities(UpnpClient_Handle hdl,
std::string tbuf = ixmlwrap::getFirstElementValue(response, "SearchCaps"); std::string tbuf = ixmlwrap::getFirstElementValue(response, "SearchCaps");
ixmlDocument_free(response); ixmlDocument_free(response);
result.clear();
if (!tbuf.compare("*")) { if (!tbuf.compare("*")) {
result.insert(result.end(), "*"); result.insert(result.end(), "*");
} else if (!tbuf.empty()) { } else if (!tbuf.empty()) {