aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2010-05-27 12:15:12 +0000
committerChristian Grothoff <christian@grothoff.org>2010-05-27 12:15:12 +0000
commit9f589c7d5e5df521c5fc99d51e876a6fdcd24fa1 (patch)
treecdaf7e1da44d8b2260f3663b1e6984636a6880aa /src
parentd4ba6f055c65ca1b2cbf49cd4b935bf9bb966649 (diff)
downloadgnunet-9f589c7d5e5df521c5fc99d51e876a6fdcd24fa1.tar.gz
gnunet-9f589c7d5e5df521c5fc99d51e876a6fdcd24fa1.zip
logging, minor fixes
Diffstat (limited to 'src')
-rw-r--r--src/fs/gnunet-service-fs.c28
-rw-r--r--src/fs/test_gnunet_service_fs_migration.c8
-rw-r--r--src/fs/test_gnunet_service_fs_migration_data.conf4
3 files changed, 31 insertions, 9 deletions
diff --git a/src/fs/gnunet-service-fs.c b/src/fs/gnunet-service-fs.c
index 7611f979c..5389255c4 100644
--- a/src/fs/gnunet-service-fs.c
+++ b/src/fs/gnunet-service-fs.c
@@ -44,7 +44,7 @@
44#include "gnunet-service-fs_indexing.h" 44#include "gnunet-service-fs_indexing.h"
45#include "fs.h" 45#include "fs.h"
46 46
47#define DEBUG_FS GNUNET_NO 47#define DEBUG_FS GNUNET_YES
48 48
49/** 49/**
50 * Maximum number of outgoing messages we queue per peer. 50 * Maximum number of outgoing messages we queue per peer.
@@ -842,6 +842,11 @@ consider_migration (void *cls,
842 } 842 }
843 if (msize == 0) 843 if (msize == 0)
844 return GNUNET_YES; /* no content available */ 844 return GNUNET_YES; /* no content available */
845 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
846 "Trying to migrate `%s' (%u bytes) to `%s'\n",
847 GNUNET_h2s (&mb->query),
848 msize,
849 GNUNET_i2s (&cppid));
845 cp->cth 850 cp->cth
846 = GNUNET_CORE_notify_transmit_ready (core, 851 = GNUNET_CORE_notify_transmit_ready (core,
847 0, GNUNET_TIME_UNIT_FOREVER_REL, 852 0, GNUNET_TIME_UNIT_FOREVER_REL,
@@ -1500,9 +1505,26 @@ transmit_to_peer (void *cls,
1500 size -= sizeof (migm); 1505 size -= sizeof (migm);
1501 memcpy (&cbuf[msize], &mb[1], mb->size); 1506 memcpy (&cbuf[msize], &mb[1], mb->size);
1502 msize += mb->size; 1507 msize += mb->size;
1503 size -= mb->size; 1508 size -= mb->size;
1509#if DEBUG_FS
1510 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1511 "Pushing migration block `%s' (%u bytes) to `%s'\n",
1512 GNUNET_h2s (&mb->query),
1513 mb->size,
1514 GNUNET_i2s (&pid));
1515#endif
1504 break; 1516 break;
1505 } 1517 }
1518 else
1519 {
1520#if DEBUG_FS
1521 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1522 "Migration block `%s' (%u bytes) is not on migration list for peer `%s'\n",
1523 GNUNET_h2s (&mb->query),
1524 mb->size,
1525 GNUNET_i2s (&pid));
1526#endif
1527 }
1506 } 1528 }
1507 if ( (mb->used_targets >= MIGRATION_TARGET_COUNT) || 1529 if ( (mb->used_targets >= MIGRATION_TARGET_COUNT) ||
1508 (mb->used_targets >= GNUNET_CONTAINER_multihashmap_size (connected_peers)) ) 1530 (mb->used_targets >= GNUNET_CONTAINER_multihashmap_size (connected_peers)) )
@@ -1515,7 +1537,7 @@ transmit_to_peer (void *cls,
1515 &pid.hashPubKey, 1537 &pid.hashPubKey,
1516 cp); 1538 cp);
1517 } 1539 }
1518#if DEBUG_FS > 3 1540#if DEBUG_FS
1519 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1541 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1520 "Transmitting %u bytes to peer %u\n", 1542 "Transmitting %u bytes to peer %u\n",
1521 msize, 1543 msize,
diff --git a/src/fs/test_gnunet_service_fs_migration.c b/src/fs/test_gnunet_service_fs_migration.c
index 94e959f14..9cf8c3773 100644
--- a/src/fs/test_gnunet_service_fs_migration.c
+++ b/src/fs/test_gnunet_service_fs_migration.c
@@ -37,12 +37,12 @@
37/** 37/**
38 * How long until we give up on transmitting the message? 38 * How long until we give up on transmitting the message?
39 */ 39 */
40#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 600) 40#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 5)
41 41
42/** 42/**
43 * How long do we give the peers for content migration? 43 * How long do we give the peers for content migration?
44 */ 44 */
45#define MIGRATION_DELAY GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 60) 45#define MIGRATION_DELAY GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 5)
46 46
47#define SEED 42 47#define SEED 42
48 48
@@ -236,7 +236,7 @@ main (int argc, char *argv[])
236 GNUNET_GETOPT_OPTION_END 236 GNUNET_GETOPT_OPTION_END
237 }; 237 };
238 238
239 GNUNET_DISK_directory_remove ("/tmp/gnunet-test-fs-lib/"); 239 GNUNET_DISK_directory_remove ("/tmp/test-gnunet-service-fs-migration/");
240 GNUNET_log_setup ("test_gnunet_service_fs_migration", 240 GNUNET_log_setup ("test_gnunet_service_fs_migration",
241#if VERBOSE 241#if VERBOSE
242 "DEBUG", 242 "DEBUG",
@@ -247,7 +247,7 @@ main (int argc, char *argv[])
247 GNUNET_PROGRAM_run ((sizeof (argvx) / sizeof (char *)) - 1, 247 GNUNET_PROGRAM_run ((sizeof (argvx) / sizeof (char *)) - 1,
248 argvx, "test-gnunet-service-fs-migration", 248 argvx, "test-gnunet-service-fs-migration",
249 "nohelp", options, &run, NULL); 249 "nohelp", options, &run, NULL);
250 GNUNET_DISK_directory_remove ("/tmp/gnunet-test-fs-lib/"); 250 GNUNET_DISK_directory_remove ("/tmp/test-gnunet-service-fs-migration/");
251 return ok; 251 return ok;
252} 252}
253 253
diff --git a/src/fs/test_gnunet_service_fs_migration_data.conf b/src/fs/test_gnunet_service_fs_migration_data.conf
index f13ddad72..82606092c 100644
--- a/src/fs/test_gnunet_service_fs_migration_data.conf
+++ b/src/fs/test_gnunet_service_fs_migration_data.conf
@@ -42,7 +42,7 @@ HOSTNAME = localhost
42#TOTAL_QUOTA_OUT = 9321 42#TOTAL_QUOTA_OUT = 9321
43TOTAL_QUOTA_IN = 3932160 43TOTAL_QUOTA_IN = 3932160
44TOTAL_QUOTA_OUT = 3932160 44TOTAL_QUOTA_OUT = 3932160
45#DEBUG = YES 45DEBUG = YES
46#PREFIX = valgrind --tool=memcheck --leak-check=yes 46#PREFIX = valgrind --tool=memcheck --leak-check=yes
47 47
48[fs] 48[fs]
@@ -50,7 +50,7 @@ PORT = 43471
50HOSTNAME = localhost 50HOSTNAME = localhost
51#OPTIONS = -L DEBUG 51#OPTIONS = -L DEBUG
52ACTIVEMIGRATION = YES 52ACTIVEMIGRATION = YES
53#DEBUG = YES 53DEBUG = YES
54#PREFIX = valgrind --tool=memcheck --leak-check=yes 54#PREFIX = valgrind --tool=memcheck --leak-check=yes
55#PREFIX = xterm -e gdb -x cmd --args 55#PREFIX = xterm -e gdb -x cmd --args
56 56