tools: Showing ExpirationPeriod if it is present in FaceStatus
Change-Id: I8e5b1350179830a1d12866c02c16393068e06369
Refs: #1686
diff --git a/daemon/face/udp-face.cpp b/daemon/face/udp-face.cpp
index d4fe8cf..843d48f 100644
--- a/daemon/face/udp-face.cpp
+++ b/daemon/face/udp-face.cpp
@@ -103,8 +103,10 @@
{
ndn::nfd::FaceStatus status = Face::getFaceStatus();
if (isOnDemand()) {
- time::milliseconds left = time::duration_cast<time::milliseconds>(
+ time::milliseconds left = m_idleTimeout - time::duration_cast<time::milliseconds>(
time::steady_clock::now() - m_lastIdleCheck);
+ if (left < time::milliseconds::zero())
+ left = time::milliseconds::zero();
if (hasBeenUsedRecently()) {
status.setExpirationPeriod(left + m_idleTimeout);