aboutsummaryrefslogtreecommitdiff
path: root/src/dht/gnunet-service-dht_clients.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/dht/gnunet-service-dht_clients.c')
-rw-r--r--src/dht/gnunet-service-dht_clients.c29
1 files changed, 15 insertions, 14 deletions
diff --git a/src/dht/gnunet-service-dht_clients.c b/src/dht/gnunet-service-dht_clients.c
index 049e3d1f1..d6ce97666 100644
--- a/src/dht/gnunet-service-dht_clients.c
+++ b/src/dht/gnunet-service-dht_clients.c
@@ -515,9 +515,9 @@ handle_dht_local_put (void *cls,
515 "CLIENT-PUT %s\n", 515 "CLIENT-PUT %s\n",
516 GNUNET_h2s_full (&dht_msg->key)); 516 GNUNET_h2s_full (&dht_msg->key));
517 /* give to local clients */ 517 /* give to local clients */
518 GDS_CLIENTS_handle_reply (&bd, 518 GNUNET_break (GDS_CLIENTS_handle_reply (&bd,
519 &bd.key, 519 &bd.key,
520 0, NULL /* get path */); 520 0, NULL /* get path */));
521 521
522 { 522 {
523 struct GNUNET_CONTAINER_BloomFilter *peer_bf; 523 struct GNUNET_CONTAINER_BloomFilter *peer_bf;
@@ -568,9 +568,9 @@ handle_local_result (void *cls,
568 GNUNET_log (GNUNET_ERROR_TYPE_INFO, 568 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
569 "Datacache provided result for query key %s\n", 569 "Datacache provided result for query key %s\n",
570 GNUNET_h2s (&bd->key)); 570 GNUNET_h2s (&bd->key));
571 GDS_CLIENTS_handle_reply (bd, 571 GNUNET_break (GDS_CLIENTS_handle_reply (bd,
572 &bd->key, 572 &bd->key,
573 0, NULL /* get_path */); 573 0, NULL /* get_path */));
574} 574}
575 575
576 576
@@ -1002,7 +1002,7 @@ forward_reply (void *cls,
1002 reply->put_path_length = htonl (frc->bd->put_path_length); 1002 reply->put_path_length = htonl (frc->bd->put_path_length);
1003 reply->unique_id = record->unique_id; 1003 reply->unique_id = record->unique_id;
1004 reply->expiration = GNUNET_TIME_absolute_hton (frc->bd->expiration_time); 1004 reply->expiration = GNUNET_TIME_absolute_hton (frc->bd->expiration_time);
1005 reply->key = frc->bd->key; 1005 reply->key = *query_hash;
1006 paths = (struct GNUNET_DHT_PathElement *) &reply[1]; 1006 paths = (struct GNUNET_DHT_PathElement *) &reply[1];
1007 GNUNET_memcpy (paths, 1007 GNUNET_memcpy (paths,
1008 frc->bd->put_path, 1008 frc->bd->put_path,
@@ -1027,7 +1027,7 @@ forward_reply (void *cls,
1027} 1027}
1028 1028
1029 1029
1030void 1030bool
1031GDS_CLIENTS_handle_reply (const struct GDS_DATACACHE_BlockData *bd, 1031GDS_CLIENTS_handle_reply (const struct GDS_DATACACHE_BlockData *bd,
1032 const struct GNUNET_HashCode *query_hash, 1032 const struct GNUNET_HashCode *query_hash,
1033 unsigned int get_path_length, 1033 unsigned int get_path_length,
@@ -1042,22 +1042,22 @@ GDS_CLIENTS_handle_reply (const struct GDS_DATACACHE_BlockData *bd,
1042 if (msize >= GNUNET_MAX_MESSAGE_SIZE) 1042 if (msize >= GNUNET_MAX_MESSAGE_SIZE)
1043 { 1043 {
1044 GNUNET_break (0); 1044 GNUNET_break (0);
1045 return; 1045 return false;
1046 } 1046 }
1047#if SANITY_CHECKS 1047#if SANITY_CHECKS
1048 if (0 != 1048 if (0 !=
1049 GNUNET_DHT_verify_path (&bd->key, 1049 GNUNET_DHT_verify_path (query_hash,
1050 bd->data, 1050 bd->data,
1051 bd->data_size, 1051 bd->data_size,
1052 bd->expiration_time, 1052 bd->expiration_time,
1053 get_path,
1054 get_path_length,
1055 bd->put_path, 1053 bd->put_path,
1056 bd->put_path_length, 1054 bd->put_path_length,
1055 get_path,
1056 get_path_length,
1057 &GDS_my_identity)) 1057 &GDS_my_identity))
1058 { 1058 {
1059 GNUNET_break_op (0); 1059 GNUNET_break (0);
1060 return; 1060 return false;
1061 } 1061 }
1062#endif 1062#endif
1063 frc.bd = bd; 1063 frc.bd = bd;
@@ -1082,6 +1082,7 @@ GDS_CLIENTS_handle_reply (const struct GDS_DATACACHE_BlockData *bd,
1082 1, 1082 1,
1083 GNUNET_NO); 1083 GNUNET_NO);
1084 } 1084 }
1085 return true;
1085} 1086}
1086 1087
1087 1088