diff --git a/libresapi/src/api/IdentityHandler.cpp b/libresapi/src/api/IdentityHandler.cpp index 1306f9a54..be2e28622 100644 --- a/libresapi/src/api/IdentityHandler.cpp +++ b/libresapi/src/api/IdentityHandler.cpp @@ -418,8 +418,7 @@ void IdentityHandler::handleGetIdentityDetails(Request& req, Response& resp) } resp.mDataStream << makeKeyValue("pgp_name", pgp_name); - time_t now = time(NULL); - resp.mDataStream << makeKeyValue("last_usage", difftime(now, data.mLastUsageTS)); + resp.mDataStream << makeKeyValue("last_usage", (uint32_t)data.mLastUsageTS); bool isAnonymous = false; if(!data.mPgpKnown) @@ -475,7 +474,7 @@ void IdentityHandler::handleGetIdentityDetails(Request& req, Response& resp) for(std::map::const_iterator it(details.mUseCases.begin()); it != details.mUseCases.end(); ++it) { usagesStream.getStreamToMember() - << makeKeyValue("usage_time", difftime(now, data.mLastUsageTS)) + << makeKeyValue("usage_time", (uint32_t)data.mLastUsageTS) << makeKeyValue("usage_service", (int)(it->first.mServiceId)) << makeKeyValue("usage_case", (int)(it->first.mUsageCode)); } diff --git a/libresapi/src/api/PeersHandler.cpp b/libresapi/src/api/PeersHandler.cpp index dd03f8351..6649acdcb 100644 --- a/libresapi/src/api/PeersHandler.cpp +++ b/libresapi/src/api/PeersHandler.cpp @@ -7,7 +7,6 @@ #include #include -#include #include "Operators.h" #include "ApiTypes.h" @@ -746,12 +745,11 @@ void PeersHandler::handleGetNodeOptions(Request& req, Response& resp) return; } - time_t now = time(NULL); resp.mDataStream << makeKeyValue("peer_id", detail.id.toStdString()); resp.mDataStream << makeKeyValue("name", detail.name); resp.mDataStream << makeKeyValue("location", detail.location); resp.mDataStream << makeKeyValue("pgp_id", detail.gpg_id.toStdString()); - resp.mDataStream << makeKeyValue("last_contact", difftime(now, detail.lastConnect)); + resp.mDataStream << makeKeyValue("last_contact", detail.lastConnect); std::string status_message = mRsMsgs->getCustomStateString(detail.id); resp.mDataStream << makeKeyValueReference("status_message", status_message);