diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-03-25 13:17:52 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-03-25 13:17:52 +0000 |
commit | 9b171e93182f1a07be94142abfd1766dc5ea04ca (patch) | |
tree | 9e328cd60d759e2a5c889c1c6ef4909ac80f8fb2 /src/fs | |
parent | c899b45a0864a41ba052d906a3f9f0ecaf07bf14 (diff) | |
download | gnunet-9b171e93182f1a07be94142abfd1766dc5ea04ca.tar.gz gnunet-9b171e93182f1a07be94142abfd1766dc5ea04ca.zip |
handle indexed data correctly:
Diffstat (limited to 'src/fs')
-rw-r--r-- | src/fs/gnunet-service-fs.h | 2 | ||||
-rw-r--r-- | src/fs/gnunet-service-fs_pr.c | 4 | ||||
-rw-r--r-- | src/fs/test_fs_download.c | 6 | ||||
-rw-r--r-- | src/fs/test_fs_download_indexed.c | 11 |
4 files changed, 17 insertions, 6 deletions
diff --git a/src/fs/gnunet-service-fs.h b/src/fs/gnunet-service-fs.h index f04d063f7..c4a3d4bb9 100644 --- a/src/fs/gnunet-service-fs.h +++ b/src/fs/gnunet-service-fs.h | |||
@@ -33,7 +33,7 @@ | |||
33 | #include "gnunet_block_lib.h" | 33 | #include "gnunet_block_lib.h" |
34 | #include "fs.h" | 34 | #include "fs.h" |
35 | 35 | ||
36 | #define DEBUG_FS GNUNET_NO | 36 | #define DEBUG_FS GNUNET_YES |
37 | 37 | ||
38 | 38 | ||
39 | /** | 39 | /** |
diff --git a/src/fs/gnunet-service-fs_pr.c b/src/fs/gnunet-service-fs_pr.c index 8a14c4c00..ea8f3b80c 100644 --- a/src/fs/gnunet-service-fs_pr.c +++ b/src/fs/gnunet-service-fs_pr.c | |||
@@ -1080,7 +1080,9 @@ GSF_local_lookup_ (struct GSF_PendingRequest *pr, | |||
1080 | pr->llc_cont_cls = cont_cls; | 1080 | pr->llc_cont_cls = cont_cls; |
1081 | pr->qe = GNUNET_DATASTORE_get (GSF_dsh, | 1081 | pr->qe = GNUNET_DATASTORE_get (GSF_dsh, |
1082 | &pr->public_data.query, | 1082 | &pr->public_data.query, |
1083 | pr->public_data.type, | 1083 | pr->public_data.type == GNUNET_BLOCK_TYPE_FS_DBLOCK |
1084 | ? GNUNET_BLOCK_TYPE_ANY | ||
1085 | : pr->public_data.type, | ||
1084 | 1 /* queue priority */, | 1086 | 1 /* queue priority */, |
1085 | 1 /* max queue size */, | 1087 | 1 /* max queue size */, |
1086 | GNUNET_TIME_UNIT_FOREVER_REL, | 1088 | GNUNET_TIME_UNIT_FOREVER_REL, |
diff --git a/src/fs/test_fs_download.c b/src/fs/test_fs_download.c index 44e2cc48b..45df96043 100644 --- a/src/fs/test_fs_download.c +++ b/src/fs/test_fs_download.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of GNUnet. | 2 | This file is part of GNUnet. |
3 | (C) 2004, 2005, 2006, 2008, 2009 Christian Grothoff (and other contributing authors) | 3 | (C) 2004, 2005, 2006, 2008, 2009, 2011 Christian Grothoff (and other contributing authors) |
4 | 4 | ||
5 | GNUnet is free software; you can redistribute it and/or modify | 5 | GNUnet is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published | 6 | it under the terms of the GNU General Public License as published |
@@ -153,7 +153,7 @@ progress_cb (void *cls, | |||
153 | printf ("Publishing complete, %llu kbps.\n", | 153 | printf ("Publishing complete, %llu kbps.\n", |
154 | (unsigned long long) (FILESIZE * 1000LL / (1+GNUNET_TIME_absolute_get_duration (start).rel_value) / 1024LL)); | 154 | (unsigned long long) (FILESIZE * 1000LL / (1+GNUNET_TIME_absolute_get_duration (start).rel_value) / 1024LL)); |
155 | GAUGER ("FS", | 155 | GAUGER ("FS", |
156 | "Publishing speed", | 156 | "Publishing speed (insertion)", |
157 | (unsigned long long) (FILESIZE * 1000LL / (1+GNUNET_TIME_absolute_get_duration (start).rel_value) / 1024LL), | 157 | (unsigned long long) (FILESIZE * 1000LL / (1+GNUNET_TIME_absolute_get_duration (start).rel_value) / 1024LL), |
158 | "kb/s"); | 158 | "kb/s"); |
159 | fn = GNUNET_DISK_mktemp ("gnunet-download-test-dst"); | 159 | fn = GNUNET_DISK_mktemp ("gnunet-download-test-dst"); |
@@ -174,7 +174,7 @@ progress_cb (void *cls, | |||
174 | printf ("Download complete, %llu kbps.\n", | 174 | printf ("Download complete, %llu kbps.\n", |
175 | (unsigned long long) (FILESIZE * 1000LL / (1+GNUNET_TIME_absolute_get_duration (start).rel_value) / 1024LL)); | 175 | (unsigned long long) (FILESIZE * 1000LL / (1+GNUNET_TIME_absolute_get_duration (start).rel_value) / 1024LL)); |
176 | GAUGER ("FS", | 176 | GAUGER ("FS", |
177 | "Local download speed", | 177 | "Local download speed (inserted)", |
178 | (unsigned long long) (FILESIZE * 1000LL / (1+GNUNET_TIME_absolute_get_duration (start).rel_value) / 1024LL), | 178 | (unsigned long long) (FILESIZE * 1000LL / (1+GNUNET_TIME_absolute_get_duration (start).rel_value) / 1024LL), |
179 | "kb/s"); | 179 | "kb/s"); |
180 | GNUNET_SCHEDULER_add_now (&abort_download_task, | 180 | GNUNET_SCHEDULER_add_now (&abort_download_task, |
diff --git a/src/fs/test_fs_download_indexed.c b/src/fs/test_fs_download_indexed.c index 1a88ad80e..33ca42a16 100644 --- a/src/fs/test_fs_download_indexed.c +++ b/src/fs/test_fs_download_indexed.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of GNUnet. | 2 | This file is part of GNUnet. |
3 | (C) 2004, 2005, 2006, 2008, 2009 Christian Grothoff (and other contributing authors) | 3 | (C) 2004, 2005, 2006, 2008, 2009, 2011 Christian Grothoff (and other contributing authors) |
4 | 4 | ||
5 | GNUnet is free software; you can redistribute it and/or modify | 5 | GNUnet is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published | 6 | it under the terms of the GNU General Public License as published |
@@ -28,6 +28,7 @@ | |||
28 | #include "gnunet_util_lib.h" | 28 | #include "gnunet_util_lib.h" |
29 | #include "gnunet_arm_service.h" | 29 | #include "gnunet_arm_service.h" |
30 | #include "gnunet_fs_service.h" | 30 | #include "gnunet_fs_service.h" |
31 | #include <gauger.h> | ||
31 | 32 | ||
32 | #define VERBOSE GNUNET_NO | 33 | #define VERBOSE GNUNET_NO |
33 | 34 | ||
@@ -151,6 +152,10 @@ progress_cb (void *cls, | |||
151 | case GNUNET_FS_STATUS_PUBLISH_COMPLETED: | 152 | case GNUNET_FS_STATUS_PUBLISH_COMPLETED: |
152 | printf ("Publishing complete, %llu kbps.\n", | 153 | printf ("Publishing complete, %llu kbps.\n", |
153 | (unsigned long long) (FILESIZE * 1000LL / (1+GNUNET_TIME_absolute_get_duration (start).rel_value) / 1024LL)); | 154 | (unsigned long long) (FILESIZE * 1000LL / (1+GNUNET_TIME_absolute_get_duration (start).rel_value) / 1024LL)); |
155 | GAUGER ("FS", | ||
156 | "Publishing speed (indexing)", | ||
157 | (unsigned long long) (FILESIZE * 1000LL / (1+GNUNET_TIME_absolute_get_duration (start).rel_value) / 1024LL), | ||
158 | "kb/s"); | ||
154 | fn = GNUNET_DISK_mktemp ("gnunet-download-test-dst"); | 159 | fn = GNUNET_DISK_mktemp ("gnunet-download-test-dst"); |
155 | start = GNUNET_TIME_absolute_get (); | 160 | start = GNUNET_TIME_absolute_get (); |
156 | download = GNUNET_FS_download_start (fs, | 161 | download = GNUNET_FS_download_start (fs, |
@@ -168,6 +173,10 @@ progress_cb (void *cls, | |||
168 | case GNUNET_FS_STATUS_DOWNLOAD_COMPLETED: | 173 | case GNUNET_FS_STATUS_DOWNLOAD_COMPLETED: |
169 | printf ("Download complete, %llu kbps.\n", | 174 | printf ("Download complete, %llu kbps.\n", |
170 | (unsigned long long) (FILESIZE * 1000LL / (1+GNUNET_TIME_absolute_get_duration (start).rel_value) / 1024LL)); | 175 | (unsigned long long) (FILESIZE * 1000LL / (1+GNUNET_TIME_absolute_get_duration (start).rel_value) / 1024LL)); |
176 | GAUGER ("FS", | ||
177 | "Local download speed (indexed)", | ||
178 | (unsigned long long) (FILESIZE * 1000LL / (1+GNUNET_TIME_absolute_get_duration (start).rel_value) / 1024LL), | ||
179 | "kb/s"); | ||
171 | GNUNET_SCHEDULER_add_now (&abort_download_task, | 180 | GNUNET_SCHEDULER_add_now (&abort_download_task, |
172 | NULL); | 181 | NULL); |
173 | break; | 182 | break; |