upcall should return Closure.RESULT_OK.
diff --git a/js/NDN.js b/js/NDN.js
index 1202f08..05577b8 100644
--- a/js/NDN.js
+++ b/js/NDN.js
@@ -174,10 +174,10 @@
interest = new Interest(name);
if (template != null) {
// TODO: Exactly what do we copy from template?
- interest.InterestLifetime = template.InterestLifetime;
+ interest.interestLifetime = template.interestLifetime;
}
else
- interest.InterestLifetime = 4200;
+ interest.interestLifetime = 4200;
var outputHex = encodeToHexInterest(interest);
var dataListener = {
@@ -196,8 +196,9 @@
}
// TODO: verify the content object and set kind to UPCALL_CONTENT.
- closure.upcall(Closure.UPCALL_CONTENT_UNVERIFIED,
- new UpcallInfo(this, interest, 0, co))
+ var result = closure.upcall(Closure.UPCALL_CONTENT_UNVERIFIED,
+ new UpcallInfo(this, interest, 0, co));
+ // TODO: Check result for Closure.RESULT_OK, etc.
}
}
}
diff --git a/js/ccnxProtocol.xpi b/js/ccnxProtocol.xpi
index 45cb47f..48091cb 100644
--- a/js/ccnxProtocol.xpi
+++ b/js/ccnxProtocol.xpi
Binary files differ
diff --git a/js/ccnxProtocol/components/ccnxProtocolService.js b/js/ccnxProtocol/components/ccnxProtocolService.js
index c7d4d1e..42dd1f6 100644
--- a/js/ccnxProtocol/components/ccnxProtocolService.js
+++ b/js/ccnxProtocol/components/ccnxProtocolService.js
@@ -47,7 +47,7 @@
if (!(kind == Closure.UPCALL_CONTENT ||
kind == Closure.UPCALL_CONTENT_UNVERIFIED))
// The upcall is not for us.
- return;
+ return Closure.RESULT_ERR;
var contentObject = upcallInfo.contentObject;
@@ -84,6 +84,7 @@
}
contentListener.onReceivedContent(content, contentType, contentCharset);
+ return Closure.RESULT_OK;
};
ndn.expressInterest(new Name(name), new ContentClosure());
diff --git a/js/ccnxProtocol/modules/ndn-js.jsm b/js/ccnxProtocol/modules/ndn-js.jsm
index a432819..1532ee5 100644
--- a/js/ccnxProtocol/modules/ndn-js.jsm
+++ b/js/ccnxProtocol/modules/ndn-js.jsm
@@ -264,10 +264,10 @@
interest = new Interest(name);
if (template != null) {
// TODO: Exactly what do we copy from template?
- interest.InterestLifetime = template.InterestLifetime;
+ interest.interestLifetime = template.interestLifetime;
}
else
- interest.InterestLifetime = 4200;
+ interest.interestLifetime = 4200;
var outputHex = encodeToHexInterest(interest);
var dataListener = {
@@ -286,8 +286,9 @@
}
// TODO: verify the content object and set kind to UPCALL_CONTENT.
- closure.upcall(Closure.UPCALL_CONTENT_UNVERIFIED,
- new UpcallInfo(this, interest, 0, co))
+ var result = closure.upcall(Closure.UPCALL_CONTENT_UNVERIFIED,
+ new UpcallInfo(this, interest, 0, co));
+ // TODO: Check result for Closure.RESULT_OK, etc.
}
}
}