gnunet-svn
[Top][All Lists]
Advanced

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

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


From: gnunet
Subject: [GNUnet-SVN] r18572 - gnunet/src/fs
Date: Tue, 13 Dec 2011 15:36:14 +0100

Author: grothoff
Date: 2011-12-13 15:36:14 +0100 (Tue, 13 Dec 2011)
New Revision: 18572

Modified:
   gnunet/src/fs/gnunet-service-fs.c
   gnunet/src/fs/gnunet-service-fs_lc.c
   gnunet/src/fs/gnunet-service-fs_pr.h
Log:
trying to fix #2000

Modified: gnunet/src/fs/gnunet-service-fs.c
===================================================================
--- gnunet/src/fs/gnunet-service-fs.c   2011-12-13 14:27:05 UTC (rev 18571)
+++ gnunet/src/fs/gnunet-service-fs.c   2011-12-13 14:36:14 UTC (rev 18572)
@@ -348,6 +348,7 @@
   pr = GSF_handle_p2p_query_ (other, message);
   if (NULL == pr)
     return GNUNET_SYSERR;
+  GSF_pending_request_get_data_ (pr)->has_started = GNUNET_YES;
   GSF_local_lookup_ (pr, &consider_forwarding, NULL);
   update_latencies (atsi, atsi_count);
   return GNUNET_OK;
@@ -415,6 +416,7 @@
     GNUNET_SERVER_receive_done (client, GNUNET_OK);
     break;
   case GNUNET_YES:
+    GSF_pending_request_get_data_ (pr)->has_started = GNUNET_YES;
     GSF_local_lookup_ (pr, &start_p2p_processing, client);
     break;
   default:

Modified: gnunet/src/fs/gnunet-service-fs_lc.c
===================================================================
--- gnunet/src/fs/gnunet-service-fs_lc.c        2011-12-13 14:27:05 UTC (rev 
18571)
+++ gnunet/src/fs/gnunet-service-fs_lc.c        2011-12-13 14:36:14 UTC (rev 
18572)
@@ -332,15 +332,15 @@
   if ((type == GNUNET_BLOCK_TYPE_FS_KBLOCK) ||
       (type == GNUNET_BLOCK_TYPE_FS_NBLOCK) || (type == GNUNET_BLOCK_TYPE_ANY))
   {
-    /* FIXME: this does currently not work to filter duplicate
-     * results from *local* datastore since the local store is
-     * queried before we continue to process additional
-     * messages from the client! -- fix protocol? */
     cr = lc->cr_head;
     while (cr != NULL)
     {
       prd = GSF_pending_request_get_data_ (cr->pr);
-      if ((0 != memcmp (&prd->query, &sm->query, sizeof (GNUNET_HashCode))) &&
+      /* only unify with queries that hae not yet started local processing
+        (SEARCH_MESSAGE_OPTION_CONTINUED was always set) and that have a
+        matching query and type */
+      if ((GNUNET_YES != prd->has_started) &&
+         (0 != memcmp (&prd->query, &sm->query, sizeof (GNUNET_HashCode))) &&
           (prd->type == type))
         break;
       cr = cr->next;

Modified: gnunet/src/fs/gnunet-service-fs_pr.h
===================================================================
--- gnunet/src/fs/gnunet-service-fs_pr.h        2011-12-13 14:27:05 UTC (rev 
18571)
+++ gnunet/src/fs/gnunet-service-fs_pr.h        2011-12-13 14:36:14 UTC (rev 
18572)
@@ -146,6 +146,12 @@
    */
   int has_target;
 
+  /**
+   * Has this request been started yet (local/p2p operations)?  Or are
+   * we still constructing it?
+   */
+  int has_started;
+
 };
 
 




reply via email to

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