aboutsummaryrefslogtreecommitdiff
path: root/src/dht/gnunet-service-wdht_neighbours.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/dht/gnunet-service-wdht_neighbours.c')
-rw-r--r--src/dht/gnunet-service-wdht_neighbours.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/src/dht/gnunet-service-wdht_neighbours.c b/src/dht/gnunet-service-wdht_neighbours.c
index a6ebdb033..2a88ffa09 100644
--- a/src/dht/gnunet-service-wdht_neighbours.c
+++ b/src/dht/gnunet-service-wdht_neighbours.c
@@ -41,9 +41,9 @@
41#include "gnunet_statistics_service.h" 41#include "gnunet_statistics_service.h"
42#include "gnunet-service-wdht.h" 42#include "gnunet-service-wdht.h"
43#include "gnunet-service-wdht_clients.h" 43#include "gnunet-service-wdht_clients.h"
44#include "gnunet-service-wdht_datacache.h" 44#include "gnunet-service-dht_datacache.h"
45#include "gnunet-service-wdht_neighbours.h" 45#include "gnunet-service-wdht_neighbours.h"
46#include "gnunet-service-wdht_nse.h" 46#include "gnunet-service-dht_nse.h"
47#include "dht.h" 47#include "dht.h"
48 48
49#define DEBUG(...) \ 49#define DEBUG(...) \
@@ -605,7 +605,6 @@ GDS_NEIGHBOURS_handle_put (const struct GNUNET_HashCode *key,
605 GDS_DATACACHE_handle_put (expiration_time, 605 GDS_DATACACHE_handle_put (expiration_time,
606 key, 606 key,
607 0, NULL, 607 0, NULL,
608 0, NULL,
609 block_type, 608 block_type,
610 data_size, 609 data_size,
611 data); 610 data);
@@ -777,7 +776,7 @@ forward_message_on_trail (struct FriendInfo *next_target,
777/** 776/**
778 * Send the get result to requesting client. 777 * Send the get result to requesting client.
779 * 778 *
780 * @param trail_id trail identifying where to send the result to, NULL for us 779 * @param cls trail identifying where to send the result to, NULL for us
781 * @param options routing options (from GET request) 780 * @param options routing options (from GET request)
782 * @param key Key of the requested data. 781 * @param key Key of the requested data.
783 * @param type Block type 782 * @param type Block type
@@ -788,7 +787,7 @@ forward_message_on_trail (struct FriendInfo *next_target,
788 * @param data_size Size of the @a data 787 * @param data_size Size of the @a data
789 */ 788 */
790void 789void
791GDS_NEIGHBOURS_send_get_result (const struct GNUNET_HashCode *trail_id, 790GDS_NEIGHBOURS_send_get_result (void *cls,
792 enum GNUNET_DHT_RouteOption options, 791 enum GNUNET_DHT_RouteOption options,
793 const struct GNUNET_HashCode *key, 792 const struct GNUNET_HashCode *key,
794 enum GNUNET_BLOCK_Type type, 793 enum GNUNET_BLOCK_Type type,
@@ -798,6 +797,7 @@ GDS_NEIGHBOURS_send_get_result (const struct GNUNET_HashCode *trail_id,
798 const void *data, 797 const void *data,
799 size_t data_size) 798 size_t data_size)
800{ 799{
800 const struct GNUNET_HashCode *trail_id = cls;
801 struct GNUNET_MessageHeader *payload; 801 struct GNUNET_MessageHeader *payload;
802 struct Trail *trail; 802 struct Trail *trail;
803 803
@@ -1221,13 +1221,13 @@ handle_dht_p2p_random_walk (void *cls,
1221/** 1221/**
1222 * Handle a `struct RandomWalkResponseMessage`. 1222 * Handle a `struct RandomWalkResponseMessage`.
1223 * 1223 *
1224 * @param cls closure 1224 * @param cls closure
1225 * @param rwrm the setup response message 1225 * @param rwrm the setup response message
1226 */ 1226 */
1227static void 1227static void
1228handle_dht_p2p_random_walk_response (void *cls, 1228handle_dht_p2p_random_walk_response (void *cls,
1229 const struct RandomWalkResponseMessage *rwrm) 1229 const struct RandomWalkResponseMessage *rwrm)
1230{ 1230{
1231 struct Trail *trail; 1231 struct Trail *trail;
1232 struct FriendInfo *pred; 1232 struct FriendInfo *pred;
1233 struct FingerTable *ft; 1233 struct FingerTable *ft;
@@ -1298,7 +1298,7 @@ handle_dht_p2p_random_walk_response (void *cls,
1298static void 1298static void
1299handle_dht_p2p_trail_destroy (void *cls, 1299handle_dht_p2p_trail_destroy (void *cls,
1300 const struct TrailDestroyMessage *tdm) 1300 const struct TrailDestroyMessage *tdm)
1301{ 1301{
1302 struct FriendInfo *sender = cls; 1302 struct FriendInfo *sender = cls;
1303 struct Trail *trail; 1303 struct Trail *trail;
1304 1304
@@ -1340,8 +1340,9 @@ handle_dht_p2p_successor_find (void *cls,
1340 of successor finding... */ 1340 of successor finding... */
1341 GNUNET_break_op (0 == trail_path_length); 1341 GNUNET_break_op (0 == trail_path_length);
1342 fsm = (const struct FindSuccessorMessage *) message; 1342 fsm = (const struct FindSuccessorMessage *) message;
1343 GDS_DATACACHE_get_successors (trail_id, 1343 GDS_DATACACHE_get_successors (&fsm->key,
1344 &fsm->key); 1344 &GDS_NEIGHBOURS_send_get_result,
1345 (void *) trail_id);
1345 return GNUNET_OK; 1346 return GNUNET_OK;
1346} 1347}
1347 1348
@@ -1522,7 +1523,7 @@ struct TrailHandler
1522/** 1523/**
1523 * Check that a `struct TrailRouteMessage` is well-formed. 1524 * Check that a `struct TrailRouteMessage` is well-formed.
1524 * 1525 *
1525 * @param cls closure 1526 * @param cls closure
1526 * @param trm the finger destroy message 1527 * @param trm the finger destroy message
1527 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error 1528 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
1528 */ 1529 */
@@ -1534,7 +1535,7 @@ check_dht_p2p_trail_route (void *cls,
1534 uint16_t path_length; 1535 uint16_t path_length;
1535 const struct GNUNET_MessageHeader *payload; 1536 const struct GNUNET_MessageHeader *payload;
1536 size_t msize; 1537 size_t msize;
1537 1538
1538 msize = ntohs (trm->header.size); 1539 msize = ntohs (trm->header.size);
1539 path_length = ntohs (trm->path_length); 1540 path_length = ntohs (trm->path_length);
1540 if (msize < sizeof (struct TrailRouteMessage) + 1541 if (msize < sizeof (struct TrailRouteMessage) +
@@ -1561,7 +1562,7 @@ check_dht_p2p_trail_route (void *cls,
1561/** 1562/**
1562 * Handle a `struct TrailRouteMessage`. 1563 * Handle a `struct TrailRouteMessage`.
1563 * 1564 *
1564 * @param cls closure 1565 * @param cls closure
1565 * @param trm the finger destroy message 1566 * @param trm the finger destroy message
1566 */ 1567 */
1567static void 1568static void