diff options
author | Bart Polot <bart@net.in.tum.de> | 2011-10-27 00:47:16 +0000 |
---|---|---|
committer | Bart Polot <bart@net.in.tum.de> | 2011-10-27 00:47:16 +0000 |
commit | 97df373438510a9201ea1f82e7f5c8ec34310af2 (patch) | |
tree | f9dfb79624d6e667ca91767b96902028ba7b68fb /src/mesh | |
parent | 9a06459ea64a1d572b1baf01c8f2edb820e11a47 (diff) |
Fixed a bug when adding a path to a peer_info, modified logging
Diffstat (limited to 'src/mesh')
-rw-r--r-- | src/mesh/gnunet-service-mesh.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/mesh/gnunet-service-mesh.c b/src/mesh/gnunet-service-mesh.c index abdbe6b04..40f1d139b 100644 --- a/src/mesh/gnunet-service-mesh.c +++ b/src/mesh/gnunet-service-mesh.c @@ -1470,9 +1470,19 @@ path_add_to_peer (struct MeshPeerInfo *peer_info, struct MeshPeerPath *path) unsigned int l; unsigned int l2; +#if MESH_DEBUG + struct GNUNET_PeerIdentity id; + + GNUNET_PEER_resolve (peer_info->id, &id); + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + "MESH: adding path [%u] to peer %s\n", + path->length, + GNUNET_i2s (&id)); +#endif if (NULL == peer_info || NULL == path) { GNUNET_break (0); + path_destroy (path); return; } @@ -1489,7 +1499,10 @@ path_add_to_peer (struct MeshPeerInfo *peer_info, struct MeshPeerPath *path) if (l2 > l) { GNUNET_CONTAINER_DLL_insert_before (peer_info->path_head, - peer_info->path_tail, aux, path); + peer_info->path_tail, + aux, + path); + return; } else { @@ -1532,9 +1545,9 @@ path_add_to_origin (struct MeshPeerInfo *peer_info, struct MeshPeerPath *path) */ static struct MeshPeerPath * path_build_from_dht (const struct GNUNET_PeerIdentity *get_path, - unsigned int get_path_length, + unsigned int get_path_length, const struct GNUNET_PeerIdentity *put_path, - unsigned int put_path_length) + unsigned int put_path_length) { struct MeshPeerPath *p; GNUNET_PEER_Id id; |