From: Christian Grothoff Date: Thu, 16 Jun 2011 12:02:03 +0000 (+0000) Subject: fix X-Git-Tag: initial-import-from-subversion-38251~18139 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=b365d74222adc5fc86eb5803569904f8fa8958af;p=oweals%2Fgnunet.git fix --- diff --git a/src/fs/gnunet-service-fs_cp.c b/src/fs/gnunet-service-fs_cp.c index 9686c7dfe..1d7360624 100644 --- a/src/fs/gnunet-service-fs_cp.c +++ b/src/fs/gnunet-service-fs_cp.c @@ -1158,6 +1158,10 @@ GSF_handle_p2p_query_ (const struct GNUNET_PeerIdentity *other, GNUNET_break_op (0); return NULL; } + GNUNET_STATISTICS_update (GSF_stats, + gettext_noop ("# GET requests received (from other peers)"), + 1, + GNUNET_NO); gm = (const struct GetMessage*) message; type = ntohl (gm->type); bm = ntohl (gm->hash_bitmap); diff --git a/src/fs/gnunet-service-fs_pr.c b/src/fs/gnunet-service-fs_pr.c index 3c9916c13..10be10e12 100644 --- a/src/fs/gnunet-service-fs_pr.c +++ b/src/fs/gnunet-service-fs_pr.c @@ -138,6 +138,11 @@ struct GSF_PendingRequest */ uint32_t mingle; + /** + * Do we have a first UID yet? + */ + int have_first_uid; + }; @@ -969,6 +974,10 @@ handle_dht_reply (void *cls, struct ProcessReplyClosure prq; struct PutMigrationContext *pmc; + GNUNET_STATISTICS_update (GSF_stats, + gettext_noop ("# Replies received from DHT"), + 1, + GNUNET_NO); memset (&prq, 0, sizeof (prq)); prq.data = data; prq.expiration = exp; @@ -1133,14 +1142,21 @@ process_local_reply (void *cls, pr->qe = NULL; GNUNET_SCHEDULER_cancel (pr->warn_task); pr->warn_task = GNUNET_SCHEDULER_NO_TASK; - if (0 == pr->replies_seen_count) + if (GNUNET_NO == pr->have_first_uid) { pr->first_uid = uid; + pr->have_first_uid = GNUNET_YES; } else { if (uid == pr->first_uid) - key = NULL; /* all replies seen! */ + { + GNUNET_STATISTICS_update (GSF_stats, + gettext_noop ("# Datastore lookups concluded"), + 1, + GNUNET_NO); + key = NULL; /* all replies seen! */ + } } if (NULL == key) { @@ -1342,6 +1358,10 @@ GSF_local_lookup_ (struct GSF_PendingRequest *pr, pr->warn_task = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_MINUTES, &warn_delay_task, pr); + GNUNET_STATISTICS_update (GSF_stats, + gettext_noop ("# Datastore lookups initiated"), + 1, + GNUNET_NO); pr->qe = GNUNET_DATASTORE_get_key (GSF_dsh, pr->local_result_offset++, &pr->public_data.query, @@ -1418,6 +1438,10 @@ GSF_handle_p2p_content_ (struct GSF_ConnectedPeer *cp, GNUNET_break_op (0); return GNUNET_SYSERR; } + GNUNET_STATISTICS_update (GSF_stats, + gettext_noop ("# GAP PUT messages received"), + 1, + GNUNET_NO); /* now, lookup 'query' */ prq.data = (const void*) &put[1]; if (NULL != cp)