storage: Making use of SkipList-based index
Change-Id: I360af97ae794da383fe00aaad8ab3c417c5167d3
Refs: #1695, #1434
diff --git a/src/handles/read-handle.cpp b/src/handles/read-handle.cpp
index e13a85c..83133e2 100644
--- a/src/handles/read-handle.cpp
+++ b/src/handles/read-handle.cpp
@@ -24,16 +24,11 @@
void
ReadHandle::onInterest(const Name& prefix, const Interest& interest)
{
- Data data;
- if (getStorageHandle().readData(interest, data)) {
- getFace().put(data);
- }
-}
-void
-ReadHandle::onRegisterSuccess(const Name& prefix)
-{
- std::cerr << "Successfully registered prefix " << prefix << std::endl;
+ shared_ptr<ndn::Data> data = getStorageHandle().readData(interest);
+ if (data != NULL) {
+ getFace().put(*data);
+ }
}
void
@@ -46,9 +41,9 @@
void
ReadHandle::listen(const Name& prefix)
{
- getFace().setInterestFilter(prefix,
+ ndn::InterestFilter filter(prefix);
+ getFace().setInterestFilter(filter,
bind(&ReadHandle::onInterest, this, _1, _2),
- bind(&ReadHandle::onRegisterSuccess, this, _1),
bind(&ReadHandle::onRegisterFailed, this, _1, _2));
}