fixes
authorChristian Grothoff <christian@grothoff.org>
Mon, 1 Feb 2010 14:15:34 +0000 (14:15 +0000)
committerChristian Grothoff <christian@grothoff.org>
Mon, 1 Feb 2010 14:15:34 +0000 (14:15 +0000)
src/fs/fs_download.c
src/fs/gnunet-service-fs.c
src/fs/gnunet-service-fs_drq.c
src/fs/test_fs_download.c
src/fs/test_fs_download_data.conf

index 78ab5c814aaa4a84840a635c0b13caea0a590c69..28959947186914ed0e52e409eebf3ee3de1ef4c8 100644 (file)
@@ -36,7 +36,7 @@
 #include "fs.h"
 #include "fs_tree.h"
 
-#define DEBUG_DOWNLOAD GNUNET_YES
+#define DEBUG_DOWNLOAD GNUNET_NO
 
 /**
  * We're storing the IBLOCKS after the
index 30d15eb66ca6c0ef0065d973c06aa337bbacefb9..93123c8d8d76e0340babb0c66b9ed72742243818 100644 (file)
@@ -46,7 +46,7 @@
 #include "gnunet-service-fs_indexing.h"
 #include "fs.h"
 
-#define DEBUG_FS GNUNET_YES
+#define DEBUG_FS GNUNET_NO
 
 /**
  * Maximum number of outgoing messages we queue per peer.
@@ -1918,6 +1918,9 @@ process_local_reply (void *cls,
   pr->drq = NULL;
   if (NULL == key)
     {
+      if (pr->client_request_list != NULL)
+       GNUNET_SERVER_receive_done (pr->client_request_list->client_list->client, 
+                                   GNUNET_YES);
       /* no more results */
       if (pr->task == GNUNET_SCHEDULER_NO_TASK)
        pr->task = GNUNET_SCHEDULER_add_now (sched,
@@ -2347,8 +2350,10 @@ handle_start_search (void *cls,
                                     &sm->query,
                                     pr,
                                     GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE);
+  if (type == GNUNET_DATASTORE_BLOCKTYPE_DBLOCK)
+    type = GNUNET_DATASTORE_BLOCKTYPE_ANY; /* get on-demand blocks too! */
   pr->drq = GNUNET_FS_drq_get (&sm->query,
-                              pr->type,                               
+                              type,                           
                               &process_local_reply,
                               pr,
                               GNUNET_TIME_UNIT_FOREVER_REL,
index afca9d9702ce4d75cf8014f305c0449ee7274d25..27db8263def601d64ec7b520bc949c73169d2d1c 100644 (file)
@@ -144,9 +144,7 @@ run_next_request (void *cls,
                  const struct GNUNET_SCHEDULER_TaskContext *tc)
 {
   struct DatastoreRequestQueue *e = cls;
-
-  GNUNET_CONTAINER_DLL_remove (drq_head, drq_tail, e);
-  drq_running = e;
+  
   e->req (e->req_cls, GNUNET_YES);
 }
 
@@ -165,6 +163,8 @@ next_ds_request ()
   e = drq_head;
   if (e == NULL)
     return;
+  GNUNET_CONTAINER_DLL_remove (drq_head, drq_tail, e);
+  drq_running = e;
   GNUNET_SCHEDULER_cancel (sched, e->task);
   e->task = GNUNET_SCHEDULER_add_now (sched,
                                      &run_next_request,
index d4b32b8c8edc43b59174b653294628e373b8c35a..3968068e4709a5c3aaadb97a8fa9d60ace32c589 100644 (file)
@@ -29,7 +29,7 @@
 #include "gnunet_arm_service.h"
 #include "gnunet_fs_service.h"
 
-#define VERBOSE GNUNET_YES
+#define VERBOSE GNUNET_NO
 
 #define START_ARM GNUNET_YES
 
@@ -143,7 +143,7 @@ progress_cb (void *cls,
       break;
     case GNUNET_FS_STATUS_PUBLISH_COMPLETED:
       printf ("Publishing complete, %llu kbps.\n",
-             (unsigned long long) (FILESIZE * 1000 / (1+GNUNET_TIME_absolute_get_duration (start).value) / 1024));
+             (unsigned long long) (FILESIZE * 1000LL / (1+GNUNET_TIME_absolute_get_duration (start).value) / 1024LL));
       fn = GNUNET_DISK_mktemp ("gnunet-download-test-dst");
       start = GNUNET_TIME_absolute_get ();
       download = GNUNET_FS_download_start (fs,
@@ -160,7 +160,7 @@ progress_cb (void *cls,
       break;
     case GNUNET_FS_STATUS_DOWNLOAD_COMPLETED:
       printf ("Download complete,  %llu kbps.\n",
-             (unsigned long long) (FILESIZE * 1000 / (1+GNUNET_TIME_absolute_get_duration (start).value) / 1024));
+             (unsigned long long) (FILESIZE * 1000LL / (1+GNUNET_TIME_absolute_get_duration (start).value) / 1024LL));
       GNUNET_SCHEDULER_add_now (sched,
                                &abort_download_task,
                                NULL);
index 5e13cd53079f9f4a1781938753e3b07632c8d1e7..d575f4f8c372ce6d11887f55d63a216823a82b6b 100644 (file)
@@ -36,9 +36,9 @@ HOSTNAME = localhost
 [fs]
 PORT = 42471
 HOSTNAME = localhost
-DEBUG = YES
-PREFIX = valgrind --tool=memcheck --leak-check=yes
-BINARY = /home/grothoff/bin/gnunet-service-fs
+#DEBUG = YES
+#PREFIX = valgrind --tool=memcheck --leak-check=yes
+#BINARY = /home/grothoff/bin/gnunet-service-fs
 
 [testing]
 WEAKRANDOM = YES