handle indexed data correctly:
authorChristian Grothoff <christian@grothoff.org>
Fri, 25 Mar 2011 13:17:52 +0000 (13:17 +0000)
committerChristian Grothoff <christian@grothoff.org>
Fri, 25 Mar 2011 13:17:52 +0000 (13:17 +0000)
src/fs/gnunet-service-fs.h
src/fs/gnunet-service-fs_pr.c
src/fs/test_fs_download.c
src/fs/test_fs_download_indexed.c

index f04d063f7f2e45a9a7538a3e5d5c3e4e493d72c6..c4a3d4bb9b2db397214d33923ef438c638a6d7b7 100644 (file)
@@ -33,7 +33,7 @@
 #include "gnunet_block_lib.h"
 #include "fs.h"
 
-#define DEBUG_FS GNUNET_NO
+#define DEBUG_FS GNUNET_YES
 
 
 /**
index 8a14c4c007f796d0d83178f6ea3641364320e196..ea8f3b80cd22de03e8615ea2a0b2b2796cb2286f 100644 (file)
@@ -1080,7 +1080,9 @@ GSF_local_lookup_ (struct GSF_PendingRequest *pr,
   pr->llc_cont_cls = cont_cls;
   pr->qe = GNUNET_DATASTORE_get (GSF_dsh,
                                 &pr->public_data.query,
-                                pr->public_data.type,
+                                pr->public_data.type == GNUNET_BLOCK_TYPE_FS_DBLOCK 
+                                ? GNUNET_BLOCK_TYPE_ANY 
+                                : pr->public_data.type, 
                                 1 /* queue priority */,
                                 1 /* max queue size */,
                                 GNUNET_TIME_UNIT_FOREVER_REL,
index 44e2cc48bca0508c7c236d1c9afb7534d2e0d8a9..45df96043e76fd153c185539ce5ff4b99595392d 100644 (file)
@@ -1,6 +1,6 @@
 /*
      This file is part of GNUnet.
-     (C) 2004, 2005, 2006, 2008, 2009 Christian Grothoff (and other contributing authors)
+     (C) 2004, 2005, 2006, 2008, 2009, 2011 Christian Grothoff (and other contributing authors)
 
      GNUnet is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published
@@ -153,7 +153,7 @@ progress_cb (void *cls,
       printf ("Publishing complete, %llu kbps.\n",
              (unsigned long long) (FILESIZE * 1000LL / (1+GNUNET_TIME_absolute_get_duration (start).rel_value) / 1024LL));
       GAUGER ("FS",
-             "Publishing speed",
+             "Publishing speed (insertion)",
              (unsigned long long) (FILESIZE * 1000LL / (1+GNUNET_TIME_absolute_get_duration (start).rel_value) / 1024LL),
              "kb/s");      
       fn = GNUNET_DISK_mktemp ("gnunet-download-test-dst");
@@ -174,7 +174,7 @@ progress_cb (void *cls,
       printf ("Download complete,  %llu kbps.\n",
              (unsigned long long) (FILESIZE * 1000LL / (1+GNUNET_TIME_absolute_get_duration (start).rel_value) / 1024LL));
       GAUGER ("FS",
-             "Local download speed",
+             "Local download speed (inserted)",
              (unsigned long long) (FILESIZE * 1000LL / (1+GNUNET_TIME_absolute_get_duration (start).rel_value) / 1024LL),
              "kb/s");      
       GNUNET_SCHEDULER_add_now (&abort_download_task,
index 1a88ad80ef8ffed756f7d6e95ae4bbf5395f72d1..33ca42a168edd80582a5adc5cc8ef96b5732a8d1 100644 (file)
@@ -1,6 +1,6 @@
 /*
      This file is part of GNUnet.
-     (C) 2004, 2005, 2006, 2008, 2009 Christian Grothoff (and other contributing authors)
+     (C) 2004, 2005, 2006, 2008, 2009, 2011 Christian Grothoff (and other contributing authors)
 
      GNUnet is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published
@@ -28,6 +28,7 @@
 #include "gnunet_util_lib.h"
 #include "gnunet_arm_service.h"
 #include "gnunet_fs_service.h"
+#include <gauger.h>
 
 #define VERBOSE GNUNET_NO
 
@@ -151,6 +152,10 @@ progress_cb (void *cls,
     case GNUNET_FS_STATUS_PUBLISH_COMPLETED:
       printf ("Publishing complete, %llu kbps.\n",
              (unsigned long long) (FILESIZE * 1000LL / (1+GNUNET_TIME_absolute_get_duration (start).rel_value) / 1024LL));
+      GAUGER ("FS",
+             "Publishing speed (indexing)",
+             (unsigned long long) (FILESIZE * 1000LL / (1+GNUNET_TIME_absolute_get_duration (start).rel_value) / 1024LL),
+             "kb/s");      
       fn = GNUNET_DISK_mktemp ("gnunet-download-test-dst");
       start = GNUNET_TIME_absolute_get ();
       download = GNUNET_FS_download_start (fs,
@@ -168,6 +173,10 @@ progress_cb (void *cls,
     case GNUNET_FS_STATUS_DOWNLOAD_COMPLETED:
       printf ("Download complete,  %llu kbps.\n",
              (unsigned long long) (FILESIZE * 1000LL / (1+GNUNET_TIME_absolute_get_duration (start).rel_value) / 1024LL));
+      GAUGER ("FS",
+             "Local download speed (indexed)",
+             (unsigned long long) (FILESIZE * 1000LL / (1+GNUNET_TIME_absolute_get_duration (start).rel_value) / 1024LL),
+             "kb/s");      
       GNUNET_SCHEDULER_add_now (&abort_download_task,
                                NULL);
       break;