aboutsummaryrefslogtreecommitdiffstats
path: root/src/db/upnp
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-01-22 21:33:19 +0100
committerMax Kellermann <max@duempel.org>2014-01-22 21:33:19 +0100
commit7573d4e1ba2de203021201818d25d003213cefa8 (patch)
tree6bce6c2ac81c9df4cfa754fea78a36ed80b0c169 /src/db/upnp
parentbfb483898f53b2c505ba2e6a6885402a86bf131e (diff)
downloadmpd-7573d4e1ba2de203021201818d25d003213cefa8.tar.gz
mpd-7573d4e1ba2de203021201818d25d003213cefa8.tar.xz
mpd-7573d4e1ba2de203021201818d25d003213cefa8.zip
db/upnp: break when count==0
Make this non-fatal. Just stop reading more objects.
Diffstat (limited to 'src/db/upnp')
-rw-r--r--src/db/upnp/ContentDirectoryService.cxx9
1 files changed, 3 insertions, 6 deletions
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;