mirror of
https://github.com/oxen-io/lokinet.git
synced 2024-11-15 12:13:24 +00:00
273270916e
This commit reflects changes to clang-format rules. Unfortunately, these rule changes create a massive change to the codebase, which causes an apparent rewrite of git history. Git blame's --ignore-rev flag can be used to ignore this commit when attempting to `git blame` some code.
26 lines
700 B
C++
26 lines
700 B
C++
#include <service/session.hpp>
|
|
|
|
namespace llarp
|
|
{
|
|
namespace service
|
|
{
|
|
util::StatusObject
|
|
Session::ExtractStatus() const
|
|
{
|
|
util::StatusObject obj{{"lastUsed", to_json(lastUsed)},
|
|
{"replyIntro", replyIntro.ExtractStatus()},
|
|
{"remote", remote.Addr().ToString()},
|
|
{"seqno", seqno},
|
|
{"intro", intro.ExtractStatus()}};
|
|
return obj;
|
|
}
|
|
|
|
bool
|
|
Session::IsExpired(llarp_time_t now, llarp_time_t lifetime) const
|
|
{
|
|
return now > lastUsed && (now - lastUsed > lifetime || intro.IsExpired(now));
|
|
}
|
|
|
|
} // namespace service
|
|
} // namespace llarp
|