From: Christian Grothoff Date: Mon, 1 Nov 2010 22:44:28 +0000 (+0000) Subject: fixes from LRN for DEBUG code X-Git-Tag: initial-import-from-subversion-38251~19883 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=bdef044d942a5f75f698bef989a1e768e79d2976;p=oweals%2Fgnunet.git fixes from LRN for DEBUG code --- diff --git a/src/core/gnunet-service-core.c b/src/core/gnunet-service-core.c index 5e71ef897..767041087 100644 --- a/src/core/gnunet-service-core.c +++ b/src/core/gnunet-service-core.c @@ -42,9 +42,9 @@ #include "core.h" -#define DEBUG_HANDSHAKE GNUNET_NO +#define DEBUG_HANDSHAKE GNUNET_YES -#define DEBUG_CORE_QUOTA GNUNET_NO +#define DEBUG_CORE_QUOTA GNUNET_YES /** * Receive and send buffer windows grow over time. For @@ -3540,7 +3540,7 @@ handle_encrypted_message (struct Neighbour *n, #if DEBUG_CORE_SET_QUOTA GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received %u b/s as new inbound limit for peer `%4s'\n", - (unsigned int) ntohl (pt->inbound_bw_limit.rel_value__), + (unsigned int) ntohl (pt->inbound_bw_limit.value__), GNUNET_i2s (&n->peer)); #endif n->bw_out_external_limit = pt->inbound_bw_limit; diff --git a/src/datastore/datastore_api.c b/src/datastore/datastore_api.c index 4172b5c99..6c817a840 100644 --- a/src/datastore/datastore_api.c +++ b/src/datastore/datastore_api.c @@ -1318,7 +1318,7 @@ GNUNET_DATASTORE_get_random (struct GNUNET_DATASTORE_Handle *h, #if DEBUG_DATASTORE GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Asked to get random entry in %llu ms\n", - (unsigned long long) timeout.abs_value); + (unsigned long long) timeout.rel_value); #endif qc.rc.iter = iter; qc.rc.iter_cls = iter_cls; @@ -1378,7 +1378,7 @@ GNUNET_DATASTORE_get_zero_anonymity (struct GNUNET_DATASTORE_Handle *h, #if DEBUG_DATASTORE GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Asked to get zero-anonymity entry in %llu ms\n", - (unsigned long long) timeout.abs_value); + (unsigned long long) timeout.rel_value); #endif qc.rc.iter = iter; qc.rc.iter_cls = iter_cls; diff --git a/src/datastore/plugin_datastore_sqlite.c b/src/datastore/plugin_datastore_sqlite.c index 05ebed7c5..01df7b670 100644 --- a/src/datastore/plugin_datastore_sqlite.c +++ b/src/datastore/plugin_datastore_sqlite.c @@ -28,7 +28,7 @@ #include "plugin_datastore.h" #include -#define DEBUG_SQLITE GNUNET_NO +#define DEBUG_SQLITE GNUNET_YES /** @@ -667,7 +667,7 @@ sqlite_plugin_put (void *cls, type, GNUNET_h2s(key), priority, - (unsigned long long) GNUNET_TIME_absolute_get_remaining (expiration).abs_value, + (unsigned long long) GNUNET_TIME_absolute_get_remaining (expiration).rel_value, (long long) expiration.abs_value); #endif GNUNET_CRYPTO_hash (data, size, &vhash); diff --git a/src/dht/plugin_dhtlog_mysql_dump.c b/src/dht/plugin_dhtlog_mysql_dump.c index 8b16c155d..f8a2811b1 100644 --- a/src/dht/plugin_dhtlog_mysql_dump.c +++ b/src/dht/plugin_dhtlog_mysql_dump.c @@ -35,7 +35,7 @@ #include "dhtlog.h" -#define DEBUG_DHTLOG GNUNET_NO +#define DEBUG_DHTLOG GNUNET_YES /** * Maximum number of supported parameters for a prepared @@ -519,11 +519,11 @@ update_trials (unsigned long long trialuid, { int ret; #if DEBUG_DHTLOG - if (trialuid != current_trial) +/* if (trialuid != current_trial) { fprintf (stderr, _("Trialuid to update is not equal to current_trial\n")); - } + }*/ #endif if (outfile == NULL) @@ -586,11 +586,11 @@ add_connections (unsigned long long trialuid, unsigned int totalConnections) { int ret; #if DEBUG_DHTLOG - if (trialuid != current_trial) +/* if (trialuid != current_trial) { fprintf (stderr, _("Trialuid to update is not equal to current_trial(!)(?)\n")); - } + }*/ #endif if (outfile == NULL) return GNUNET_SYSERR; diff --git a/src/dht/plugin_dhtlog_mysql_dump_load.c b/src/dht/plugin_dhtlog_mysql_dump_load.c index ac4b91301..a5231d9eb 100644 --- a/src/dht/plugin_dhtlog_mysql_dump_load.c +++ b/src/dht/plugin_dhtlog_mysql_dump_load.c @@ -36,7 +36,7 @@ #include "dhtlog.h" -#define DEBUG_DHTLOG GNUNET_NO +#define DEBUG_DHTLOG GNUNET_YES /** * Maximum number of supported parameters for a prepared @@ -347,11 +347,11 @@ update_trials (unsigned long long trialuid, { int ret; #if DEBUG_DHTLOG - if (trialuid != current_trial) +/* if (trialuid != current_trial) { fprintf (stderr, _("Trialuid to update is not equal to current_trial\n")); - } + }*/ #endif if (outfile == NULL) @@ -404,11 +404,11 @@ add_connections (unsigned long long trialuid, unsigned int totalConnections) { int ret; #if DEBUG_DHTLOG - if (trialuid != current_trial) +/* if (trialuid != current_trial) { fprintf (stderr, _("Trialuid to update is not equal to current_trial(!)(?)\n")); - } + }*/ #endif if (outfile == NULL) return GNUNET_SYSERR; diff --git a/src/dv/gnunet-service-dv.c b/src/dv/gnunet-service-dv.c index c9360fbb4..2d91bce41 100644 --- a/src/dv/gnunet-service-dv.c +++ b/src/dv/gnunet-service-dv.c @@ -1534,9 +1534,10 @@ static int handle_dv_data_message (void *cls, else { #if DEBUG_MESSAGE_DROP - direct_id = GNUNET_strdup(GNUNET_i2s(&dn->identity)); + char *direct_id = GNUNET_strdup(GNUNET_i2s(&dn->identity)); GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "%s: DROPPING MESSAGE type %d, forwarding failed! Message immediately from %s!\n", GNUNET_i2s(&my_identity), ntohs(((struct GNUNET_MessageHeader *)&incoming[1])->type), direct_id); + GNUNET_free (direct_id); #endif return GNUNET_SYSERR; } diff --git a/src/fs/gnunet-service-fs.c b/src/fs/gnunet-service-fs.c index 1cd114261..ad770f779 100644 --- a/src/fs/gnunet-service-fs.c +++ b/src/fs/gnunet-service-fs.c @@ -41,7 +41,7 @@ #include "gnunet-service-fs_indexing.h" #include "fs.h" -#define DEBUG_FS GNUNET_NO +#define DEBUG_FS GNUNET_YES /** * Should we introduce random latency in processing? Required for proper @@ -2789,7 +2789,7 @@ target_peer_select_cb (void *cls, GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "NOT sending query since we send %u others to this peer in the last %llums\n", MAX_QUEUE_PER_PEER, - cp->avg_delay.abs_value); + cp->avg_delay.rel_value); #endif return GNUNET_YES; /* skip */ } @@ -2964,7 +2964,7 @@ forward_request_task (void *cls, GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "No peer selected for forwarding of query `%s', will try again in %llu ms!\n", GNUNET_h2s (&pr->query), - delay.abs_value); + delay.rel_value); #endif pr->task = GNUNET_SCHEDULER_add_delayed (sched, delay, @@ -3283,9 +3283,9 @@ struct GNUNET_TIME_Relative art_delay; 1, GNUNET_NO); #if DEBUG_FS - GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, +/* GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Duplicate response `%s', discarding.\n", - GNUNET_h2s (&mhash)); + GNUNET_h2s (&mhash));*/ #endif return GNUNET_YES; /* duplicate */ case GNUNET_BLOCK_EVALUATION_RESULT_INVALID: diff --git a/src/statistics/gnunet-service-statistics.c b/src/statistics/gnunet-service-statistics.c index 50f347694..92f79cc91 100644 --- a/src/statistics/gnunet-service-statistics.c +++ b/src/statistics/gnunet-service-statistics.c @@ -305,7 +305,7 @@ transmit (struct GNUNET_SERVER_Client *client, GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Transmitting value for `%s:%s' (%d): %llu\n", e->service, e->name, - e->persistent, e->abs_value); + e->persistent, e->value); #endif GNUNET_SERVER_notification_context_unicast (nc, client, &m->header, GNUNET_NO); GNUNET_free (m); @@ -479,7 +479,7 @@ handle_set (void *cls, "Received request to update statistic on `%s:%s' (%u) to/by %llu\n", service, name, (unsigned int) flags, - (unsigned long long) abs_value); + (unsigned long long) value); #endif pos = start; prev = NULL; @@ -522,7 +522,7 @@ handle_set (void *cls, #if DEBUG_STATISTICS GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Statistic `%s:%s' updated to value %llu.\n", - service, name, pos->abs_value); + service, name, pos->value); #endif if (changed) notify_change (pos); @@ -548,7 +548,7 @@ handle_set (void *cls, #if DEBUG_STATISTICS GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "New statistic on `%s:%s' with value %llu created.\n", - service, name, pos->abs_value); + service, name, pos->value); #endif GNUNET_SERVER_receive_done (client, GNUNET_OK); } diff --git a/src/topology/gnunet-daemon-topology.c b/src/topology/gnunet-daemon-topology.c index fa693f13a..dc7face2d 100644 --- a/src/topology/gnunet-daemon-topology.c +++ b/src/topology/gnunet-daemon-topology.c @@ -35,7 +35,7 @@ #include "gnunet_util_lib.h" -#define DEBUG_TOPOLOGY GNUNET_NO +#define DEBUG_TOPOLOGY GNUNET_YES /** * For how long do we blacklist a peer after a failed connection @@ -1275,7 +1275,7 @@ hello_advertising_ready (void *cls, #if DEBUG_TOPOLOGY GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Sending `%s' with %u bytes", - "HELLO" + "HELLO", (unsigned int) want); #endif GNUNET_STATISTICS_update (stats, diff --git a/src/transport/gnunet-service-transport.c b/src/transport/gnunet-service-transport.c index c1bb7bec6..87d73baf4 100644 --- a/src/transport/gnunet-service-transport.c +++ b/src/transport/gnunet-service-transport.c @@ -39,9 +39,9 @@ #include "plugin_transport.h" #include "transport.h" -#define DEBUG_BLACKLIST GNUNET_NO +#define DEBUG_BLACKLIST GNUNET_YES -#define DEBUG_PING_PONG GNUNET_NO +#define DEBUG_PING_PONG GNUNET_YES #define DEBUG_TRANSPORT_HELLO GNUNET_YES @@ -1554,7 +1554,7 @@ find_ready_address(struct NeighbourList *neighbour) best_address->addr, best_address->addrlen) : "", - best_address->latency.abs_value); + best_address->latency.rel_value); #endif } else @@ -1667,7 +1667,7 @@ try_transmission_to_peer (struct NeighbourList *neighbour) "No validated destination address available to transmit message of size %u to peer `%4s', will wait %llums to find an address.\n", mq->message_buf_size, GNUNET_i2s (&mq->neighbour_id), - timeout.abs_value); + timeout.rel_value); #endif /* FIXME: might want to trigger peerinfo lookup here (unless that's already pending...) */ diff --git a/src/transport/transport_api.c b/src/transport/transport_api.c index ad81940ae..5410aca8a 100644 --- a/src/transport/transport_api.c +++ b/src/transport/transport_api.c @@ -471,7 +471,7 @@ schedule_peer_transmission (struct GNUNET_TRANSPORT_Handle *h) #if DEBUG_TRANSPORT GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Would need %llu ms before bandwidth is available for delivery to `%4s', that is too long. Signaling timeout.\n", - duration.abs_value, + duration.rel_value, GNUNET_i2s (&n->id)); #endif if (th->notify_delay_task != GNUNET_SCHEDULER_NO_TASK) @@ -492,7 +492,7 @@ schedule_peer_transmission (struct GNUNET_TRANSPORT_Handle *h) (unsigned int) n->out_tracker.available_bytes_per_s__, (unsigned int) th->notify_size - sizeof (struct OutboundMessage), GNUNET_i2s (&n->id), - duration.abs_value); + duration.rel_value); #endif retry_time = GNUNET_TIME_relative_min (retry_time, duration); @@ -608,7 +608,7 @@ transport_notify_ready (void *cls, size_t size, void *buf) GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Message of %u bytes with timeout %llums constructed for `%4s'\n", (unsigned int) mret, - (unsigned long long) GNUNET_TIME_absolute_get_remaining (th->timeout).abs_value, + (unsigned long long) GNUNET_TIME_absolute_get_remaining (th->timeout).rel_value, GNUNET_i2s (&n->id)); #endif if (mret != 0) @@ -755,7 +755,7 @@ schedule_control_transmit (struct GNUNET_TRANSPORT_Handle *h, #if DEBUG_TRANSPORT GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Control transmit of %u bytes within %llums requested\n", - size, (unsigned long long) timeout.abs_value); + size, (unsigned long long) timeout.rel_value); #endif th = GNUNET_malloc (sizeof (struct ControlMessage)); th->h = h; @@ -868,11 +868,11 @@ GNUNET_TRANSPORT_set_quota (struct GNUNET_TRANSPORT_Handle *handle, if (n != NULL) { #if DEBUG_TRANSPORT - if (ntohl (quota_out.rel_value__) != n->out_tracker.available_bytes_per_s__) + if (ntohl (quota_out.value__) != n->out_tracker.available_bytes_per_s__) GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Quota changed from %u to %u for peer `%s'\n", (unsigned int) n->out_tracker.available_bytes_per_s__, - (unsigned int) ntohl (quota_out.rel_value__), + (unsigned int) ntohl (quota_out.value__), GNUNET_i2s (target)); else GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, @@ -888,7 +888,7 @@ GNUNET_TRANSPORT_set_quota (struct GNUNET_TRANSPORT_Handle *handle, #if DEBUG_TRANSPORT GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Quota changed to %u for peer `%s', but I have no such neighbour!\n", - (unsigned int) ntohl (quota_out.rel_value__), + (unsigned int) ntohl (quota_out.value__), GNUNET_i2s (target)); #endif } @@ -1235,7 +1235,7 @@ schedule_reconnect (struct GNUNET_TRANSPORT_Handle *h) #if DEBUG_TRANSPORT GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Scheduling task to reconnect to transport service in %llu ms.\n", - h->reconnect_delay.abs_value); + h->reconnect_delay.rel_value); #endif GNUNET_assert (h->client == NULL); GNUNET_assert (h->reconnect_task == GNUNET_SCHEDULER_NO_TASK); @@ -1802,7 +1802,7 @@ GNUNET_TRANSPORT_notify_transmit_ready (struct GNUNET_TRANSPORT_Handle GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Asking transport service for transmission of %u bytes to peer `%4s' within %llu ms.\n", size, GNUNET_i2s (target), - (unsigned long long) timeout.abs_value); + (unsigned long long) timeout.rel_value); #endif n = neighbour_find (handle, target); if (n == NULL)