Commit be0759d4 authored by Max Kellermann's avatar Max Kellermann

db/upnp/Discovery: don't copy XML to std::string

Pass "const char *" to Expat.
parent 339d9398
...@@ -99,12 +99,12 @@ protected: ...@@ -99,12 +99,12 @@ protected:
} }
}; };
UPnPDevice::UPnPDevice(const std::string &url, const std::string &description) UPnPDevice::UPnPDevice(const std::string &url, const char *description)
:ok(false) :ok(false)
{ {
UPnPDeviceParser mparser(*this); UPnPDeviceParser mparser(*this);
Error error; Error error;
if (!mparser.Parse(description.data(), description.length(), true, if (!mparser.Parse(description, strlen(description), true,
error)) { error)) {
// TODO: pass Error to caller // TODO: pass Error to caller
LogError(error); LogError(error);
......
...@@ -82,7 +82,7 @@ public: ...@@ -82,7 +82,7 @@ public:
* @param url where the description came from * @param url where the description came from
* @param description the xml device description * @param description the xml device description
*/ */
UPnPDevice(const std::string &url, const std::string &description); UPnPDevice(const std::string &url, const char *description);
UPnPDevice() : ok(false) {} UPnPDevice() : ok(false) {}
}; };
......
...@@ -66,7 +66,7 @@ class UPnPDeviceDirectory { ...@@ -66,7 +66,7 @@ class UPnPDeviceDirectory {
class ContentDirectoryDescriptor { class ContentDirectoryDescriptor {
public: public:
ContentDirectoryDescriptor(const std::string &url, ContentDirectoryDescriptor(const std::string &url,
const std::string &description, const char *description,
time_t last, int exp) time_t last, int exp)
:device(url, description), last_seen(last), expires(exp+20) {} :device(url, description), last_seen(last), expires(exp+20) {}
UPnPDevice device; UPnPDevice device;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment