diff options
author | Max Kellermann <max@duempel.org> | 2014-01-18 13:47:12 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2014-01-18 14:29:31 +0100 |
commit | 22dd3c8048a408a5c045164c439bb2f94b062fa3 (patch) | |
tree | 9165594ed801ce204c4e80d8f5b955ed9c69db86 /src/db/upnp/Discovery.cxx | |
parent | 04b7648e004a5f21c615aa36c0801ae0986baf1e (diff) | |
download | mpd-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 'src/db/upnp/Discovery.cxx')
-rw-r--r-- | src/db/upnp/Discovery.cxx | 18 |
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); |