From 7f54be6572be560f2ca9786a72f355dae86ad51d Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Mon, 5 Nov 2012 19:20:09 +0000 Subject: -fix block download calculation --- src/fs/gnunet-service-fs_pe.c | 7 +++++-- src/fs/gnunet-service-fs_pr.c | 7 ++++--- 2 files changed, 9 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/fs/gnunet-service-fs_pe.c b/src/fs/gnunet-service-fs_pe.c index 853197964..c7cac75c4 100644 --- a/src/fs/gnunet-service-fs_pe.c +++ b/src/fs/gnunet-service-fs_pe.c @@ -700,7 +700,7 @@ GSF_plan_notify_peer_disconnect_ (const struct GSF_ConnectedPeer *cp) * * @param pr_head request plan reference list to check. * @param sender the peer that we've sent the request to. - * @param result the timestamp to fill. + * @param result the timestamp to fill, set to "FOREVER" if never transmitted * @return GNUNET_YES if 'result' was changed, GNUNET_NO otherwise. */ int @@ -714,7 +714,10 @@ GSF_request_plan_reference_get_last_transmission_ ( { if (bi->rp->pp->cp == sender) { - *result = bi->rp->last_transmission; + if (0 == bi->rp->last_transmission.abs_value) + *result = GNUNET_TIME_UNIT_FOREVER_ABS; + else + *result = bi->rp->last_transmission; return GNUNET_YES; } } diff --git a/src/fs/gnunet-service-fs_pr.c b/src/fs/gnunet-service-fs_pr.c index 74a982970..e866f10ab 100644 --- a/src/fs/gnunet-service-fs_pr.c +++ b/src/fs/gnunet-service-fs_pr.c @@ -819,9 +819,10 @@ process_reply (void *cls, const struct GNUNET_HashCode * key, void *value) GNUNET_LOAD_update (GSF_rt_entry_lifetime, GNUNET_TIME_absolute_get_duration (pr-> public_data.start_time).rel_value); - if (! GSF_request_plan_reference_get_last_transmission_ (pr->public_data.pr_head, - prq->sender, - &last_transmission)) + if (GNUNET_YES != + GSF_request_plan_reference_get_last_transmission_ (pr->public_data.pr_head, + prq->sender, + &last_transmission)) last_transmission.abs_value = GNUNET_TIME_UNIT_FOREVER_ABS.abs_value; /* pass on to other peers / local clients */ pr->rh (pr->rh_cls, prq->eval, pr, prq->anonymity_level, prq->expiration, -- cgit v1.2.3