struct GNUNET_FS_TestDaemon *daemon = cls;
uint64_t pos;
uint8_t *cbuf = buf;
+ int mod;
for (pos=0;pos<max;pos++)
- cbuf[pos] = (uint8_t) ((offset * daemon->publish_seed) % (255 - (offset / 1024 / 32)));
+ {
+ mod = (255 - (offset / 1024 / 32));
+ if (mod == 0)
+ mod = 1;
+ cbuf[pos] = (uint8_t) ((offset * daemon->publish_seed) % mod));
+ }
return max;
}
[core]
PORT = 43470
HOSTNAME = localhost
+#TOTAL_QUOTA_IN = 9321
+#TOTAL_QUOTA_OUT = 9321
TOTAL_QUOTA_IN = 3932160
TOTAL_QUOTA_OUT = 3932160
-#DEBUG = YES
+# DEBUG = YES
#PREFIX = valgrind --tool=memcheck --leak-check=yes
#BINARY = /home/grothoff/bin/gnunet-service-core
PORT = 43471
HOSTNAME = localhost
#OPTIONS = -L DEBUG
-#DEBUG = YES
+# DEBUG = YES
#PREFIX = valgrind --tool=memcheck --leak-check=yes
#BINARY = /home/grothoff/bin/gnunet-service-fs
#PREFIX = xterm -e gdb -x cmd --args
#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.
&psc.target,
GNUNET_CONSTANTS_SERVICE_TIMEOUT,
GNUNET_BANDWIDTH_value_init ((uint32_t) -1 /* no limit */),
- DBLOCK_SIZE,
+ DBLOCK_SIZE * 2,
(uint64_t) cp->inc_preference,
&target_reservation_cb,
pr);
pr->remaining_priority = 0;
if (pr->client_request_list != NULL)
{
-#if DEBUG_FS
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "Transmitting result for query `%s' to local client\n",
- GNUNET_h2s (key));
-#endif
GNUNET_STATISTICS_update (stats,
gettext_noop ("# replies received for local clients"),
1,
#include "platform.h"
#include "fs_test_lib.h"
-#define VERBOSE GNUNET_YES
+#define VERBOSE GNUNET_NO
/**
* File-size we use for testing.
*/
-#define FILESIZE (1024 * 1024 * 2)
+#define FILESIZE (1024 * 1024 * 20)
/**
* How long until we give up on transmitting the message?
static int ok;
+static struct GNUNET_TIME_Absolute start_time;
static void
do_stop (void *cls,
const struct GNUNET_SCHEDULER_TaskContext *tc)
{
+ struct GNUNET_TIME_Relative del;
+ char *fancy;
+
GNUNET_FS_TEST_daemons_stop (sched,
NUM_DAEMONS,
daemons);
if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_PREREQ_DONE))
{
+ del = GNUNET_TIME_absolute_get_duration (start_time);
+ if (del.value == 0)
+ del.value = 1;
+ fancy = GNUNET_STRINGS_byte_size_fancy (((unsigned long long)FILESIZE) * 1000LL / del.value);
+ fprintf (stdout,
+ "Download speed was %s/s\n",
+ fancy);
+ GNUNET_free (fancy);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Finished download, shutting down\n",
(unsigned long long) FILESIZE);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Downloading %llu bytes\n",
(unsigned long long) FILESIZE);
+ start_time = GNUNET_TIME_absolute_get ();
GNUNET_FS_TEST_download (sched,
daemons[0],
TIMEOUT,