aboutsummaryrefslogtreecommitdiff
path: root/src/dht/gnunet-service-dht.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/dht/gnunet-service-dht.c')
-rw-r--r--src/dht/gnunet-service-dht.c42
1 files changed, 24 insertions, 18 deletions
diff --git a/src/dht/gnunet-service-dht.c b/src/dht/gnunet-service-dht.c
index 1721e73af..43a6c9bea 100644
--- a/src/dht/gnunet-service-dht.c
+++ b/src/dht/gnunet-service-dht.c
@@ -934,11 +934,13 @@ static struct GNUNET_BLOCK_Context *block_context;
934/** 934/**
935 * Forward declaration. 935 * Forward declaration.
936 */ 936 */
937static size_t send_generic_reply (void *cls, size_t size, void *buf); 937static size_t
938send_generic_reply (void *cls, size_t size, void *buf);
938 939
939 940
940/** Declare here so retry_core_send is aware of it */ 941/** Declare here so retry_core_send is aware of it */
941static size_t core_transmit_notify (void *cls, size_t size, void *buf); 942static size_t
943core_transmit_notify (void *cls, size_t size, void *buf);
942 944
943/** 945/**
944 * Convert unique ID to hash code. 946 * Convert unique ID to hash code.
@@ -1160,7 +1162,8 @@ forward_result_message (const struct GNUNET_MessageHeader *msg,
1160 result_message->hop_count = htonl (msg_ctx->hop_count + 1); 1162 result_message->hop_count = htonl (msg_ctx->hop_count + 1);
1161 GNUNET_assert (GNUNET_OK == 1163 GNUNET_assert (GNUNET_OK ==
1162 GNUNET_CONTAINER_bloomfilter_get_raw_data (msg_ctx->bloom, 1164 GNUNET_CONTAINER_bloomfilter_get_raw_data (msg_ctx->bloom,
1163 result_message->bloomfilter, 1165 result_message->
1166 bloomfilter,
1164 DHT_BLOOM_SIZE)); 1167 DHT_BLOOM_SIZE));
1165 result_message->unique_id = GNUNET_htonll (msg_ctx->unique_id); 1168 result_message->unique_id = GNUNET_htonll (msg_ctx->unique_id);
1166 memcpy (&result_message->key, &msg_ctx->key, sizeof (GNUNET_HashCode)); 1169 memcpy (&result_message->key, &msg_ctx->key, sizeof (GNUNET_HashCode));
@@ -1474,9 +1477,9 @@ find_peer_by_id (const struct GNUNET_PeerIdentity *peer)
1474} 1477}
1475 1478
1476/* Forward declaration */ 1479/* Forward declaration */
1477static void update_core_preference (void *cls, 1480static void
1478 const struct GNUNET_SCHEDULER_TaskContext 1481update_core_preference (void *cls,
1479 *tc); 1482 const struct GNUNET_SCHEDULER_TaskContext *tc);
1480/** 1483/**
1481 * Function called with statistics about the given peer. 1484 * Function called with statistics about the given peer.
1482 * 1485 *
@@ -1776,7 +1779,8 @@ forward_message (const struct GNUNET_MessageHeader *msg, struct PeerInfo *peer,
1776 if (msg_ctx->bloom != NULL) 1779 if (msg_ctx->bloom != NULL)
1777 GNUNET_assert (GNUNET_OK == 1780 GNUNET_assert (GNUNET_OK ==
1778 GNUNET_CONTAINER_bloomfilter_get_raw_data (msg_ctx->bloom, 1781 GNUNET_CONTAINER_bloomfilter_get_raw_data (msg_ctx->bloom,
1779 route_message->bloomfilter, 1782 route_message->
1783 bloomfilter,
1780 DHT_BLOOM_SIZE)); 1784 DHT_BLOOM_SIZE));
1781 memcpy (&route_message->key, &msg_ctx->key, sizeof (GNUNET_HashCode)); 1785 memcpy (&route_message->key, &msg_ctx->key, sizeof (GNUNET_HashCode));
1782 memcpy (&route_message[1], msg, ntohs (msg->size)); 1786 memcpy (&route_message[1], msg, ntohs (msg->size));
@@ -1885,8 +1889,8 @@ process_pending_messages (struct ClientList *client)
1885 1889
1886 client->transmit_handle = 1890 client->transmit_handle =
1887 GNUNET_SERVER_notify_transmit_ready (client->client_handle, 1891 GNUNET_SERVER_notify_transmit_ready (client->client_handle,
1888 ntohs (client->pending_head->msg-> 1892 ntohs (client->pending_head->
1889 size), 1893 msg->size),
1890 GNUNET_TIME_UNIT_FOREVER_REL, 1894 GNUNET_TIME_UNIT_FOREVER_REL,
1891 &send_generic_reply, client); 1895 &send_generic_reply, client);
1892} 1896}
@@ -2457,8 +2461,9 @@ datacache_get_iterator (void *cls, struct GNUNET_TIME_Absolute exp,
2457 * @param msg the message to be routed 2461 * @param msg the message to be routed
2458 * @param msg_ctx the context containing all pertinent information about the message 2462 * @param msg_ctx the context containing all pertinent information about the message
2459 */ 2463 */
2460static void route_message (const struct GNUNET_MessageHeader *msg, 2464static void
2461 struct DHT_MessageContext *msg_ctx); 2465route_message (const struct GNUNET_MessageHeader *msg,
2466 struct DHT_MessageContext *msg_ctx);
2462 2467
2463 2468
2464/** 2469/**
@@ -2815,8 +2820,8 @@ handle_dht_find_peer (const struct GNUNET_MessageHeader *find_msg,
2815 * @param cls closure (a struct RepublishContext) 2820 * @param cls closure (a struct RepublishContext)
2816 * @param tc runtime context for this task 2821 * @param tc runtime context for this task
2817 */ 2822 */
2818static void republish_content (void *cls, 2823static void
2819 const struct GNUNET_SCHEDULER_TaskContext *tc); 2824republish_content (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
2820 2825
2821/** 2826/**
2822 * Server handler for initiating local dht put requests 2827 * Server handler for initiating local dht put requests
@@ -3509,10 +3514,10 @@ select_peer (const GNUNET_HashCode * target,
3509 break; /* overflow case */ 3514 break; /* overflow case */
3510 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 3515 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
3511 "Choose %d matching bits (%d bits match me) (%.2f percent) converge ret %llu\n", 3516 "Choose %d matching bits (%d bits match me) (%.2f percent) converge ret %llu\n",
3512 GNUNET_CRYPTO_hash_matching_bits (&sorted_closest[i]-> 3517 GNUNET_CRYPTO_hash_matching_bits (&sorted_closest[i]->id.
3513 id.hashPubKey, target), 3518 hashPubKey, target),
3514 GNUNET_CRYPTO_hash_matching_bits (&sorted_closest[i]-> 3519 GNUNET_CRYPTO_hash_matching_bits (&sorted_closest[i]->id.
3515 id.hashPubKey, 3520 hashPubKey,
3516 &my_identity.hashPubKey), 3521 &my_identity.hashPubKey),
3517 (temp_converge_distance / (double) total_distance) * 100, 3522 (temp_converge_distance / (double) total_distance) * 100,
3518 temp_converge_distance); 3523 temp_converge_distance);
@@ -4473,7 +4478,8 @@ send_find_peer_message (void *cls,
4473 temp_bloom); 4478 temp_bloom);
4474 GNUNET_assert (GNUNET_OK == 4479 GNUNET_assert (GNUNET_OK ==
4475 GNUNET_CONTAINER_bloomfilter_get_raw_data (temp_bloom, 4480 GNUNET_CONTAINER_bloomfilter_get_raw_data (temp_bloom,
4476 find_peer_msg->bloomfilter, 4481 find_peer_msg->
4482 bloomfilter,
4477 DHT_BLOOM_SIZE)); 4483 DHT_BLOOM_SIZE));
4478 GNUNET_CONTAINER_bloomfilter_free (temp_bloom); 4484 GNUNET_CONTAINER_bloomfilter_free (temp_bloom);
4479 memset (&msg_ctx, 0, sizeof (struct DHT_MessageContext)); 4485 memset (&msg_ctx, 0, sizeof (struct DHT_MessageContext));