db/upnp/Discovery: don't copy XML to std::string
Pass "const char *" to Expat.
This commit is contained in:
parent
339d939873
commit
be0759d465
@ -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)
|
||||
{
|
||||
UPnPDeviceParser mparser(*this);
|
||||
Error error;
|
||||
if (!mparser.Parse(description.data(), description.length(), true,
|
||||
if (!mparser.Parse(description, strlen(description), true,
|
||||
error)) {
|
||||
// TODO: pass Error to caller
|
||||
LogError(error);
|
||||
|
@ -82,7 +82,7 @@ public:
|
||||
* @param url where the description came from
|
||||
* @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) {}
|
||||
};
|
||||
|
@ -66,7 +66,7 @@ class UPnPDeviceDirectory {
|
||||
class ContentDirectoryDescriptor {
|
||||
public:
|
||||
ContentDirectoryDescriptor(const std::string &url,
|
||||
const std::string &description,
|
||||
const char *description,
|
||||
time_t last, int exp)
|
||||
:device(url, description), last_seen(last), expires(exp+20) {}
|
||||
UPnPDevice device;
|
||||
|
Loading…
Reference in New Issue
Block a user