db/upnp: break when count==0
Make this non-fatal. Just stop reading more objects.
This commit is contained in:
parent
bfb483898f
commit
7573d4e1ba
@ -191,12 +191,6 @@ ContentDirectoryService::search(UpnpClient_Handle hdl,
|
|||||||
? ParseUnsigned(value)
|
? ParseUnsigned(value)
|
||||||
: 0;
|
: 0;
|
||||||
|
|
||||||
if (count == 0) {
|
|
||||||
// TODO: what's this?
|
|
||||||
error.Set(upnp_domain, "got -1 or 0 entries");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
offset += count;
|
offset += count;
|
||||||
|
|
||||||
value = ixmlwrap::getFirstElementValue(response, "TotalMatches");
|
value = ixmlwrap::getFirstElementValue(response, "TotalMatches");
|
||||||
@ -205,6 +199,9 @@ ContentDirectoryService::search(UpnpClient_Handle hdl,
|
|||||||
|
|
||||||
if (!ReadResultTag(dirbuf, response, error))
|
if (!ReadResultTag(dirbuf, response, error))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
if (count == 0)
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
Reference in New Issue
Block a user