-options to play with
[oweals/gnunet.git] / src / fs / gnunet-service-fs_pe.c
index 0a5b7e4b277866893e01d2fb03df16fc467f7750..c7cac75c4939e386c2c0efbb5118731600c05363 100644 (file)
@@ -678,6 +678,7 @@ GSF_plan_notify_peer_disconnect_ (const struct GSF_ConnectedPeer *cp)
                                                         get_rp_key (rp), rp));
     while (NULL != (bi = rp->pe_head))
     {
+      prd = GSF_pending_request_get_data_ (bi->pr);
       GNUNET_CONTAINER_MDLL_remove (PE, rp->pe_head, rp->pe_tail, bi);
       GNUNET_CONTAINER_MDLL_remove (PR, prd->pr_head, prd->pr_tail, bi);
       GNUNET_free (bi);
@@ -699,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
@@ -713,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;
     }
   }
@@ -737,9 +741,9 @@ GSF_plan_notify_request_done_ (struct GSF_PendingRequest *pr)
   prd = GSF_pending_request_get_data_ (pr);
   while (NULL != (bi = prd->pr_head))
   {
+    rp = bi->rp;
     GNUNET_CONTAINER_MDLL_remove (PR, prd->pr_head, prd->pr_tail, bi);
     GNUNET_CONTAINER_MDLL_remove (PE, rp->pe_head, rp->pe_tail, bi);
-    rp = bi->rp;
     if (NULL == rp->pe_head)
     {
       GNUNET_CONTAINER_heap_remove_node (rp->hn);