Author: grothoff Date: 2008-02-20 20:30:35 -0700 (Wed, 20 Feb 2008) New Revision: 6394
Modified: GNUnet/src/applications/fs/gap/plan.c Log: avoid redundant queries Modified: GNUnet/src/applications/fs/gap/plan.c =================================================================== --- GNUnet/src/applications/fs/gap/plan.c 2008-02-21 02:53:35 UTC (rev 6393) +++ GNUnet/src/applications/fs/gap/plan.c 2008-02-21 03:30:35 UTC (rev 6394) @@ -650,6 +650,7 @@ { P2P_gap_query_MESSAGE *msg = buf; unsigned int size; + GNUNET_CronTime now; GNUNET_GE_ASSERT (NULL, req->key_count > 0); size = sizeof (P2P_gap_query_MESSAGE) @@ -676,9 +677,13 @@ GNUNET_bloomfilter_get_raw_data (req->bloomfilter, (char *) &msg->queries[req->key_count], req->bloomfilter_size); - req->last_request_time = GNUNET_get_time (); - req->last_prio_used = prio; - req->last_ttl_used = ttl; + now = GNUNET_get_time(); + if (now + ttl > req->last_request_time + req->last_ttl_used) + { + req->last_request_time = now; + req->last_prio_used = prio; + req->last_ttl_used = ttl; + } req->remaining_value -= prio; if (stats != NULL) stats->change (stat_gap_query_sent, 1); _______________________________________________ GNUnet-SVN mailing list GNUnet-SVN@gnu.org http://lists.gnu.org/mailman/listinfo/gnunet-svn