diff options
Diffstat (limited to 'src/mesh/gnunet-service-mesh.c')
-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) | |||
1470 | unsigned int l; | 1470 | unsigned int l; |
1471 | unsigned int l2; | 1471 | unsigned int l2; |
1472 | 1472 | ||
1473 | #if MESH_DEBUG | ||
1474 | struct GNUNET_PeerIdentity id; | ||
1475 | |||
1476 | GNUNET_PEER_resolve (peer_info->id, &id); | ||
1477 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
1478 | "MESH: adding path [%u] to peer %s\n", | ||
1479 | path->length, | ||
1480 | GNUNET_i2s (&id)); | ||
1481 | #endif | ||
1473 | if (NULL == peer_info || NULL == path) | 1482 | if (NULL == peer_info || NULL == path) |
1474 | { | 1483 | { |
1475 | GNUNET_break (0); | 1484 | GNUNET_break (0); |
1485 | path_destroy (path); | ||
1476 | return; | 1486 | return; |
1477 | } | 1487 | } |
1478 | 1488 | ||
@@ -1489,7 +1499,10 @@ path_add_to_peer (struct MeshPeerInfo *peer_info, struct MeshPeerPath *path) | |||
1489 | if (l2 > l) | 1499 | if (l2 > l) |
1490 | { | 1500 | { |
1491 | GNUNET_CONTAINER_DLL_insert_before (peer_info->path_head, | 1501 | GNUNET_CONTAINER_DLL_insert_before (peer_info->path_head, |
1492 | peer_info->path_tail, aux, path); | 1502 | peer_info->path_tail, |
1503 | aux, | ||
1504 | path); | ||
1505 | return; | ||
1493 | } | 1506 | } |
1494 | else | 1507 | else |
1495 | { | 1508 | { |
@@ -1532,9 +1545,9 @@ path_add_to_origin (struct MeshPeerInfo *peer_info, struct MeshPeerPath *path) | |||
1532 | */ | 1545 | */ |
1533 | static struct MeshPeerPath * | 1546 | static struct MeshPeerPath * |
1534 | path_build_from_dht (const struct GNUNET_PeerIdentity *get_path, | 1547 | path_build_from_dht (const struct GNUNET_PeerIdentity *get_path, |
1535 | unsigned int get_path_length, | 1548 | unsigned int get_path_length, |
1536 | const struct GNUNET_PeerIdentity *put_path, | 1549 | const struct GNUNET_PeerIdentity *put_path, |
1537 | unsigned int put_path_length) | 1550 | unsigned int put_path_length) |
1538 | { | 1551 | { |
1539 | struct MeshPeerPath *p; | 1552 | struct MeshPeerPath *p; |
1540 | GNUNET_PEER_Id id; | 1553 | GNUNET_PEER_Id id; |