Set interest timeout with interest.interestLifetime
diff --git a/js/WebSocketTransport.js b/js/WebSocketTransport.js
index 0a60c6e..034e8b8 100644
--- a/js/WebSocketTransport.js
+++ b/js/WebSocketTransport.js
@@ -119,6 +119,11 @@
clearTimeout(pitEntry.closure.timerID);
//console.log("Clear interest timer");
//console.log(pitEntry.closure.timerID);
+
+ // Remove PIT entry from PITTable
+ index = PITTable.indexOf(pitEntry);
+ PITTable.splice(index, 1);
+
// Raise callback
pitEntry.closure.upcall(Closure.UPCALL_CONTENT, new UpcallInfo(ndn, null, 0, co));
}
@@ -209,7 +214,7 @@
// Set interest timer
closure.timerID = setTimeout(function() {
- console.log("Interest time out.");
+ if (LOG > 3) console.log("Interest time out.");
// Remove PIT entry from PITTable
index = PITTable.indexOf(pitEntry);
@@ -218,7 +223,7 @@
//console.log(PITTable);
// Raise closure callback
closure.upcall(Closure.UPCALL_INTEREST_TIMED_OUT, new UpcallInfo(ndn, interest, 0, null));
- }, NDN.InterestTimeOut);
+ }, interest.interestLifetime);
//console.log(closure.timerID);
}
else