- invalidate instead of destroying, to avoid reusing right away (from stale DHT info...
authorBart Polot <bart@net.in.tum.de>
Sat, 22 Mar 2014 02:58:34 +0000 (02:58 +0000)
committerBart Polot <bart@net.in.tum.de>
Sat, 22 Mar 2014 02:58:34 +0000 (02:58 +0000)
src/mesh/gnunet-service-mesh_peer.c

index 2884b1a53618058500786d46bebc00a7eabf6acc..eaa066b5c70b095094c31a6c42d3f2250c38afd5 100644 (file)
@@ -1807,9 +1807,7 @@ GMP_remove_path (struct MeshPeer *peer, struct MeshPeerPath *path)
     if (0 == memcmp (path->peers, iter->peers,
                      sizeof (GNUNET_PEER_Id) * path->length))
     {
-      GNUNET_CONTAINER_DLL_remove (peer->path_head, peer->path_tail, iter);
-      if (path != iter)
-        path_destroy (iter);
+      path_invalidate (iter);
     }
   }
   path_destroy (path);
@@ -2067,11 +2065,10 @@ GMP_notify_broken_link (struct MeshPeer *peer,
         char *s;
 
         s = path_2s (iter);
-        LOG (GNUNET_ERROR_TYPE_DEBUG, " - destroying %s\n", s);
+        LOG (GNUNET_ERROR_TYPE_DEBUG, " - invalidating %s\n", s);
         GNUNET_free (s);
 
-        GNUNET_CONTAINER_DLL_remove (peer->path_head, peer->path_tail, iter);
-        path_destroy (iter);
+        path_invalidate (iter);
       }
     }
   }