diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-10-06 20:55:28 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-10-06 20:55:28 +0000 |
commit | 61c39c60565b386e0e12ea669556b030e8cd7180 (patch) | |
tree | 59109aeab8297bdc996faca8c4e38ec7426c36cf /src/dht | |
parent | 780eb09dd8040ecf8649d40ddf8314464e0fc48e (diff) |
-remove trailing whitespace
Diffstat (limited to 'src/dht')
-rw-r--r-- | src/dht/dht.h | 4 | ||||
-rw-r--r-- | src/dht/dht_api.c | 56 | ||||
-rw-r--r-- | src/dht/dht_test_lib.c | 16 | ||||
-rw-r--r-- | src/dht/dht_test_lib.h | 2 | ||||
-rw-r--r-- | src/dht/gnunet-dht-get.c | 4 | ||||
-rw-r--r-- | src/dht/gnunet-dht-monitor.c | 12 | ||||
-rw-r--r-- | src/dht/gnunet-service-dht_clients.c | 14 | ||||
-rw-r--r-- | src/dht/gnunet-service-dht_clients.h | 4 | ||||
-rw-r--r-- | src/dht/gnunet-service-dht_datacache.c | 4 | ||||
-rw-r--r-- | src/dht/gnunet-service-dht_hello.c | 4 | ||||
-rw-r--r-- | src/dht/gnunet-service-dht_neighbours.c | 34 | ||||
-rw-r--r-- | src/dht/gnunet-service-dht_neighbours.h | 2 | ||||
-rw-r--r-- | src/dht/gnunet-service-dht_routing.c | 4 | ||||
-rw-r--r-- | src/dht/test_dht_api.c | 2 | ||||
-rw-r--r-- | src/dht/test_dht_monitor.c | 32 | ||||
-rw-r--r-- | src/dht/test_dht_topo.c | 44 |
16 files changed, 119 insertions, 119 deletions
diff --git a/src/dht/dht.h b/src/dht/dht.h index a2c83e5ecb..86fbc16bbd 100644 --- a/src/dht/dht.h +++ b/src/dht/dht.h @@ -281,7 +281,7 @@ struct GNUNET_DHT_MonitorPutMessage * Hop count so far. */ uint32_t hop_count GNUNET_PACKED; - + /** * Replication level for this message */ @@ -377,7 +377,7 @@ struct GNUNET_DHT_MonitorGetMessage * Hop count */ uint32_t hop_count GNUNET_PACKED; - + /** * Replication level for this message */ diff --git a/src/dht/dht_api.c b/src/dht/dht_api.c index 3a6fcdc538..7b83c14c3b 100644 --- a/src/dht/dht_api.c +++ b/src/dht/dht_api.c @@ -115,7 +115,7 @@ struct GNUNET_DHT_PutHandle GNUNET_DHT_PutContinuation cont; /** - * Pending message associated with this PUT operation, + * Pending message associated with this PUT operation, * NULL after the message has been transmitted to the service. */ struct PendingMessage *pending; @@ -181,7 +181,7 @@ struct GNUNET_DHT_GetHandle /** * Key that this get request is for */ - struct GNUNET_HashCode key; + struct GNUNET_HashCode key; /** * Unique identifier for this request (for key collisions). @@ -201,7 +201,7 @@ struct GNUNET_DHT_GetHandle unsigned int seen_results_end; /** - * Offset into the 'seen_results' array marking the + * Offset into the 'seen_results' array marking the * position up to where we've send the hash codes to * the DHT for blocking (needed as we might not be * able to send all hash codes at once). @@ -226,7 +226,7 @@ struct GNUNET_DHT_MonitorHandle * DLL. */ struct GNUNET_DHT_MonitorHandle *prev; - + /** * Main handle to this DHT api. */ @@ -261,7 +261,7 @@ struct GNUNET_DHT_MonitorHandle * Closure for cb. */ void *cb_cls; - + }; @@ -297,7 +297,7 @@ struct GNUNET_DHT_Handle struct PendingMessage *pending_tail; /** - * Head of linked list of messages we would like to monitor. + * Head of linked list of messages we would like to monitor. */ struct GNUNET_DHT_MonitorHandle *monitor_head; @@ -353,7 +353,7 @@ struct GNUNET_DHT_Handle * @param msg the incoming message */ static void -service_message_handler (void *cls, +service_message_handler (void *cls, const struct GNUNET_MessageHeader *msg); @@ -401,7 +401,7 @@ queue_filter_messages (struct GNUNET_DHT_GetHandle *get_handle) if (delta > max) delta = max; msize = sizeof (struct GNUNET_DHT_ClientGetResultSeenMessage) + delta * sizeof (struct GNUNET_HashCode); - + pm = GNUNET_malloc (sizeof (struct PendingMessage) + msize); msg = (struct GNUNET_DHT_ClientGetResultSeenMessage *) &pm[1]; pm->msg = &msg->header; @@ -419,7 +419,7 @@ queue_filter_messages (struct GNUNET_DHT_GetHandle *get_handle) get_handle->seen_results_transmission_offset += delta; GNUNET_CONTAINER_DLL_insert_tail (get_handle->dht_handle->pending_head, get_handle->dht_handle->pending_tail, - pm); + pm); } } @@ -434,8 +434,8 @@ queue_filter_messages (struct GNUNET_DHT_GetHandle *get_handle) * @return #GNUNET_YES (always) */ static int -add_request_to_pending (void *cls, - const struct GNUNET_HashCode *key, +add_request_to_pending (void *cls, + const struct GNUNET_HashCode *key, void *value) { struct GNUNET_DHT_Handle *handle = cls; @@ -472,7 +472,7 @@ process_pending_messages (struct GNUNET_DHT_Handle *handle); * @param tc scheduler context */ static void -try_reconnect (void *cls, +try_reconnect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) { struct GNUNET_DHT_Handle *handle = cls; @@ -542,8 +542,8 @@ do_disconnect (struct GNUNET_DHT_Handle *handle) * @return number of bytes written to @a buf */ static size_t -transmit_pending (void *cls, - size_t size, +transmit_pending (void *cls, + size_t size, void *buf); @@ -591,8 +591,8 @@ process_pending_messages (struct GNUNET_DHT_Handle *handle) * @return number of bytes written to @a buf */ static size_t -transmit_pending (void *cls, - size_t size, +transmit_pending (void *cls, + size_t size, void *buf) { struct GNUNET_DHT_Handle *handle = cls; @@ -601,7 +601,7 @@ transmit_pending (void *cls, handle->th = NULL; if (NULL == buf) - { + { LOG (GNUNET_ERROR_TYPE_DEBUG, "Transmission to DHT service failed! Reconnecting!\n"); do_disconnect (handle); @@ -653,8 +653,8 @@ transmit_pending (void *cls, * #GNUNET_NO if the reply is malformed or we found a matching request */ static int -process_reply (void *cls, - const struct GNUNET_HashCode *key, +process_reply (void *cls, + const struct GNUNET_HashCode *key, void *value) { const struct GNUNET_DHT_ClientResultMessage *dht_msg = cls; @@ -700,14 +700,14 @@ process_reply (void *cls, data = &get_path[get_path_length]; /* remember that we've seen this result */ GNUNET_CRYPTO_hash (data, data_length, &hc); - if (get_handle->seen_results_size == get_handle->seen_results_end) + if (get_handle->seen_results_size == get_handle->seen_results_end) GNUNET_array_grow (get_handle->seen_results, get_handle->seen_results_size, get_handle->seen_results_size * 2 + 1); GNUNET_assert (get_handle->seen_results_end == get_handle->seen_results_transmission_offset); get_handle->seen_results[get_handle->seen_results_end++] = hc; /* no need to block it explicitly, service already knows about it! */ - get_handle->seen_results_transmission_offset++; + get_handle->seen_results_transmission_offset++; get_handle->iter (get_handle->iter_cls, GNUNET_TIME_absolute_ntoh (dht_msg->expiration), key, get_path, get_path_length, put_path, put_path_length, @@ -746,7 +746,7 @@ process_monitor_get_message (struct GNUNET_DHT_Handle *handle, ntohl (msg->desired_replication_level), ntohl (msg->get_path_length), (struct GNUNET_PeerIdentity *) &msg[1], - &msg->key); + &msg->key); } return GNUNET_OK; } @@ -879,7 +879,7 @@ process_put_confirmation_message (struct GNUNET_DHT_Handle *handle, cont = ph->cont; cont_cls = ph->cont_cls; GNUNET_DHT_put_cancel (ph); - if (NULL != cont) + if (NULL != cont) cont (cont_cls, GNUNET_OK); return GNUNET_OK; } @@ -1132,11 +1132,11 @@ mark_put_message_gone (void *cls, * @param cont_cls closure for @a cont */ struct GNUNET_DHT_PutHandle * -GNUNET_DHT_put (struct GNUNET_DHT_Handle *handle, +GNUNET_DHT_put (struct GNUNET_DHT_Handle *handle, const struct GNUNET_HashCode * key, uint32_t desired_replication_level, enum GNUNET_DHT_RouteOption options, - enum GNUNET_BLOCK_Type type, size_t size, + enum GNUNET_BLOCK_Type type, size_t size, const void *data, struct GNUNET_TIME_Absolute exp, struct GNUNET_TIME_Relative timeout, @@ -1194,7 +1194,7 @@ GNUNET_DHT_put (struct GNUNET_DHT_Handle *handle, * go out over the network (we can't stop that); However, if the PUT * has not yet been sent to the service, cancelling the PUT will stop * this from happening (but there is no way for the user of this API - * to tell if that is the case). The only use for this API is to + * to tell if that is the case). The only use for this API is to * prevent a later call to 'cont' from #GNUNET_DHT_put (i.e. because * the system is shutting down). * @@ -1310,7 +1310,7 @@ GNUNET_DHT_get_filter_known_results (struct GNUNET_DHT_GetHandle *get_handle, unsigned int needed; needed = get_handle->seen_results_end + num_results; - if (needed > get_handle->seen_results_size) + if (needed > get_handle->seen_results_size) GNUNET_array_grow (get_handle->seen_results, get_handle->seen_results_size, needed); @@ -1483,7 +1483,7 @@ GNUNET_DHT_monitor_stop (struct GNUNET_DHT_MonitorHandle *handle) pending); pending->in_pending_queue = GNUNET_YES; process_pending_messages (handle->dht_handle); - + GNUNET_free_non_null (handle->key); GNUNET_free (handle); } diff --git a/src/dht/dht_test_lib.c b/src/dht/dht_test_lib.c index de41b2eccc..9864da9499 100644 --- a/src/dht/dht_test_lib.c +++ b/src/dht/dht_test_lib.c @@ -49,7 +49,7 @@ struct GNUNET_DHT_TEST_Context * Main function of the test to run once all DHTs are available. */ GNUNET_DHT_TEST_AppMain app_main; - + /** * Closure for 'app_main'. */ @@ -73,7 +73,7 @@ struct GNUNET_DHT_TEST_Context * from GNUNET_TESTBED_service_connect() * @return service handle to return in 'op_result', NULL on error */ -static void * +static void * dht_connect_adapter (void *cls, const struct GNUNET_CONFIGURATION_Handle *cfg) { @@ -88,7 +88,7 @@ dht_connect_adapter (void *cls, * @param cls closure * @param op_result service handle returned from the connect adapter */ -static void +static void dht_disconnect_adapter (void *cls, void *op_result) { @@ -107,7 +107,7 @@ dht_disconnect_adapter (void *cls, * @param emsg error message in case the operation has failed; will be NULL if * operation has executed successfully. */ -static void +static void dht_connect_cb (void *cls, struct GNUNET_TESTBED_Operation *op, void *ca_result, @@ -115,7 +115,7 @@ dht_connect_cb (void *cls, { struct GNUNET_DHT_TEST_Context *ctx = cls; unsigned int i; - + if (NULL != emsg) { fprintf (stderr, "Failed to connect to DHT service: %s\n", @@ -134,7 +134,7 @@ dht_connect_cb (void *cls, ctx, ctx->num_peers, ctx->peers, - ctx->dhts); + ctx->dhts); } @@ -192,7 +192,7 @@ dht_test_run (void *cls, * @param tmain main function to run once the testbed is ready * @param tmain_cls closure for 'tmain' */ -void +void GNUNET_DHT_TEST_run (const char *testname, const char *cfgname, unsigned int num_peers, @@ -200,7 +200,7 @@ GNUNET_DHT_TEST_run (const char *testname, void *tmain_cls) { struct GNUNET_DHT_TEST_Context *ctx; - + ctx = GNUNET_malloc (sizeof (struct GNUNET_DHT_TEST_Context)); ctx->num_peers = num_peers; ctx->ops = GNUNET_malloc (num_peers * sizeof (struct GNUNET_TESTBED_Operation *)); diff --git a/src/dht/dht_test_lib.h b/src/dht/dht_test_lib.h index 061794af43..bfa9c1d85a 100644 --- a/src/dht/dht_test_lib.h +++ b/src/dht/dht_test_lib.h @@ -68,7 +68,7 @@ typedef void (*GNUNET_DHT_TEST_AppMain) (void *cls, * @param tmain main function to run once the testbed is ready * @param tmain_cls closure for 'tmain' */ -void +void GNUNET_DHT_TEST_run (const char *testname, const char *cfgname, unsigned int num_peers, diff --git a/src/dht/gnunet-dht-get.c b/src/dht/gnunet-dht-get.c index 345a58a135..e7e8093235 100644 --- a/src/dht/gnunet-dht-get.c +++ b/src/dht/gnunet-dht-get.c @@ -128,8 +128,8 @@ get_result_iterator (void *cls, struct GNUNET_TIME_Absolute exp, unsigned int put_path_length, enum GNUNET_BLOCK_Type type, size_t size, const void *data) { - FPRINTF (stdout, - _("Result %d, type %d:\n%.*s\n"), + FPRINTF (stdout, + _("Result %d, type %d:\n%.*s\n"), result_count, type, (unsigned int) size, (char *) data); result_count++; diff --git a/src/dht/gnunet-dht-monitor.c b/src/dht/gnunet-dht-monitor.c index b03c7c7c04..6ec29030d3 100644 --- a/src/dht/gnunet-dht-monitor.c +++ b/src/dht/gnunet-dht-monitor.c @@ -152,7 +152,7 @@ get_resp_callback (void *cls, const void *data, size_t size) { - FPRINTF (stdout, + FPRINTF (stdout, "RESPONSE #%u: type %d, key `%s', data `%.*s'\n", result_count, (int) type, @@ -191,7 +191,7 @@ put_callback (void *cls, const void *data, size_t size) { - FPRINTF (stdout, + FPRINTF (stdout, "PUT %u: type %d, key `%s', data `%.*s'\n", result_count, (int) type, @@ -221,14 +221,14 @@ run (void *cls, char *const *args, const char *cfgfile, if (NULL == (dht_handle = GNUNET_DHT_connect (cfg, 1))) { - FPRINTF (stderr, "%s", + FPRINTF (stderr, "%s", _("Failed to connect to DHT service!\n")); ret = 1; return; } if (GNUNET_BLOCK_TYPE_ANY == block_type) /* Type of data not set */ block_type = GNUNET_BLOCK_TYPE_TEST; - if (NULL != query_key) + if (NULL != query_key) { key = &hc; if (GNUNET_OK != @@ -240,8 +240,8 @@ run (void *cls, char *const *args, const char *cfgfile, key = NULL; } if (verbose) - FPRINTF (stderr, - "Monitoring for %s\n", + FPRINTF (stderr, + "Monitoring for %s\n", GNUNET_STRINGS_relative_time_to_string (timeout_request, GNUNET_NO)); GNUNET_SCHEDULER_add_delayed (timeout_request, &cleanup_task, NULL); monitor_handle = GNUNET_DHT_monitor_start (dht_handle, diff --git a/src/dht/gnunet-service-dht_clients.c b/src/dht/gnunet-service-dht_clients.c index 20fbba7896..f91311cf3d 100644 --- a/src/dht/gnunet-service-dht_clients.c +++ b/src/dht/gnunet-service-dht_clients.c @@ -199,7 +199,7 @@ struct ClientMonitorRecord * Previous element in DLL. */ struct ClientMonitorRecord *prev; - + /** * Type of blocks that are of interest */ @@ -367,7 +367,7 @@ handle_client_disconnect (void *cls, struct ClientMonitorRecord *monitor; GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, - "Local client %p disconnects\n", + "Local client %p disconnects\n", client); pos = find_active_client (client); GNUNET_CONTAINER_DLL_remove (client_head, client_tail, pos); @@ -384,7 +384,7 @@ handle_client_disconnect (void *cls, if (monitor->client == pos) { struct ClientMonitorRecord *next; - + GNUNET_free_non_null (monitor->key); next = monitor->next; GNUNET_CONTAINER_DLL_remove (monitor_head, monitor_tail, monitor); @@ -550,7 +550,7 @@ handle_dht_local_put (void *cls, struct GNUNET_SERVER_Client *client, &dht_msg[1], size - sizeof (struct GNUNET_DHT_ClientPutMessage)); GNUNET_CONTAINER_bloomfilter_free (peer_bf); - pm = GNUNET_malloc (sizeof (struct PendingMessage) + + pm = GNUNET_malloc (sizeof (struct PendingMessage) + sizeof (struct GNUNET_DHT_ClientPutConfirmationMessage)); conf = (struct GNUNET_DHT_ClientPutConfirmationMessage *) &pm[1]; conf->header.size = htons (sizeof (struct GNUNET_DHT_ClientPutConfirmationMessage)); @@ -884,7 +884,7 @@ handle_dht_local_monitor_stop (void *cls, struct GNUNET_SERVER_Client *client, } r = r->next; } - + GNUNET_SERVER_receive_done (client, GNUNET_OK); } @@ -1226,7 +1226,7 @@ void GDS_CLIENTS_process_get (uint32_t options, enum GNUNET_BLOCK_Type type, uint32_t hop_count, - uint32_t desired_replication_level, + uint32_t desired_replication_level, unsigned int path_length, const struct GNUNET_PeerIdentity *path, const struct GNUNET_HashCode * key) @@ -1386,7 +1386,7 @@ void GDS_CLIENTS_process_put (uint32_t options, enum GNUNET_BLOCK_Type type, uint32_t hop_count, - uint32_t desired_replication_level, + uint32_t desired_replication_level, unsigned int path_length, const struct GNUNET_PeerIdentity *path, struct GNUNET_TIME_Absolute exp, diff --git a/src/dht/gnunet-service-dht_clients.h b/src/dht/gnunet-service-dht_clients.h index f6d4253d58..44491377ec 100644 --- a/src/dht/gnunet-service-dht_clients.h +++ b/src/dht/gnunet-service-dht_clients.h @@ -72,7 +72,7 @@ void GDS_CLIENTS_process_get (uint32_t options, enum GNUNET_BLOCK_Type type, uint32_t hop_count, - uint32_t desired_replication_level, + uint32_t desired_replication_level, unsigned int path_length, const struct GNUNET_PeerIdentity *path, const struct GNUNET_HashCode * key); @@ -121,7 +121,7 @@ void GDS_CLIENTS_process_put (uint32_t options, enum GNUNET_BLOCK_Type type, uint32_t hop_count, - uint32_t desired_replication_level, + uint32_t desired_replication_level, unsigned int path_length, const struct GNUNET_PeerIdentity *path, struct GNUNET_TIME_Absolute exp, diff --git a/src/dht/gnunet-service-dht_datacache.c b/src/dht/gnunet-service-dht_datacache.c index 6f25a90d72..0e6daa120a 100644 --- a/src/dht/gnunet-service-dht_datacache.c +++ b/src/dht/gnunet-service-dht_datacache.c @@ -137,7 +137,7 @@ struct GetRequestContext * to stop iteration. */ static int -datacache_get_iterator (void *cls, +datacache_get_iterator (void *cls, const struct GNUNET_HashCode * key, size_t size, const char *data, enum GNUNET_BLOCK_Type type, struct GNUNET_TIME_Absolute exp, @@ -239,7 +239,7 @@ GDS_DATACACHE_handle_get (const struct GNUNET_HashCode * key, ctx.xquery_size = xquery_size; ctx.reply_bf = reply_bf; ctx.reply_bf_mutator = reply_bf_mutator; - r = GNUNET_DATACACHE_get (datacache, key, type, &datacache_get_iterator, + r = GNUNET_DATACACHE_get (datacache, key, type, &datacache_get_iterator, &ctx); LOG (GNUNET_ERROR_TYPE_DEBUG, "DATACACHE GET for key %s completed (%d). %u results found.\n", diff --git a/src/dht/gnunet-service-dht_hello.c b/src/dht/gnunet-service-dht_hello.c index d3415d11d9..bc964b91f7 100644 --- a/src/dht/gnunet-service-dht_hello.c +++ b/src/dht/gnunet-service-dht_hello.c @@ -107,8 +107,8 @@ GDS_HELLO_init () * Free memory occopied by the HELLO. */ static int -free_hello (void *cls, - const struct GNUNET_PeerIdentity *key, +free_hello (void *cls, + const struct GNUNET_PeerIdentity *key, void *hello) { GNUNET_free (hello); diff --git a/src/dht/gnunet-service-dht_neighbours.c b/src/dht/gnunet-service-dht_neighbours.c index 9085757359..889ef25ba1 100644 --- a/src/dht/gnunet-service-dht_neighbours.c +++ b/src/dht/gnunet-service-dht_neighbours.c @@ -313,7 +313,7 @@ struct PeerInfo struct PeerInfo *prev; /** - * Count of outstanding messages for peer. + * Count of outstanding messages for peer. */ unsigned int pending_count; @@ -553,8 +553,8 @@ struct BloomConstructorContext * @return #GNUNET_YES (we should continue to iterate) */ static int -add_known_to_bloom (void *cls, - const struct GNUNET_PeerIdentity *key, +add_known_to_bloom (void *cls, + const struct GNUNET_PeerIdentity *key, void *value) { struct BloomConstructorContext *ctx = cls; @@ -649,7 +649,7 @@ handle_core_connect (void *cls, const struct GNUNET_PeerIdentity *peer) /* Check for connect to self message */ if (0 == memcmp (&my_identity, peer, sizeof (struct GNUNET_PeerIdentity))) return; - GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Connected to %s\n", GNUNET_i2s (peer)); if (GNUNET_YES == @@ -714,7 +714,7 @@ handle_core_disconnect (void *cls, /* Check for disconnect from self message */ if (0 == memcmp (&my_identity, peer, sizeof (struct GNUNET_PeerIdentity))) return; - GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Disconnected %s\n", GNUNET_i2s (peer)); to_remove = @@ -919,14 +919,14 @@ get_forward_count (uint32_t hop_count, uint32_t target_replication) * Differences in the lower bits must count stronger than differences * in the higher bits. * - * @param target + * @param target * @param have * @return 0 if have==target, otherwise a number * that is larger as the distance between * the two hash codes increases */ static unsigned int -get_distance (const struct GNUNET_HashCode *target, +get_distance (const struct GNUNET_HashCode *target, const struct GNUNET_HashCode *have) { unsigned int bucket; @@ -1197,7 +1197,7 @@ get_target_peers (const struct GNUNET_HashCode *key, struct GNUNET_HashCode nhash; GNUNET_assert (NULL != bloom); - ret = get_forward_count (hop_count, target_replication); + ret = get_forward_count (hop_count, target_replication); if (0 == ret) { *targets = NULL; @@ -1231,7 +1231,7 @@ get_target_peers (const struct GNUNET_HashCode *key, *targets = rtargets; GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Forwarding query `%s' to %u peers (goal was %u peers)\n", - GNUNET_h2s (key), + GNUNET_h2s (key), off, ret); return off; @@ -1601,7 +1601,7 @@ core_init (void *cls, * #GNUNET_SYSERR to close it (signal serious error) */ static int -handle_dht_p2p_put (void *cls, +handle_dht_p2p_put (void *cls, const struct GNUNET_PeerIdentity *peer, const struct GNUNET_MessageHeader *message) { @@ -1654,7 +1654,7 @@ handle_dht_p2p_put (void *cls, tmp = GNUNET_strdup (GNUNET_i2s (&my_identity)); LOG_TRAFFIC (GNUNET_ERROR_TYPE_DEBUG, - "XDHT PUT %s: %s->%s (%u, %u=>%u)\n", + "XDHT PUT %s: %s->%s (%u, %u=>%u)\n", GNUNET_h2s (&put->key), GNUNET_i2s (peer), tmp, ntohl(put->hop_count), GNUNET_CRYPTO_hash_matching_bits (&phash, &put->key), @@ -1913,7 +1913,7 @@ handle_dht_p2p_get (void *cls, const struct GNUNET_PeerIdentity *peer, tmp = GNUNET_strdup (GNUNET_i2s (&my_identity)); LOG_TRAFFIC (GNUNET_ERROR_TYPE_DEBUG, - "XDHT GET %s: %s->%s (%u, %u=>%u) xq: %.*s\n", + "XDHT GET %s: %s->%s (%u, %u=>%u) xq: %.*s\n", GNUNET_h2s (&get->key), GNUNET_i2s (peer), tmp, ntohl(get->hop_count), GNUNET_CRYPTO_hash_matching_bits (&phash, &get->key), @@ -2059,7 +2059,7 @@ handle_dht_p2p_result (void *cls, const struct GNUNET_PeerIdentity *peer, char *tmp; tmp = GNUNET_strdup (GNUNET_i2s (&my_identity)); - LOG_TRAFFIC (GNUNET_ERROR_TYPE_DEBUG, "XDHT RESULT %s: %s->%s (%u)\n", + LOG_TRAFFIC (GNUNET_ERROR_TYPE_DEBUG, "XDHT RESULT %s: %s->%s (%u)\n", GNUNET_h2s (&prm->key), GNUNET_i2s (peer), tmp, get_path_length + 1); GNUNET_free (tmp); @@ -2132,10 +2132,10 @@ handle_dht_p2p_result (void *cls, const struct GNUNET_PeerIdentity *peer, struct GNUNET_PeerIdentity xput_path[get_path_length + 1 + put_path_length]; memcpy (xput_path, put_path, put_path_length * sizeof (struct GNUNET_PeerIdentity)); - memcpy (&xput_path[put_path_length], - xget_path, + memcpy (&xput_path[put_path_length], + xget_path, get_path_length * sizeof (struct GNUNET_PeerIdentity)); - + GDS_DATACACHE_handle_put (GNUNET_TIME_absolute_ntoh (prm->expiration_time), &prm->key, get_path_length + put_path_length, xput_path, @@ -2214,7 +2214,7 @@ GDS_NEIGHBOURS_done () /** * Get the ID of the local node. - * + * * @return identity of the local node */ struct GNUNET_PeerIdentity * diff --git a/src/dht/gnunet-service-dht_neighbours.h b/src/dht/gnunet-service-dht_neighbours.h index b3b33e3183..225c4aae0f 100644 --- a/src/dht/gnunet-service-dht_neighbours.h +++ b/src/dht/gnunet-service-dht_neighbours.h @@ -137,7 +137,7 @@ GDS_NEIGHBOURS_done (void); /** * Get the ID of the local node. - * + * * @return identity of the local node */ struct GNUNET_PeerIdentity * diff --git a/src/dht/gnunet-service-dht_routing.c b/src/dht/gnunet-service-dht_routing.c index d7e6505b07..e2995bd49a 100644 --- a/src/dht/gnunet-service-dht_routing.c +++ b/src/dht/gnunet-service-dht_routing.c @@ -321,8 +321,8 @@ expire_oldest_entry () GNUNET_CONTAINER_heap_remove_node (recent_req->heap_node); GNUNET_CONTAINER_bloomfilter_free (recent_req->reply_bf); GNUNET_assert (GNUNET_YES == - GNUNET_CONTAINER_multihashmap_remove (recent_map, - &recent_req->key, + GNUNET_CONTAINER_multihashmap_remove (recent_map, + &recent_req->key, recent_req)); GNUNET_free (recent_req); } diff --git a/src/dht/test_dht_api.c b/src/dht/test_dht_api.c index b1c39e893e..2295866d35 100644 --- a/src/dht/test_dht_api.c +++ b/src/dht/test_dht_api.c @@ -172,7 +172,7 @@ test_get (void *cls, int success) retry_context.next_timeout = BASE_TIMEOUT; get_handle = - GNUNET_DHT_get_start (dht_handle, + GNUNET_DHT_get_start (dht_handle, GNUNET_BLOCK_TYPE_TEST, &hash, 1, GNUNET_DHT_RO_NONE, NULL, 0, &test_get_iterator, NULL); diff --git a/src/dht/test_dht_monitor.c b/src/dht/test_dht_monitor.c index 74024edf26..303fe8f87d 100644 --- a/src/dht/test_dht_monitor.c +++ b/src/dht/test_dht_monitor.c @@ -42,7 +42,7 @@ /** * Information we keep for each GET operation. */ -struct GetOperation +struct GetOperation { /** * DLL. @@ -79,7 +79,7 @@ static struct GetOperation *get_tail; /** * Array of the testbed's peers. - */ + */ static struct GNUNET_TESTBED_Peer **my_peers; /** @@ -109,9 +109,9 @@ static unsigned int monitor_counter; * * @param cls the 'struct GNUNET_DHT_TestContext' * @param tc scheduler context - */ + */ static void -shutdown_task (void *cls, +shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) { struct GNUNET_DHT_TEST_Context *ctx = cls; @@ -177,7 +177,7 @@ dht_get_handler (void *cls, struct GNUNET_TIME_Absolute exp, GNUNET_break (0); return; } - GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Get successful\n"); GNUNET_DHT_get_stop (get_op->get); GNUNET_CONTAINER_DLL_remove (get_head, @@ -195,7 +195,7 @@ dht_get_handler (void *cls, struct GNUNET_TIME_Absolute exp, /** * Task to put the id of each peer into the DHT. - * + * * @param cls array with NUM_PEERS DHT handles * @param tc Task context */ @@ -208,7 +208,7 @@ do_puts (void *cls, struct GNUNET_HashCode value; unsigned int i; - GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Putting values into DHT\n"); for (i = 0; i < NUM_PEERS; i++) { @@ -217,13 +217,13 @@ do_puts (void *cls, GNUNET_DHT_put (hs[i], &key, 10U, GNUNET_DHT_RO_RECORD_ROUTE | GNUNET_DHT_RO_DEMULTIPLEX_EVERYWHERE, - GNUNET_BLOCK_TYPE_TEST, - sizeof (value), &value, + GNUNET_BLOCK_TYPE_TEST, + sizeof (value), &value, GNUNET_TIME_UNIT_FOREVER_ABS, - GNUNET_TIME_UNIT_FOREVER_REL, + GNUNET_TIME_UNIT_FOREVER_REL, NULL, NULL); } - put_task = GNUNET_SCHEDULER_add_delayed (PUT_FREQUENCY, + put_task = GNUNET_SCHEDULER_add_delayed (PUT_FREQUENCY, &do_puts, hs); } @@ -296,7 +296,7 @@ monitor_put_cb (void *cls, i = (unsigned int) (long) cls; GNUNET_log (GNUNET_ERROR_TYPE_INFO, "%u got a PUT message for key %s with %u bytes\n", - i, + i, GNUNET_h2s (key), size); monitor_counter++; } @@ -334,7 +334,7 @@ monitor_res_cb (void *cls, i = (unsigned int) (long) cls; GNUNET_log (GNUNET_ERROR_TYPE_INFO, "%u got a REPLY message for key %s with %u bytes\n", - i, + i, GNUNET_h2s (key), size); monitor_counter++; } @@ -372,7 +372,7 @@ run (void *cls, &monitor_res_cb, &monitor_put_cb, (void *)(long)i); - GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Peers setup, starting test\n"); put_task = GNUNET_SCHEDULER_add_now (&do_puts, dhts); for (i=0;i<num_peers;i++) @@ -384,7 +384,7 @@ run (void *cls, GNUNET_CONTAINER_DLL_insert (get_head, get_tail, get_op); - get_op->get = GNUNET_DHT_get_start (dhts[j], + get_op->get = GNUNET_DHT_get_start (dhts[j], GNUNET_BLOCK_TYPE_TEST, /* type */ &key, /*key to search */ 4U, /* replication level */ @@ -394,7 +394,7 @@ run (void *cls, &dht_get_handler, get_op); } } - timeout_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, + timeout_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, &shutdown_task, ctx); } diff --git a/src/dht/test_dht_topo.c b/src/dht/test_dht_topo.c index 1ab580d5b4..1fd61129b6 100644 --- a/src/dht/test_dht_topo.c +++ b/src/dht/test_dht_topo.c @@ -43,7 +43,7 @@ /** * Information we keep for each GET operation. */ -struct GetOperation +struct GetOperation { /** * DLL. @@ -90,7 +90,7 @@ static struct GetOperation *get_tail; /** * Array of the testbed's peers. - */ + */ static struct GNUNET_TESTBED_Peer **my_peers; /** @@ -173,10 +173,10 @@ stats_finished (void *cls, return; } for (i = 0; NULL != stats[i].name; i++) - FPRINTF (stderr, - "%6s/%60s = %12llu\n", + FPRINTF (stderr, + "%6s/%60s = %12llu\n", stats[i].subsystem, - stats[i].name, + stats[i].name, stats[i].total); GNUNET_SCHEDULER_cancel (put_task); GNUNET_DHT_TEST_cleanup (ctx); @@ -194,7 +194,7 @@ stats_finished (void *cls, * @param is_persistent GNUNET_YES if the value is persistent, GNUNET_NO if not * @return GNUNET_OK to continue, GNUNET_SYSERR to abort iteration */ -static int +static int handle_stats (void *cls, const struct GNUNET_TESTBED_Peer *peer, const char *subsystem, @@ -221,9 +221,9 @@ handle_stats (void *cls, * * @param cls the 'struct GNUNET_DHT_TestContext' * @param tc scheduler |