Changing logic with forwarding hints
Now there are 3 options, which continuously tried in order:
1. using forwarding hint specified by SyncLog
2. Broadcast hint
3. Empty forwarding hint
In certain cases (when forwarding hint for a node is empty), only first
two options are effective.
Change-Id: I7b7b1a8d192b2c639954734fdf29917030d8eab2
diff --git a/src/fetch-manager.cc b/src/fetch-manager.cc
index af72e08..a5a2bc2 100644
--- a/src/fetch-manager.cc
+++ b/src/fetch-manager.cc
@@ -195,17 +195,32 @@
// no need to do anything with the m_fetchList
}
- if (fetcher.GetForwardingHint () == m_broadcastHint)
+ if (fetcher.GetForwardingHint ().size () == 0)
{
- // try again directly (hopefully with different forwarding hint
+ // will be tried initially and again after empty forwarding hint
/// @todo Handle potential exception
Name forwardingHint;
forwardingHint = m_mapping (fetcher.GetDeviceName ());
- fetcher.SetForwardingHint (forwardingHint);
+
+ if (forwardingHint.size () == 0)
+ {
+ // make sure that we will try broadcast forwarding hint eventually
+ fetcher.SetForwardingHint (m_broadcastHint);
+ }
+ else
+ {
+ fetcher.SetForwardingHint (forwardingHint);
+ }
+ }
+ else if (fetcher.GetForwardingHint () == m_broadcastHint)
+ {
+ // will be tried after broadcast forwarding hint
+ fetcher.SetForwardingHint (Name ("/"));
}
else
{
+ // will be tried after normal forwarding hint
fetcher.SetForwardingHint (m_broadcastHint);
}