From 7573d4e1ba2de203021201818d25d003213cefa8 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 22 Jan 2014 21:33:19 +0100 Subject: db/upnp: break when count==0 Make this non-fatal. Just stop reading more objects. --- src/db/upnp/ContentDirectoryService.cxx | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'src/db/upnp') diff --git a/src/db/upnp/ContentDirectoryService.cxx b/src/db/upnp/ContentDirectoryService.cxx index 62f39c7d0..9068b2e30 100644 --- a/src/db/upnp/ContentDirectoryService.cxx +++ b/src/db/upnp/ContentDirectoryService.cxx @@ -191,12 +191,6 @@ ContentDirectoryService::search(UpnpClient_Handle hdl, ? ParseUnsigned(value) : 0; - if (count == 0) { - // TODO: what's this? - error.Set(upnp_domain, "got -1 or 0 entries"); - return false; - } - offset += count; value = ixmlwrap::getFirstElementValue(response, "TotalMatches"); @@ -205,6 +199,9 @@ ContentDirectoryService::search(UpnpClient_Handle hdl, if (!ReadResultTag(dirbuf, response, error)) return false; + + if (count == 0) + break; } return true; -- cgit v1.2.3