diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/mesh/gnunet-service-mesh.c | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/src/mesh/gnunet-service-mesh.c b/src/mesh/gnunet-service-mesh.c index ca60433de..9b76e6b1e 100644 --- a/src/mesh/gnunet-service-mesh.c +++ b/src/mesh/gnunet-service-mesh.c | |||
@@ -1509,18 +1509,34 @@ path_add_to_peer (struct MeshPeerInfo *peer_info, struct MeshPeerPath *path) | |||
1509 | path_destroy (path); | 1509 | path_destroy (path); |
1510 | return; | 1510 | return; |
1511 | } | 1511 | } |
1512 | for (l = 1; l < path->length; l++) | ||
1513 | { | ||
1514 | if (path->peers[l] == myid) | ||
1515 | { | ||
1516 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
1517 | "MESH: shortening path by %u\n", | ||
1518 | l); | ||
1519 | for (l2 = 0; l2 < path->length - l - 1 ; l2++) | ||
1520 | { | ||
1521 | path->peers[l2] = path->peers[l + l2]; | ||
1522 | } | ||
1523 | path->length -= l; | ||
1524 | l = 0; | ||
1525 | path->peers = GNUNET_realloc (path->peers, | ||
1526 | path->length * sizeof (GNUNET_PEER_Id)); | ||
1527 | } | ||
1528 | } | ||
1512 | #if MESH_DEBUG | 1529 | #if MESH_DEBUG |
1513 | { | 1530 | { |
1514 | struct GNUNET_PeerIdentity id; | 1531 | struct GNUNET_PeerIdentity id; |
1515 | 1532 | ||
1516 | GNUNET_PEER_resolve (peer_info->id, &id); | 1533 | GNUNET_PEER_resolve (peer_info->id, &id); |
1517 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1534 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1518 | "MESH: adding path [%u] to peer %s\n", | 1535 | "MESH: adding path [%u] to peer %s\n", |
1519 | path->length, | 1536 | path->length, |
1520 | GNUNET_i2s (&id)); | 1537 | GNUNET_i2s (&id)); |
1521 | } | 1538 | } |
1522 | #endif | 1539 | #endif |
1523 | |||
1524 | l = path_get_length (path); | 1540 | l = path_get_length (path); |
1525 | if (0 == l) | 1541 | if (0 == l) |
1526 | { | 1542 | { |