db/upnp/Discovery: eliminate attribute "last_seen"

This commit is contained in:
Max Kellermann 2014-01-18 16:28:12 +01:00
parent 051eede1ed
commit fab6cbed75
2 changed files with 4 additions and 6 deletions

View File

@ -170,7 +170,7 @@ UPnPDeviceDirectory::expireDevices(Error &error)
for (auto it = directories.begin();
it != directories.end();) {
if (now - it->second.last_seen > it->second.expires) {
if (now > it->second.expires) {
it = directories.erase(it);
didsomething = true;
} else {

View File

@ -67,16 +67,14 @@ class UPnPDeviceDirectory {
/**
* The MonotonicClockS() time stamp when this device
* was last seen alive.
* expires.
*/
unsigned last_seen;
unsigned expires; // seconds valid
unsigned expires;
ContentDirectoryDescriptor() = default;
ContentDirectoryDescriptor(unsigned last, int exp)
:last_seen(last), expires(exp+20) {}
:expires(last + exp + 20) {}
bool Parse(const std::string &url, const char *description,
Error &_error) {