gnunet-svn
[Top][All Lists]
Advanced

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

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


From: gnunet
Subject: [GNUnet-SVN] r15065 - gnunet/src/fs
Date: Thu, 21 Apr 2011 15:29:22 +0200

Author: grothoff
Date: 2011-04-21 15:29:22 +0200 (Thu, 21 Apr 2011)
New Revision: 15065

Modified:
   gnunet/src/fs/fs_download.c
   gnunet/src/fs/gnunet-service-fs_cp.c
   gnunet/src/fs/gnunet-service-fs_lc.c
   gnunet/src/fs/gnunet-service-fs_pr.c
   gnunet/src/fs/gnunet-service-fs_pr.h
Log:
fix

Modified: gnunet/src/fs/fs_download.c
===================================================================
--- gnunet/src/fs/fs_download.c 2011-04-21 13:05:22 UTC (rev 15064)
+++ gnunet/src/fs/fs_download.c 2011-04-21 13:29:22 UTC (rev 15065)
@@ -31,7 +31,7 @@
 #include "fs.h"
 #include "fs_tree.h"
 
-#define DEBUG_DOWNLOAD GNUNET_NO
+#define DEBUG_DOWNLOAD GNUNET_YES
 
 /**
  * Determine if the given download (options and meta data) should cause

Modified: gnunet/src/fs/gnunet-service-fs_cp.c
===================================================================
--- gnunet/src/fs/gnunet-service-fs_cp.c        2011-04-21 13:05:22 UTC (rev 
15064)
+++ gnunet/src/fs/gnunet-service-fs_cp.c        2011-04-21 13:29:22 UTC (rev 
15065)
@@ -616,6 +616,7 @@
  *
  * @param cls 'struct GSF_ConnectedPeer' of the peer that would
  *            have liked an answer to the request
+ * @param eval evaluation of the result
  * @param pr handle to the original pending request
  * @param expiration when does 'data' expire?
  * @param type type of the block
@@ -624,6 +625,7 @@
  */
 static void
 handle_p2p_reply (void *cls,
+                 enum GNUNET_BLOCK_EvaluationResult eval,
                  struct GSF_PendingRequest *pr,
                  struct GNUNET_TIME_Absolute expiration,
                  enum GNUNET_BLOCK_Type type,
@@ -683,6 +685,17 @@
                             msize,
                             &copy_reply,
                             pm);
+  if (eval != GNUNET_BLOCK_EVALUATION_OK_LAST)
+    return;
+  GNUNET_STATISTICS_update (GSF_stats,
+                           gettext_noop ("# P2P searches active"),
+                           -1,
+                           GNUNET_NO);
+  GNUNET_break (GNUNET_OK ==
+               GNUNET_CONTAINER_multihashmap_remove (cp->request_map,
+                                                     &prd->query,
+                                                     pr));
+  GSF_pending_request_cancel_ (pr);
 }
 
 

Modified: gnunet/src/fs/gnunet-service-fs_lc.c
===================================================================
--- gnunet/src/fs/gnunet-service-fs_lc.c        2011-04-21 13:05:22 UTC (rev 
15064)
+++ gnunet/src/fs/gnunet-service-fs_lc.c        2011-04-21 13:29:22 UTC (rev 
15065)
@@ -188,6 +188,7 @@
  * expiration.
  *
  * @param cls user-specified closure
+ * @param eval evaluation of the result
  * @param pr handle to the original pending request
  * @param expiration when does 'data' expire? 
  * @param type type of the block
@@ -196,6 +197,7 @@
  */
 static void
 client_response_handler (void *cls,
+                        enum GNUNET_BLOCK_EvaluationResult eval,
                         struct GSF_PendingRequest *pr,
                         struct GNUNET_TIME_Absolute expiration,
                         enum GNUNET_BLOCK_Type type,
@@ -242,6 +244,18 @@
              GNUNET_h2s (&prd->query),
              (unsigned int) prd->type);
 #endif
+  if (eval != GNUNET_BLOCK_EVALUATION_OK_LAST)
+    return;
+  GNUNET_CONTAINER_DLL_remove (lc->cr_head,
+                              lc->cr_tail,
+                              cr);
+  GSF_pending_request_cancel_ (cr->pr);
+  GNUNET_STATISTICS_update (GSF_stats,
+                           gettext_noop ("# client searches active"),
+                           - 1,
+                           GNUNET_NO);
+  GNUNET_free (cr);
+
 }
 
 

Modified: gnunet/src/fs/gnunet-service-fs_pr.c
===================================================================
--- gnunet/src/fs/gnunet-service-fs_pr.c        2011-04-21 13:05:22 UTC (rev 
15064)
+++ gnunet/src/fs/gnunet-service-fs_pr.c        2011-04-21 13:29:22 UTC (rev 
15065)
@@ -338,6 +338,7 @@
          if (pr == dpr)
            break; /* let the request live briefly... */
          dpr->rh (dpr->rh_cls,
+                  GNUNET_BLOCK_EVALUATION_REQUEST_VALID,
                   dpr,
                   GNUNET_TIME_UNIT_FOREVER_ABS,
                   GNUNET_BLOCK_TYPE_ANY,
@@ -705,11 +706,11 @@
                          GNUNET_TIME_absolute_get_duration 
(pr->public_data.start_time).rel_value);
       /* pass on to other peers / local clients */
       pr->rh (pr->rh_cls,            
+             prq->eval,
              pr,
              prq->expiration,
              prq->type,
              prq->data, prq->size);
-      GSF_pending_request_cancel_ (pr);
       return GNUNET_YES;
     case GNUNET_BLOCK_EVALUATION_OK_DUPLICATE:
       GNUNET_STATISTICS_update (GSF_stats,
@@ -764,6 +765,7 @@
   prq->request_found = GNUNET_YES;
   /* finally, pass on to other peer / local client */
   pr->rh (pr->rh_cls,
+         prq->eval,
          pr, 
          prq->expiration,
          prq->type,

Modified: gnunet/src/fs/gnunet-service-fs_pr.h
===================================================================
--- gnunet/src/fs/gnunet-service-fs_pr.h        2011-04-21 13:05:22 UTC (rev 
15064)
+++ gnunet/src/fs/gnunet-service-fs_pr.h        2011-04-21 13:29:22 UTC (rev 
15065)
@@ -158,6 +158,7 @@
  * expiration.
  *
  * @param cls user-specified closure
+ * @param eval evaluation of the result
  * @param pr handle to the original pending request
  * @param expiration when does 'data' expire?
  * @param type type of the block
@@ -165,6 +166,7 @@
  * @param data_len number of bytes in data
  */
 typedef void (*GSF_PendingRequestReplyHandler)(void *cls,
+                                              enum 
GNUNET_BLOCK_EvaluationResult eval,
                                               struct GSF_PendingRequest *pr,
                                               struct GNUNET_TIME_Absolute 
expiration,
                                               enum GNUNET_BLOCK_Type type,




reply via email to

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