Adding broadcast hint as a parameter to FetchManager
This hint must be consistent with the one used by content server, but it
was not the case before (and was defined independently twice anyways).
Another change in this commit: broadcast forwarding hint does not
contain application name anymore. Not sure if we need to return it back
or not.
Change-Id: I685620ba1ec74a641015c91f1d6e7b5ff5969215
diff --git a/src/fetch-manager.cc b/src/fetch-manager.cc
index 1949518..e9463b7 100644
--- a/src/fetch-manager.cc
+++ b/src/fetch-manager.cc
@@ -34,19 +34,19 @@
using namespace std;
using namespace Ccnx;
-static const Name BROADCAST_DOMAIN = Name ("/ndn/broadcast/chronoshare");
//The disposer object function
struct fetcher_disposer { void operator() (Fetcher *delete_this) { delete delete_this; } };
static const string SCHEDULE_FETCHES_TAG = "ScheduleFetches";
-FetchManager::FetchManager (Ccnx::CcnxWrapperPtr ccnx
- , const Mapping &mapping
- , uint32_t parallelFetches // = 3
- , const SegmentCallback &defaultSegmentCallback
- , const FinishCallback &defaultFinishCallback
- , const FetchTaskDbPtr &taskDb
- )
+FetchManager::FetchManager (Ccnx::CcnxWrapperPtr ccnx,
+ const Mapping &mapping,
+ const Name &broadcastForwardingHint,
+ uint32_t parallelFetches, // = 3
+ const SegmentCallback &defaultSegmentCallback,
+ const FinishCallback &defaultFinishCallback,
+ const FetchTaskDbPtr &taskDb
+ )
: m_ccnx (ccnx)
, m_mapping (mapping)
, m_maxParallelFetches (parallelFetches)
@@ -56,6 +56,7 @@
, m_defaultSegmentCallback(defaultSegmentCallback)
, m_defaultFinishCallback(defaultFinishCallback)
, m_taskDb(taskDb)
+ , m_broadcastHint (broadcastForwardingHint)
{
m_scheduler->start ();
m_executor->start();
@@ -194,7 +195,7 @@
// no need to do anything with the m_fetchList
}
- if (fetcher.GetForwardingHint () == BROADCAST_DOMAIN)
+ if (fetcher.GetForwardingHint () == m_broadcastHint)
{
// try again directly (hopefully with different forwarding hint
@@ -205,7 +206,7 @@
}
else
{
- fetcher.SetForwardingHint (BROADCAST_DOMAIN);
+ fetcher.SetForwardingHint (m_broadcastHint);
}
double delay = fetcher.GetRetryPause ();