aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2010-04-08 13:59:24 +0000
committerChristian Grothoff <christian@grothoff.org>2010-04-08 13:59:24 +0000
commit2ddddd76e3435fa8e88a1328bf57b381914a726e (patch)
treeea8d1fa5b5fa39eab23b12d621a773a752df999e
parent65a939c8132e680adf1aa9d71b36b17aa2ba5b58 (diff)
downloadgnunet-2ddddd76e3435fa8e88a1328bf57b381914a726e.tar.gz
gnunet-2ddddd76e3435fa8e88a1328bf57b381914a726e.zip
mod
-rw-r--r--src/fs/fs_test_lib.c8
-rw-r--r--src/fs/fs_test_lib_data.conf6
-rw-r--r--src/fs/gnunet-service-fs.c9
-rw-r--r--src/fs/test_gnunet_service_fs_p2p.c17
4 files changed, 28 insertions, 12 deletions
diff --git a/src/fs/fs_test_lib.c b/src/fs/fs_test_lib.c
index fb179e8a4..205567ace 100644
--- a/src/fs/fs_test_lib.c
+++ b/src/fs/fs_test_lib.c
@@ -481,9 +481,15 @@ file_generator (void *cls,
481 struct GNUNET_FS_TestDaemon *daemon = cls; 481 struct GNUNET_FS_TestDaemon *daemon = cls;
482 uint64_t pos; 482 uint64_t pos;
483 uint8_t *cbuf = buf; 483 uint8_t *cbuf = buf;
484 int mod;
484 485
485 for (pos=0;pos<max;pos++) 486 for (pos=0;pos<max;pos++)
486 cbuf[pos] = (uint8_t) ((offset * daemon->publish_seed) % (255 - (offset / 1024 / 32))); 487 {
488 mod = (255 - (offset / 1024 / 32));
489 if (mod == 0)
490 mod = 1;
491 cbuf[pos] = (uint8_t) ((offset * daemon->publish_seed) % mod));
492 }
487 return max; 493 return max;
488} 494}
489 495
diff --git a/src/fs/fs_test_lib_data.conf b/src/fs/fs_test_lib_data.conf
index 820c1e639..24afb18a2 100644
--- a/src/fs/fs_test_lib_data.conf
+++ b/src/fs/fs_test_lib_data.conf
@@ -41,9 +41,11 @@ HOSTNAME = localhost
41[core] 41[core]
42PORT = 43470 42PORT = 43470
43HOSTNAME = localhost 43HOSTNAME = localhost
44#TOTAL_QUOTA_IN = 9321
45#TOTAL_QUOTA_OUT = 9321
44TOTAL_QUOTA_IN = 3932160 46TOTAL_QUOTA_IN = 3932160
45TOTAL_QUOTA_OUT = 3932160 47TOTAL_QUOTA_OUT = 3932160
46#DEBUG = YES 48# DEBUG = YES
47#PREFIX = valgrind --tool=memcheck --leak-check=yes 49#PREFIX = valgrind --tool=memcheck --leak-check=yes
48#BINARY = /home/grothoff/bin/gnunet-service-core 50#BINARY = /home/grothoff/bin/gnunet-service-core
49 51
@@ -51,7 +53,7 @@ TOTAL_QUOTA_OUT = 3932160
51PORT = 43471 53PORT = 43471
52HOSTNAME = localhost 54HOSTNAME = localhost
53#OPTIONS = -L DEBUG 55#OPTIONS = -L DEBUG
54#DEBUG = YES 56# DEBUG = YES
55#PREFIX = valgrind --tool=memcheck --leak-check=yes 57#PREFIX = valgrind --tool=memcheck --leak-check=yes
56#BINARY = /home/grothoff/bin/gnunet-service-fs 58#BINARY = /home/grothoff/bin/gnunet-service-fs
57#PREFIX = xterm -e gdb -x cmd --args 59#PREFIX = xterm -e gdb -x cmd --args
diff --git a/src/fs/gnunet-service-fs.c b/src/fs/gnunet-service-fs.c
index 9b64e49dd..1c93b88f3 100644
--- a/src/fs/gnunet-service-fs.c
+++ b/src/fs/gnunet-service-fs.c
@@ -47,7 +47,7 @@
47#include "gnunet-service-fs_indexing.h" 47#include "gnunet-service-fs_indexing.h"
48#include "fs.h" 48#include "fs.h"
49 49
50#define DEBUG_FS GNUNET_YES 50#define DEBUG_FS GNUNET_NO
51 51
52/** 52/**
53 * Maximum number of outgoing messages we queue per peer. 53 * Maximum number of outgoing messages we queue per peer.
@@ -1594,7 +1594,7 @@ forward_request_task (void *cls,
1594 &psc.target, 1594 &psc.target,
1595 GNUNET_CONSTANTS_SERVICE_TIMEOUT, 1595 GNUNET_CONSTANTS_SERVICE_TIMEOUT,
1596 GNUNET_BANDWIDTH_value_init ((uint32_t) -1 /* no limit */), 1596 GNUNET_BANDWIDTH_value_init ((uint32_t) -1 /* no limit */),
1597 DBLOCK_SIZE, 1597 DBLOCK_SIZE * 2,
1598 (uint64_t) cp->inc_preference, 1598 (uint64_t) cp->inc_preference,
1599 &target_reservation_cb, 1599 &target_reservation_cb,
1600 pr); 1600 pr);
@@ -2011,11 +2011,6 @@ process_reply (void *cls,
2011 pr->remaining_priority = 0; 2011 pr->remaining_priority = 0;
2012 if (pr->client_request_list != NULL) 2012 if (pr->client_request_list != NULL)
2013 { 2013 {
2014#if DEBUG_FS
2015 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
2016 "Transmitting result for query `%s' to local client\n",
2017 GNUNET_h2s (key));
2018#endif
2019 GNUNET_STATISTICS_update (stats, 2014 GNUNET_STATISTICS_update (stats,
2020 gettext_noop ("# replies received for local clients"), 2015 gettext_noop ("# replies received for local clients"),
2021 1, 2016 1,
diff --git a/src/fs/test_gnunet_service_fs_p2p.c b/src/fs/test_gnunet_service_fs_p2p.c
index 024e08155..09b1698e1 100644
--- a/src/fs/test_gnunet_service_fs_p2p.c
+++ b/src/fs/test_gnunet_service_fs_p2p.c
@@ -26,12 +26,12 @@
26#include "platform.h" 26#include "platform.h"
27#include "fs_test_lib.h" 27#include "fs_test_lib.h"
28 28
29#define VERBOSE GNUNET_YES 29#define VERBOSE GNUNET_NO
30 30
31/** 31/**
32 * File-size we use for testing. 32 * File-size we use for testing.
33 */ 33 */
34#define FILESIZE (1024 * 1024 * 2) 34#define FILESIZE (1024 * 1024 * 20)
35 35
36/** 36/**
37 * How long until we give up on transmitting the message? 37 * How long until we give up on transmitting the message?
@@ -48,16 +48,28 @@ static struct GNUNET_SCHEDULER_Handle *sched;
48 48
49static int ok; 49static int ok;
50 50
51static struct GNUNET_TIME_Absolute start_time;
51 52
52static void 53static void
53do_stop (void *cls, 54do_stop (void *cls,
54 const struct GNUNET_SCHEDULER_TaskContext *tc) 55 const struct GNUNET_SCHEDULER_TaskContext *tc)
55{ 56{
57 struct GNUNET_TIME_Relative del;
58 char *fancy;
59
56 GNUNET_FS_TEST_daemons_stop (sched, 60 GNUNET_FS_TEST_daemons_stop (sched,
57 NUM_DAEMONS, 61 NUM_DAEMONS,
58 daemons); 62 daemons);
59 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_PREREQ_DONE)) 63 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_PREREQ_DONE))
60 { 64 {
65 del = GNUNET_TIME_absolute_get_duration (start_time);
66 if (del.value == 0)
67 del.value = 1;
68 fancy = GNUNET_STRINGS_byte_size_fancy (((unsigned long long)FILESIZE) * 1000LL / del.value);
69 fprintf (stdout,
70 "Download speed was %s/s\n",
71 fancy);
72 GNUNET_free (fancy);
61 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 73 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
62 "Finished download, shutting down\n", 74 "Finished download, shutting down\n",
63 (unsigned long long) FILESIZE); 75 (unsigned long long) FILESIZE);
@@ -88,6 +100,7 @@ do_download (void *cls,
88 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 100 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
89 "Downloading %llu bytes\n", 101 "Downloading %llu bytes\n",
90 (unsigned long long) FILESIZE); 102 (unsigned long long) FILESIZE);
103 start_time = GNUNET_TIME_absolute_get ();
91 GNUNET_FS_TEST_download (sched, 104 GNUNET_FS_TEST_download (sched,
92 daemons[0], 105 daemons[0],
93 TIMEOUT, 106 TIMEOUT,