diff options
Diffstat (limited to 'src/dht')
-rw-r--r-- | src/dht/dht_api.c | 18 | ||||
-rw-r--r-- | src/dht/dhtlog.h | 8 | ||||
-rw-r--r-- | src/dht/gnunet-dht-driver.c | 101 | ||||
-rw-r--r-- | src/dht/gnunet-service-dht.c | 42 | ||||
-rw-r--r-- | src/dht/plugin_dhtlog_dummy.c | 24 | ||||
-rw-r--r-- | src/dht/test_dht_api.c | 4 | ||||
-rw-r--r-- | src/dht/test_dht_twopeer.c | 7 |
7 files changed, 105 insertions, 99 deletions
diff --git a/src/dht/dht_api.c b/src/dht/dht_api.c index eded50efc..9c378dca1 100644 --- a/src/dht/dht_api.c +++ b/src/dht/dht_api.c | |||
@@ -203,7 +203,8 @@ struct GNUNET_DHT_Handle | |||
203 | /** | 203 | /** |
204 | * Transmit the next pending message, called by notify_transmit_ready | 204 | * Transmit the next pending message, called by notify_transmit_ready |
205 | */ | 205 | */ |
206 | static size_t transmit_pending (void *cls, size_t size, void *buf); | 206 | static size_t |
207 | transmit_pending (void *cls, size_t size, void *buf); | ||
207 | 208 | ||
208 | 209 | ||
209 | /** | 210 | /** |
@@ -211,8 +212,8 @@ static size_t transmit_pending (void *cls, size_t size, void *buf); | |||
211 | * a demultiplexer which handles numerous message types | 212 | * a demultiplexer which handles numerous message types |
212 | * | 213 | * |
213 | */ | 214 | */ |
214 | static void service_message_handler (void *cls, | 215 | static void |
215 | const struct GNUNET_MessageHeader *msg); | 216 | service_message_handler (void *cls, const struct GNUNET_MessageHeader *msg); |
216 | 217 | ||
217 | 218 | ||
218 | 219 | ||
@@ -273,7 +274,8 @@ add_request_to_pending (void *cls, const GNUNET_HashCode * key, void *value) | |||
273 | * Try to send messages from list of messages to send | 274 | * Try to send messages from list of messages to send |
274 | * @param handle DHT_Handle | 275 | * @param handle DHT_Handle |
275 | */ | 276 | */ |
276 | static void process_pending_messages (struct GNUNET_DHT_Handle *handle); | 277 | static void |
278 | process_pending_messages (struct GNUNET_DHT_Handle *handle); | ||
277 | 279 | ||
278 | 280 | ||
279 | /** | 281 | /** |
@@ -760,11 +762,9 @@ GNUNET_DHT_route_stop (struct GNUNET_DHT_RouteHandle *route_handle) | |||
760 | route_handle->message); | 762 | route_handle->message); |
761 | } | 763 | } |
762 | GNUNET_assert (GNUNET_YES == | 764 | GNUNET_assert (GNUNET_YES == |
763 | GNUNET_CONTAINER_multihashmap_remove (route_handle-> | 765 | GNUNET_CONTAINER_multihashmap_remove |
764 | dht_handle-> | 766 | (route_handle->dht_handle->active_requests, &route_handle->key, |
765 | active_requests, | 767 | route_handle)); |
766 | &route_handle->key, | ||
767 | route_handle)); | ||
768 | GNUNET_free (route_handle->message); | 768 | GNUNET_free (route_handle->message); |
769 | GNUNET_free (route_handle); | 769 | GNUNET_free (route_handle); |
770 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "DHT route stop request processed\n"); | 770 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "DHT route stop request processed\n"); |
diff --git a/src/dht/dhtlog.h b/src/dht/dhtlog.h index 476a4039e..cdab36305 100644 --- a/src/dht/dhtlog.h +++ b/src/dht/dhtlog.h | |||
@@ -373,14 +373,14 @@ struct GNUNET_DHTLOG_Plugin | |||
373 | * | 373 | * |
374 | * @param c a configuration to use | 374 | * @param c a configuration to use |
375 | */ | 375 | */ |
376 | struct GNUNET_DHTLOG_Handle *GNUNET_DHTLOG_connect (const struct | 376 | struct GNUNET_DHTLOG_Handle * |
377 | GNUNET_CONFIGURATION_Handle | 377 | GNUNET_DHTLOG_connect (const struct GNUNET_CONFIGURATION_Handle *c); |
378 | *c); | ||
379 | 378 | ||
380 | /** | 379 | /** |
381 | * Shutdown the module. | 380 | * Shutdown the module. |
382 | */ | 381 | */ |
383 | void GNUNET_DHTLOG_disconnect (struct GNUNET_DHTLOG_Handle *api); | 382 | void |
383 | GNUNET_DHTLOG_disconnect (struct GNUNET_DHTLOG_Handle *api); | ||
384 | 384 | ||
385 | 385 | ||
386 | #if 0 /* keep Emacsens' auto-indent happy */ | 386 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/dht/gnunet-dht-driver.c b/src/dht/gnunet-dht-driver.c index d58e49e3b..4f411f4a9 100644 --- a/src/dht/gnunet-dht-driver.c +++ b/src/dht/gnunet-dht-driver.c | |||
@@ -1244,12 +1244,14 @@ end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
1244 | /** | 1244 | /** |
1245 | * Forward declaration. | 1245 | * Forward declaration. |
1246 | */ | 1246 | */ |
1247 | static void do_put (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); | 1247 | static void |
1248 | do_put (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); | ||
1248 | 1249 | ||
1249 | /** | 1250 | /** |
1250 | * Forward declaration. | 1251 | * Forward declaration. |
1251 | */ | 1252 | */ |
1252 | static void do_get (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); | 1253 | static void |
1254 | do_get (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); | ||
1253 | 1255 | ||
1254 | /** | 1256 | /** |
1255 | * Iterator over hash map entries. | 1257 | * Iterator over hash map entries. |
@@ -1465,8 +1467,8 @@ iterate_min_heap_peers (void *cls, struct GNUNET_CONTAINER_HeapNode *node, | |||
1465 | GNUNET_TESTING_daemons_connect (d1, d2, timeout, DEFAULT_RECONNECT_ATTEMPTS, | 1467 | GNUNET_TESTING_daemons_connect (d1, d2, timeout, DEFAULT_RECONNECT_ATTEMPTS, |
1466 | GNUNET_YES, NULL, NULL); | 1468 | GNUNET_YES, NULL, NULL); |
1467 | } | 1469 | } |
1468 | if (GNUNET_TIME_absolute_get_remaining (find_peer_context->endtime). | 1470 | if (GNUNET_TIME_absolute_get_remaining (find_peer_context->endtime).rel_value |
1469 | rel_value > 0) | 1471 | > 0) |
1470 | return GNUNET_YES; | 1472 | return GNUNET_YES; |
1471 | else | 1473 | else |
1472 | return GNUNET_NO; | 1474 | return GNUNET_NO; |
@@ -1475,10 +1477,10 @@ iterate_min_heap_peers (void *cls, struct GNUNET_CONTAINER_HeapNode *node, | |||
1475 | /** | 1477 | /** |
1476 | * Forward declaration. | 1478 | * Forward declaration. |
1477 | */ | 1479 | */ |
1478 | static void schedule_churn_find_peer_requests (void *cls, | 1480 | static void |
1479 | const struct | 1481 | schedule_churn_find_peer_requests (void *cls, |
1480 | GNUNET_SCHEDULER_TaskContext | 1482 | const struct GNUNET_SCHEDULER_TaskContext |
1481 | *tc); | 1483 | *tc); |
1482 | 1484 | ||
1483 | /** | 1485 | /** |
1484 | * Callback for iterating over all the peer connections of a peer group. | 1486 | * Callback for iterating over all the peer connections of a peer group. |
@@ -1555,12 +1557,11 @@ count_peers_churn_cb (void *cls, const struct GNUNET_PeerIdentity *first, | |||
1555 | */ | 1557 | */ |
1556 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 1558 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
1557 | "Out of %u peers, fewest connections is %d\n", | 1559 | "Out of %u peers, fewest connections is %d\n", |
1558 | GNUNET_CONTAINER_heap_get_size (find_peer_context-> | 1560 | GNUNET_CONTAINER_heap_get_size |
1559 | peer_min_heap), | 1561 | (find_peer_context->peer_min_heap), peer_count->count); |
1560 | peer_count->count); | ||
1561 | if ((peer_count->count == 0) && | 1562 | if ((peer_count->count == 0) && |
1562 | (GNUNET_TIME_absolute_get_remaining (find_peer_context->endtime). | 1563 | (GNUNET_TIME_absolute_get_remaining |
1563 | rel_value > 0)) | 1564 | (find_peer_context->endtime).rel_value > 0)) |
1564 | { | 1565 | { |
1565 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 1566 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
1566 | "Found peer with no connections, will choose some peer(s) at random to connect to!\n"); | 1567 | "Found peer with no connections, will choose some peer(s) at random to connect to!\n"); |
@@ -1570,8 +1571,9 @@ count_peers_churn_cb (void *cls, const struct GNUNET_PeerIdentity *first, | |||
1570 | GNUNET_SCHEDULER_add_now (&schedule_churn_find_peer_requests, | 1571 | GNUNET_SCHEDULER_add_now (&schedule_churn_find_peer_requests, |
1571 | find_peer_context); | 1572 | find_peer_context); |
1572 | } | 1573 | } |
1573 | else if ((GNUNET_TIME_absolute_get_remaining (find_peer_context->endtime). | 1574 | else if ((GNUNET_TIME_absolute_get_remaining |
1574 | rel_value > 0) && (find_peer_context->last_sent != 0)) | 1575 | (find_peer_context->endtime).rel_value > 0) && |
1576 | (find_peer_context->last_sent != 0)) | ||
1575 | { | 1577 | { |
1576 | GNUNET_SCHEDULER_add_now (&schedule_churn_find_peer_requests, | 1578 | GNUNET_SCHEDULER_add_now (&schedule_churn_find_peer_requests, |
1577 | find_peer_context); | 1579 | find_peer_context); |
@@ -1772,8 +1774,8 @@ churn_complete (void *cls, const char *emsg) | |||
1772 | } | 1774 | } |
1773 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 1775 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
1774 | "Added %d peers to heap, total size %d\n", count_added, | 1776 | "Added %d peers to heap, total size %d\n", count_added, |
1775 | GNUNET_CONTAINER_heap_get_size (find_peer_context-> | 1777 | GNUNET_CONTAINER_heap_get_size |
1776 | peer_min_heap)); | 1778 | (find_peer_context->peer_min_heap)); |
1777 | GNUNET_SCHEDULER_add_delayed (DEFAULT_PEER_DISCONNECT_TIMEOUT, | 1779 | GNUNET_SCHEDULER_add_delayed (DEFAULT_PEER_DISCONNECT_TIMEOUT, |
1778 | &schedule_churn_get_topology, | 1780 | &schedule_churn_get_topology, |
1779 | find_peer_context); | 1781 | find_peer_context); |
@@ -2262,14 +2264,14 @@ do_put (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
2262 | test_put->next); | 2264 | test_put->next); |
2263 | } | 2265 | } |
2264 | 2266 | ||
2265 | static void schedule_find_peer_requests (void *cls, | 2267 | static void |
2266 | const struct | 2268 | schedule_find_peer_requests (void *cls, |
2267 | GNUNET_SCHEDULER_TaskContext *tc); | 2269 | const struct GNUNET_SCHEDULER_TaskContext *tc); |
2268 | 2270 | ||
2269 | #if HAVE_MALICIOUS | 2271 | #if HAVE_MALICIOUS |
2270 | static void setup_malicious_peers (void *cls, | 2272 | static void |
2271 | const struct GNUNET_SCHEDULER_TaskContext | 2273 | setup_malicious_peers (void *cls, |
2272 | *tc); | 2274 | const struct GNUNET_SCHEDULER_TaskContext *tc); |
2273 | #endif | 2275 | #endif |
2274 | 2276 | ||
2275 | /** | 2277 | /** |
@@ -2322,8 +2324,8 @@ count_peers_cb (void *cls, const struct GNUNET_PeerIdentity *first, | |||
2322 | if ((find_peer_context->last_sent < 8) || | 2324 | if ((find_peer_context->last_sent < 8) || |
2323 | ((find_peer_context->current_peers < | 2325 | ((find_peer_context->current_peers < |
2324 | 2 * connection_estimate (num_peers, DEFAULT_BUCKET_SIZE)) && | 2326 | 2 * connection_estimate (num_peers, DEFAULT_BUCKET_SIZE)) && |
2325 | (GNUNET_TIME_absolute_get_remaining (find_peer_context->endtime). | 2327 | (GNUNET_TIME_absolute_get_remaining |
2326 | rel_value > 0) && | 2328 | (find_peer_context->endtime).rel_value > 0) && |
2327 | (find_peer_context->current_peers < target_total_connections))) | 2329 | (find_peer_context->current_peers < target_total_connections))) |
2328 | { | 2330 | { |
2329 | GNUNET_SCHEDULER_add_now (&schedule_find_peer_requests, | 2331 | GNUNET_SCHEDULER_add_now (&schedule_find_peer_requests, |
@@ -2424,11 +2426,9 @@ schedule_find_peer_requests (void *cls, | |||
2424 | peer_count = | 2426 | peer_count = |
2425 | GNUNET_CONTAINER_heap_remove_root (find_peer_ctx->peer_min_heap); | 2427 | GNUNET_CONTAINER_heap_remove_root (find_peer_ctx->peer_min_heap); |
2426 | GNUNET_assert (GNUNET_YES == | 2428 | GNUNET_assert (GNUNET_YES == |
2427 | GNUNET_CONTAINER_multihashmap_remove (find_peer_ctx-> | 2429 | GNUNET_CONTAINER_multihashmap_remove |
2428 | peer_hash, | 2430 | (find_peer_ctx->peer_hash, &peer_count->peer_id.hashPubKey, |
2429 | &peer_count->peer_id. | 2431 | peer_count)); |
2430 | hashPubKey, | ||
2431 | peer_count)); | ||
2432 | test_find_peer->daemon = | 2432 | test_find_peer->daemon = |
2433 | GNUNET_TESTING_daemon_get_by_id (pg, &peer_count->peer_id); | 2433 | GNUNET_TESTING_daemon_get_by_id (pg, &peer_count->peer_id); |
2434 | GNUNET_assert (test_find_peer->daemon != NULL); | 2434 | GNUNET_assert (test_find_peer->daemon != NULL); |
@@ -2879,17 +2879,14 @@ setup_malicious_peers (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
2879 | 2879 | ||
2880 | #if ONLY_TESTING | 2880 | #if ONLY_TESTING |
2881 | /* Forward declaration */ | 2881 | /* Forward declaration */ |
2882 | static void topology_callback (void *cls, | 2882 | static void |
2883 | const struct GNUNET_PeerIdentity *first, | 2883 | topology_callback (void *cls, const struct GNUNET_PeerIdentity *first, |
2884 | const struct GNUNET_PeerIdentity *second, | 2884 | const struct GNUNET_PeerIdentity *second, uint32_t distance, |
2885 | uint32_t distance, | 2885 | const struct GNUNET_CONFIGURATION_Handle *first_cfg, |
2886 | const struct GNUNET_CONFIGURATION_Handle | 2886 | const struct GNUNET_CONFIGURATION_Handle *second_cfg, |
2887 | *first_cfg, | 2887 | struct GNUNET_TESTING_Daemon *first_daemon, |
2888 | const struct GNUNET_CONFIGURATION_Handle | 2888 | struct GNUNET_TESTING_Daemon *second_daemon, |
2889 | *second_cfg, | 2889 | const char *emsg); |
2890 | struct GNUNET_TESTING_Daemon *first_daemon, | ||
2891 | struct GNUNET_TESTING_Daemon *second_daemon, | ||
2892 | const char *emsg); | ||
2893 | 2890 | ||
2894 | /** | 2891 | /** |
2895 | * Retry connecting two specific peers until they connect, | 2892 | * Retry connecting two specific peers until they connect, |
@@ -2993,12 +2990,12 @@ topology_callback (void *cls, const struct GNUNET_PeerIdentity *first, | |||
2993 | /* Get duration in seconds */ | 2990 | /* Get duration in seconds */ |
2994 | duration = | 2991 | duration = |
2995 | GNUNET_TIME_absolute_get_difference (connect_last_time, | 2992 | GNUNET_TIME_absolute_get_difference (connect_last_time, |
2996 | GNUNET_TIME_absolute_get ()). | 2993 | GNUNET_TIME_absolute_get |
2997 | rel_value / 1000; | 2994 | ()).rel_value / 1000; |
2998 | total_duration = | 2995 | total_duration = |
2999 | GNUNET_TIME_absolute_get_difference (connect_start_time, | 2996 | GNUNET_TIME_absolute_get_difference (connect_start_time, |
3000 | GNUNET_TIME_absolute_get ()). | 2997 | GNUNET_TIME_absolute_get |
3001 | rel_value / 1000; | 2998 | ()).rel_value / 1000; |
3002 | 2999 | ||
3003 | failed_conns_per_sec_recent = | 3000 | failed_conns_per_sec_recent = |
3004 | (double) new_failed_connections / (double) duration; | 3001 | (double) new_failed_connections / (double) duration; |
@@ -3086,8 +3083,8 @@ topology_callback (void *cls, const struct GNUNET_PeerIdentity *first, | |||
3086 | 3083 | ||
3087 | total_duration = | 3084 | total_duration = |
3088 | GNUNET_TIME_absolute_get_difference (connect_start_time, | 3085 | GNUNET_TIME_absolute_get_difference (connect_start_time, |
3089 | GNUNET_TIME_absolute_get ()). | 3086 | GNUNET_TIME_absolute_get |
3090 | rel_value / 1000; | 3087 | ()).rel_value / 1000; |
3091 | failed_conns_per_sec_total = | 3088 | failed_conns_per_sec_total = |
3092 | (long double) failed_connections / total_duration; | 3089 | (long double) failed_connections / total_duration; |
3093 | conns_per_sec_total = (long double) total_connections / total_duration; | 3090 | conns_per_sec_total = (long double) total_connections / total_duration; |
@@ -3299,14 +3296,16 @@ hostkey_callback (void *cls, const struct GNUNET_PeerIdentity *id, | |||
3299 | GNUNET_CONFIGURATION_have_value (config, "TESTING", "HOSTKEYSFILE")) | 3296 | GNUNET_CONFIGURATION_have_value (config, "TESTING", "HOSTKEYSFILE")) |
3300 | { | 3297 | { |
3301 | GAUGER_ID ("DHT_TESTING", "HOSTKEY_GENERATION", | 3298 | GAUGER_ID ("DHT_TESTING", "HOSTKEY_GENERATION", |
3302 | GNUNET_TIME_absolute_get_duration (hostkey_start_time). | 3299 | GNUNET_TIME_absolute_get_duration |
3303 | rel_value / (double) num_peers, "ms/hostkey", revision_str); | 3300 | (hostkey_start_time).rel_value / (double) num_peers, |
3301 | "ms/hostkey", revision_str); | ||
3304 | } | 3302 | } |
3305 | else | 3303 | else |
3306 | { | 3304 | { |
3307 | GAUGER_ID ("DHT_TESTING", "HOSTKEY_GENERATION_REAL", | 3305 | GAUGER_ID ("DHT_TESTING", "HOSTKEY_GENERATION_REAL", |
3308 | GNUNET_TIME_absolute_get_duration (hostkey_start_time). | 3306 | GNUNET_TIME_absolute_get_duration |
3309 | rel_value / (double) num_peers, "ms/hostkey", revision_str); | 3307 | (hostkey_start_time).rel_value / (double) num_peers, |
3308 | "ms/hostkey", revision_str); | ||
3310 | } | 3309 | } |
3311 | } | 3310 | } |
3312 | 3311 | ||
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 | */ |
937 | static size_t send_generic_reply (void *cls, size_t size, void *buf); | 937 | static size_t |
938 | send_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 */ |
941 | static size_t core_transmit_notify (void *cls, size_t size, void *buf); | 942 | static size_t |
943 | core_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 */ |
1477 | static void update_core_preference (void *cls, | 1480 | static void |
1478 | const struct GNUNET_SCHEDULER_TaskContext | 1481 | update_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 | */ |
2460 | static void route_message (const struct GNUNET_MessageHeader *msg, | 2464 | static void |
2461 | struct DHT_MessageContext *msg_ctx); | 2465 | route_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 | */ |
2818 | static void republish_content (void *cls, | 2823 | static void |
2819 | const struct GNUNET_SCHEDULER_TaskContext *tc); | 2824 | republish_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)); |
diff --git a/src/dht/plugin_dhtlog_dummy.c b/src/dht/plugin_dhtlog_dummy.c index a411c5934..563d97e46 100644 --- a/src/dht/plugin_dhtlog_dummy.c +++ b/src/dht/plugin_dhtlog_dummy.c | |||
@@ -281,18 +281,18 @@ set_malicious (struct GNUNET_PeerIdentity *peer) | |||
281 | * | 281 | * |
282 | * @return GNUNET_OK on success, GNUNET_SYSERR on failure | 282 | * @return GNUNET_OK on success, GNUNET_SYSERR on failure |
283 | */ | 283 | */ |
284 | int insert_stat (const struct GNUNET_PeerIdentity *peer, | 284 | int |
285 | unsigned int route_requests, unsigned int route_forwards, | 285 | insert_stat (const struct GNUNET_PeerIdentity *peer, |
286 | unsigned int result_requests, unsigned int client_requests, | 286 | unsigned int route_requests, unsigned int route_forwards, |
287 | unsigned int result_forwards, unsigned int gets, | 287 | unsigned int result_requests, unsigned int client_requests, |
288 | unsigned int puts, unsigned int data_inserts, | 288 | unsigned int result_forwards, unsigned int gets, unsigned int puts, |
289 | unsigned int find_peer_requests, | 289 | unsigned int data_inserts, unsigned int find_peer_requests, |
290 | unsigned int find_peers_started, unsigned int gets_started, | 290 | unsigned int find_peers_started, unsigned int gets_started, |
291 | unsigned int puts_started, | 291 | unsigned int puts_started, |
292 | unsigned int find_peer_responses_received, | 292 | unsigned int find_peer_responses_received, |
293 | unsigned int get_responses_received, | 293 | unsigned int get_responses_received, |
294 | unsigned int find_peer_responses_sent, | 294 | unsigned int find_peer_responses_sent, |
295 | unsigned int get_responses_sent) | 295 | unsigned int get_responses_sent) |
296 | { | 296 | { |
297 | return GNUNET_OK; | 297 | return GNUNET_OK; |
298 | } | 298 | } |
diff --git a/src/dht/test_dht_api.c b/src/dht/test_dht_api.c index 9fc5c2d7a..f5bb05d8b 100644 --- a/src/dht/test_dht_api.c +++ b/src/dht/test_dht_api.c | |||
@@ -237,8 +237,8 @@ test_find_peer_processor (void *cls, const struct GNUNET_HELLO_Message *hello) | |||
237 | * @param cls closure | 237 | * @param cls closure |
238 | * @param tc context information (why was this task triggered now?) | 238 | * @param tc context information (why was this task triggered now?) |
239 | */ | 239 | */ |
240 | void retry_find_peer_stop (void *cls, | 240 | void |
241 | const struct GNUNET_SCHEDULER_TaskContext *tc); | 241 | retry_find_peer_stop (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); |
242 | 242 | ||
243 | /** | 243 | /** |
244 | * Retry the find_peer task on timeout. | 244 | * Retry the find_peer task on timeout. |
diff --git a/src/dht/test_dht_twopeer.c b/src/dht/test_dht_twopeer.c index 50a27a093..63f200e7d 100644 --- a/src/dht/test_dht_twopeer.c +++ b/src/dht/test_dht_twopeer.c | |||
@@ -141,7 +141,8 @@ end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
141 | } | 141 | } |
142 | 142 | ||
143 | /* Forward declaration */ | 143 | /* Forward declaration */ |
144 | static void do_get (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); | 144 | static void |
145 | do_get (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); | ||
145 | 146 | ||
146 | /** | 147 | /** |
147 | * Iterator called on each result obtained for a DHT | 148 | * Iterator called on each result obtained for a DHT |
@@ -199,8 +200,8 @@ get_result_iterator (void *cls, struct GNUNET_TIME_Absolute exp, | |||
199 | 200 | ||
200 | } | 201 | } |
201 | 202 | ||
202 | static void stop_retry_get (void *cls, | 203 | static void |
203 | const struct GNUNET_SCHEDULER_TaskContext *tc); | 204 | stop_retry_get (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); |
204 | 205 | ||
205 | static void | 206 | static void |
206 | get_stop_finished (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 207 | get_stop_finished (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) |