db/upnp/Discovery: don't copy XML to std::string
Pass "const char *" to Expat.
This commit is contained in:
@@ -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:
|
|||||||
* @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 {
|
|||||||
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;
|
||||||
|
Reference in New Issue
Block a user