diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-12-10 09:17:12 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-12-10 09:17:12 +0000 |
commit | 3d0407a554d5d2536bd75e77c1d17b7815d2efa6 (patch) | |
tree | b2b9310ca26e65a2395cd744f83fc22265148b3d /src/dv | |
parent | c368be672b98ef5aa8ebda8f12035d9c7df84e5a (diff) | |
download | gnunet-3d0407a554d5d2536bd75e77c1d17b7815d2efa6.tar.gz gnunet-3d0407a554d5d2536bd75e77c1d17b7815d2efa6.zip |
-minor fixes
Diffstat (limited to 'src/dv')
-rw-r--r-- | src/dv/gnunet-service-dv.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/dv/gnunet-service-dv.c b/src/dv/gnunet-service-dv.c index 1a2235853..706291e2b 100644 --- a/src/dv/gnunet-service-dv.c +++ b/src/dv/gnunet-service-dv.c | |||
@@ -103,7 +103,7 @@ struct RouteMessage | |||
103 | 103 | ||
104 | /** | 104 | /** |
105 | * Expected (remaining) distance. Must be always smaller than | 105 | * Expected (remaining) distance. Must be always smaller than |
106 | * DEFAULT_FISHEYE_DEPTH, should be zero at the target. Must | 106 | * #DEFAULT_FISHEYE_DEPTH, should be zero at the target. Must |
107 | * be decremented by one at each hop. Peers must not forward | 107 | * be decremented by one at each hop. Peers must not forward |
108 | * these messages further once the counter has reached zero. | 108 | * these messages further once the counter has reached zero. |
109 | */ | 109 | */ |
@@ -799,6 +799,7 @@ build_set (void *cls) | |||
799 | struct DirectNeighbor *neighbor = cls; | 799 | struct DirectNeighbor *neighbor = cls; |
800 | struct GNUNET_SET_Element element; | 800 | struct GNUNET_SET_Element element; |
801 | struct Target *target; | 801 | struct Target *target; |
802 | |||
802 | target = NULL; | 803 | target = NULL; |
803 | while ( (DEFAULT_FISHEYE_DEPTH > neighbor->consensus_insertion_distance) && | 804 | while ( (DEFAULT_FISHEYE_DEPTH > neighbor->consensus_insertion_distance) && |
804 | (consensi[neighbor->consensus_insertion_distance].array_length == neighbor->consensus_insertion_offset) ) | 805 | (consensi[neighbor->consensus_insertion_distance].array_length == neighbor->consensus_insertion_offset) ) |
@@ -1449,7 +1450,7 @@ check_target_added (void *cls, | |||
1449 | current_route = GNUNET_new (struct Route); | 1450 | current_route = GNUNET_new (struct Route); |
1450 | current_route->next_hop = neighbor; | 1451 | current_route->next_hop = neighbor; |
1451 | current_route->target.peer = target->peer; | 1452 | current_route->target.peer = target->peer; |
1452 | allocate_route (current_route, ntohl (target.distance) + 1); | 1453 | allocate_route (current_route, ntohl (target->distance) + 1); |
1453 | GNUNET_assert (GNUNET_YES == | 1454 | GNUNET_assert (GNUNET_YES == |
1454 | GNUNET_CONTAINER_multipeermap_put (all_routes, | 1455 | GNUNET_CONTAINER_multipeermap_put (all_routes, |
1455 | ¤t_route->target.peer, | 1456 | ¤t_route->target.peer, |
@@ -1471,7 +1472,7 @@ check_target_added (void *cls, | |||
1471 | * | 1472 | * |
1472 | * @param cls the `struct DirectNeighbor` we're building the consensus with | 1473 | * @param cls the `struct DirectNeighbor` we're building the consensus with |
1473 | * @param element a result element, only valid if status is #GNUNET_SET_STATUS_OK | 1474 | * @param element a result element, only valid if status is #GNUNET_SET_STATUS_OK |
1474 | * @param status see enum GNUNET_SET_Status | 1475 | * @param status see `enum GNUNET_SET_Status` |
1475 | */ | 1476 | */ |
1476 | static void | 1477 | static void |
1477 | handle_set_union_result (void *cls, | 1478 | handle_set_union_result (void *cls, |
@@ -1653,7 +1654,7 @@ listen_set_union (void *cls, | |||
1653 | /** | 1654 | /** |
1654 | * Start creating a new DV set union by initiating the connection. | 1655 | * Start creating a new DV set union by initiating the connection. |
1655 | * | 1656 | * |
1656 | * @param cls the 'struct DirectNeighbor' of the peer we're building | 1657 | * @param cls the `struct DirectNeighbor *` of the peer we're building |
1657 | * a routing consensus with | 1658 | * a routing consensus with |
1658 | * @param tc scheduler context | 1659 | * @param tc scheduler context |
1659 | */ | 1660 | */ |
@@ -1661,6 +1662,7 @@ static void | |||
1661 | initiate_set_union (void *cls, | 1662 | initiate_set_union (void *cls, |
1662 | const struct GNUNET_SCHEDULER_TaskContext *tc) | 1663 | const struct GNUNET_SCHEDULER_TaskContext *tc) |
1663 | { | 1664 | { |
1665 | static uint16_t salt; | ||
1664 | struct DirectNeighbor *neighbor = cls; | 1666 | struct DirectNeighbor *neighbor = cls; |
1665 | 1667 | ||
1666 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1668 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
@@ -1672,7 +1674,7 @@ initiate_set_union (void *cls, | |||
1672 | neighbor->set_op = GNUNET_SET_prepare (&neighbor->peer, | 1674 | neighbor->set_op = GNUNET_SET_prepare (&neighbor->peer, |
1673 | &neighbor->real_session_id, | 1675 | &neighbor->real_session_id, |
1674 | NULL, | 1676 | NULL, |
1675 | 0 /* FIXME: salt */, | 1677 | salt++, |
1676 | GNUNET_SET_RESULT_ADDED, | 1678 | GNUNET_SET_RESULT_ADDED, |
1677 | &handle_set_union_result, | 1679 | &handle_set_union_result, |
1678 | neighbor); | 1680 | neighbor); |