face: copy also the link type in copyStatusTo
Change-Id: I3787210328f326fd788e7f0f3e23493e4dfa9ddd
Refs: #2563
diff --git a/daemon/face/udp-face.cpp b/daemon/face/udp-face.cpp
index 8962f0d..27c78b3 100644
--- a/daemon/face/udp-face.cpp
+++ b/daemon/face/udp-face.cpp
@@ -81,20 +81,19 @@
ndn::nfd::FaceStatus
UdpFace::getFaceStatus() const
{
- auto status = Face::getFaceStatus();
+ auto status = DatagramFace::getFaceStatus();
if (isOnDemand()) {
- time::milliseconds left = m_idleTimeout - time::duration_cast<time::milliseconds>(
- time::steady_clock::now() - m_lastIdleCheck);
+ time::milliseconds left = m_idleTimeout;
+ left -= 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);
- }
- else {
- status.setExpirationPeriod(left);
- }
+ if (hasBeenUsedRecently())
+ left += m_idleTimeout;
+
+ status.setExpirationPeriod(left);
}
return status;