From 42a0353260b0f1cf7f7d00f47399bfbc53e34bad Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Mon, 1 Feb 2010 14:15:34 +0000 Subject: [PATCH] fixes --- src/fs/fs_download.c | 2 +- src/fs/gnunet-service-fs.c | 9 +++++++-- src/fs/gnunet-service-fs_drq.c | 6 +++--- src/fs/test_fs_download.c | 6 +++--- src/fs/test_fs_download_data.conf | 6 +++--- 5 files changed, 17 insertions(+), 12 deletions(-) diff --git a/src/fs/fs_download.c b/src/fs/fs_download.c index 78ab5c814..289599471 100644 --- a/src/fs/fs_download.c +++ b/src/fs/fs_download.c @@ -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 diff --git a/src/fs/gnunet-service-fs.c b/src/fs/gnunet-service-fs.c index 30d15eb66..93123c8d8 100644 --- a/src/fs/gnunet-service-fs.c +++ b/src/fs/gnunet-service-fs.c @@ -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, diff --git a/src/fs/gnunet-service-fs_drq.c b/src/fs/gnunet-service-fs_drq.c index afca9d970..27db8263d 100644 --- a/src/fs/gnunet-service-fs_drq.c +++ b/src/fs/gnunet-service-fs_drq.c @@ -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, diff --git a/src/fs/test_fs_download.c b/src/fs/test_fs_download.c index d4b32b8c8..3968068e4 100644 --- a/src/fs/test_fs_download.c +++ b/src/fs/test_fs_download.c @@ -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); diff --git a/src/fs/test_fs_download_data.conf b/src/fs/test_fs_download_data.conf index 5e13cd530..d575f4f8c 100644 --- a/src/fs/test_fs_download_data.conf +++ b/src/fs/test_fs_download_data.conf @@ -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 -- 2.25.1