correct parameter in calling m_onUpdate in sync-logic.cc
add -O0 -g3 in CXXFLAGS for debugging
diff --git a/model/sync-app-socket-c.cc b/model/sync-app-socket-c.cc
index 2445b8c..1233ec9 100644
--- a/model/sync-app-socket-c.cc
+++ b/model/sync-app-socket-c.cc
@@ -25,8 +25,11 @@
using namespace Sync;
class CallbackHolder{
-public:
+private:
void (*m_callback)(const char *, const char *);
+
+public:
+ CallbackHolder(void (*callback)(const char*, const char*)):m_callback(callback){};
void callbackWrapper(string name, string data) {
m_callback(name.c_str(), data.c_str());
}
@@ -38,8 +41,7 @@
SyncAppSocketStruct *
create_sync_app_socket(const char *prefix, void (*callback)(const char *, const char *))
{
- CallbackHolder holder;
- holder.m_callback = callback;
+ CallbackHolder holder(callback);
boost::function<void (string, string)> cb = bind(&CallbackHolder::callbackWrapper, &holder, _1, _2);
SyncAppSocket *sock = new SyncAppSocket(prefix, cb);
return (SyncAppSocketStruct *) sock;
diff --git a/model/sync-logic.cc b/model/sync-logic.cc
index d51a3a6..43fee90 100644
--- a/model/sync-logic.cc
+++ b/model/sync-logic.cc
@@ -221,7 +221,7 @@
if (inserted || updated)
{
diffLog->update (info, seq);
- m_onUpdate (info->toString (), seq.getSeq(), oldSeq);
+ m_onUpdate (info->toString (), seq, oldSeq);
}
}
}
@@ -247,7 +247,7 @@
if (inserted || updated)
{
diffLog->update (info, seq);
- m_onUpdate (info->toString (), seq.getSeq(), oldSeq);
+ m_onUpdate (info->toString (), seq, oldSeq);
}
}
else if (diffLeaf->getOperation() == REMOVE)
diff --git a/test/test_ccnx_wrapper.cc b/test/test_ccnx_wrapper.cc
index ad69262..f88ee5b 100644
--- a/test/test_ccnx_wrapper.cc
+++ b/test/test_ccnx_wrapper.cc
@@ -65,7 +65,7 @@
hb.sendInterest(interest, memberFunc);
// give time for ccnd to react
- // sleep(1);
+ sleep(1);
this_thread::sleep (posix_time::milliseconds (5));
BOOST_CHECK_EQUAL(echoStr, interest);
diff --git a/wscript b/wscript
index ba0a706..6a0a629 100644
--- a/wscript
+++ b/wscript
@@ -14,6 +14,7 @@
def configure(conf):
conf.load("compiler_cxx")
+ conf.env.append_value('CXXFLAGS', ['-O0', '-g3'])
if not conf.check_cfg(package='openssl', args=['--cflags', '--libs'], uselib_store='SSL', mandatory=False):
libcrypto = conf.check_cc(lib='crypto',