gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r24778 - gnunet/src/fs


From: gnunet
Subject: [GNUnet-SVN] r24778 - gnunet/src/fs
Date: Mon, 5 Nov 2012 20:20:09 +0100

Author: grothoff
Date: 2012-11-05 20:20:09 +0100 (Mon, 05 Nov 2012)
New Revision: 24778

Modified:
   gnunet/src/fs/gnunet-service-fs_pe.c
   gnunet/src/fs/gnunet-service-fs_pr.c
Log:
-fix block download calculation

Modified: gnunet/src/fs/gnunet-service-fs_pe.c
===================================================================
--- gnunet/src/fs/gnunet-service-fs_pe.c        2012-11-05 19:11:40 UTC (rev 
24777)
+++ gnunet/src/fs/gnunet-service-fs_pe.c        2012-11-05 19:20:09 UTC (rev 
24778)
@@ -700,7 +700,7 @@
  *
  * @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 @@
   {
     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;
     }
   }

Modified: gnunet/src/fs/gnunet-service-fs_pr.c
===================================================================
--- gnunet/src/fs/gnunet-service-fs_pr.c        2012-11-05 19:11:40 UTC (rev 
24777)
+++ gnunet/src/fs/gnunet-service-fs_pr.c        2012-11-05 19:20:09 UTC (rev 
24778)
@@ -819,9 +819,10 @@
     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,




reply via email to

[Prev in Thread] Current Thread [Next in Thread]