* path.
*
* Re-running the DHT GET should give core time to callback.
+ *
+ * GMT_use_path -> GMC_new -> register_neighbors takes care of
+ * updating statistics about this issue.
*/
- GNUNET_break (0);
rerun_search = GNUNET_YES;
}
else
* Remove any path to the peer that has the extact same peers as the one given.
*
* @param peer Peer to remove the path from.
- * @param path Path to remove.
+ * @param path Path to remove. Is always destroyed .
*/
void
GMP_remove_path (struct MeshPeer *peer, struct MeshPeerPath *path)
struct MeshPeerPath *iter;
struct MeshPeerPath *next;
- GNUNET_assert (myid == path->peers[path->length - 1]);
+ GNUNET_assert (myid == path->peers[0]);
+ GNUNET_assert (peer->id == path->peers[path->length - 1]);
for (iter = peer->path_head; NULL != iter; iter = next)
{
if (0 == memcmp (path->peers, iter->peers,
sizeof (GNUNET_PEER_Id) * path->length))
{
+ GNUNET_CONTAINER_DLL_remove (peer->path_head, peer->path_tail, iter);
path_destroy (iter);
+ if (path == iter)
+ return;
}
}
+ path_destroy (path);
}