aboutsummaryrefslogtreecommitdiffstats
path: root/src/db/upnp/Discovery.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-01-18 13:47:12 +0100
committerMax Kellermann <max@duempel.org>2014-01-18 14:29:31 +0100
commit22dd3c8048a408a5c045164c439bb2f94b062fa3 (patch)
tree9165594ed801ce204c4e80d8f5b955ed9c69db86 /src/db/upnp/Discovery.cxx
parent04b7648e004a5f21c615aa36c0801ae0986baf1e (diff)
downloadmpd-22dd3c8048a408a5c045164c439bb2f94b062fa3.tar.gz
mpd-22dd3c8048a408a5c045164c439bb2f94b062fa3.tar.xz
mpd-22dd3c8048a408a5c045164c439bb2f94b062fa3.zip
db/upnp/Device: move code to method Parse()
Forward the Error to the caller.
Diffstat (limited to '')
-rw-r--r--src/db/upnp/Discovery.cxx18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/db/upnp/Discovery.cxx b/src/db/upnp/Discovery.cxx
index b5c6b5f92..5e6479b3d 100644
--- a/src/db/upnp/Discovery.cxx
+++ b/src/db/upnp/Discovery.cxx
@@ -22,6 +22,7 @@
#include "Domain.hxx"
#include "ContentDirectoryService.hxx"
#include "upnpplib.hxx"
+#include "Log.hxx"
#include <upnp/upnptools.h>
@@ -73,12 +74,17 @@ UPnPDeviceDirectory::discoExplorer()
}
// Update or insert the device
- ContentDirectoryDescriptor d(tsk->url, buf,
- time(0), tsk->expires);
- free(buf);
- if (!d.device.ok) {
- delete tsk;
- continue;
+ ContentDirectoryDescriptor d(time(0), tsk->expires);
+
+ {
+ Error error2;
+ bool success = d.Parse(tsk->url, buf, error2);
+ free(buf);
+ if (!success) {
+ delete tsk;
+ LogError(error2);
+ continue;
+ }
}
const ScopeLock protect(mutex);