aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2009-10-20 08:18:33 +0000
committerChristian Grothoff <christian@grothoff.org>2009-10-20 08:18:33 +0000
commit6e6ae629601179fba79284331b8860f4272400c6 (patch)
treedcbec8f92bf8c570d3ca227c6a328f260a6e51a9
parent1f7e70bd8da6e1ca255bff652dba8707a27237af (diff)
downloadgnunet-6e6ae629601179fba79284331b8860f4272400c6.tar.gz
gnunet-6e6ae629601179fba79284331b8860f4272400c6.zip
final fixes, adding testcase to official suite
-rw-r--r--src/fs/Makefile.am2
-rw-r--r--src/fs/fs_download.c16
-rw-r--r--src/fs/fs_file_information.c1
-rw-r--r--src/fs/fs_publish.c2
-rw-r--r--src/fs/fs_tree.c2
-rw-r--r--src/fs/gnunet-service-fs.c8
-rw-r--r--src/fs/test_fs_directory.c6
-rw-r--r--src/fs/test_fs_download.c2
-rw-r--r--src/fs/test_fs_download_data.conf4
9 files changed, 24 insertions, 19 deletions
diff --git a/src/fs/Makefile.am b/src/fs/Makefile.am
index 85470e4d9..1e22b9900 100644
--- a/src/fs/Makefile.am
+++ b/src/fs/Makefile.am
@@ -108,7 +108,7 @@ check_PROGRAMS = \
108 test_fs_getopt \ 108 test_fs_getopt \
109 test_fs_uri 109 test_fs_uri
110 110
111TESTS = test_fs_directory test_fs_uri 111TESTS = test_fs_directory test_fs_download test_fs_uri
112 112
113# $(check_PROGRAMS) 113# $(check_PROGRAMS)
114 114
diff --git a/src/fs/fs_download.c b/src/fs/fs_download.c
index defc9724f..e0c4471ac 100644
--- a/src/fs/fs_download.c
+++ b/src/fs/fs_download.c
@@ -36,7 +36,7 @@
36#include "fs.h" 36#include "fs.h"
37#include "fs_tree.h" 37#include "fs_tree.h"
38 38
39#define DEBUG_DOWNLOAD GNUNET_YES 39#define DEBUG_DOWNLOAD GNUNET_NO
40 40
41/** 41/**
42 * We're storing the IBLOCKS after the 42 * We're storing the IBLOCKS after the
@@ -339,12 +339,7 @@ process_result (struct GNUNET_FS_DownloadContext *dc,
339 &query); 339 &query);
340 if (NULL == sm) 340 if (NULL == sm)
341 { 341 {
342 GNUNET_break (0); /* FIXME: this assertion actually fails for one 342 GNUNET_break (0);
343 of my tests, the ascii-strings of the
344 query match what was printed when the
345 request was originally made; this does
346 NOT happen if in line ~825 a HT size
347 of 1 is used! => bug in HT? */
348 return; 343 return;
349 } 344 }
350 if (size != calculate_block_size (GNUNET_ntohll (dc->uri->data.chk.file_length), 345 if (size != calculate_block_size (GNUNET_ntohll (dc->uri->data.chk.file_length),
@@ -442,6 +437,7 @@ process_result (struct GNUNET_FS_DownloadContext *dc,
442 } 437 }
443 GNUNET_CLIENT_disconnect (dc->client); 438 GNUNET_CLIENT_disconnect (dc->client);
444 dc->client = NULL; 439 dc->client = NULL;
440 GNUNET_free (sm);
445 return; 441 return;
446 } 442 }
447 } 443 }
@@ -501,7 +497,10 @@ process_result (struct GNUNET_FS_DownloadContext *dc,
501 } 497 }
502 // FIXME: make persistent 498 // FIXME: make persistent
503 if (sm->depth == dc->treedepth) 499 if (sm->depth == dc->treedepth)
504 return; 500 {
501 GNUNET_free (sm);
502 return;
503 }
505#if DEBUG_DOWNLOAD 504#if DEBUG_DOWNLOAD
506 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 505 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
507 "Triggering downloads of children (this block was at level %u and offset %llu)\n", 506 "Triggering downloads of children (this block was at level %u and offset %llu)\n",
@@ -523,6 +522,7 @@ process_result (struct GNUNET_FS_DownloadContext *dc,
523 off, 522 off,
524 sm->depth + 1); 523 sm->depth + 1);
525 } 524 }
525 GNUNET_free (sm);
526} 526}
527 527
528 528
diff --git a/src/fs/fs_file_information.c b/src/fs/fs_file_information.c
index 6d6a83ffe..d1d897b24 100644
--- a/src/fs/fs_file_information.c
+++ b/src/fs/fs_file_information.c
@@ -835,6 +835,7 @@ GNUNET_FS_file_information_destroy (struct GNUNET_FS_FileInformation *fi,
835 &fi->client_info); 835 &fi->client_info);
836 } 836 }
837 GNUNET_free_non_null (fi->emsg); 837 GNUNET_free_non_null (fi->emsg);
838 GNUNET_free_non_null (fi->chk_uri);
838 /* clean up serialization */ 839 /* clean up serialization */
839 if ( (NULL != fi->serialization) && 840 if ( (NULL != fi->serialization) &&
840 (0 != UNLINK (fi->serialization)) ) 841 (0 != UNLINK (fi->serialization)) )
diff --git a/src/fs/fs_publish.c b/src/fs/fs_publish.c
index 145b7605c..c143b6d17 100644
--- a/src/fs/fs_publish.c
+++ b/src/fs/fs_publish.c
@@ -40,7 +40,7 @@
40#include "fs.h" 40#include "fs.h"
41#include "fs_tree.h" 41#include "fs_tree.h"
42 42
43#define DEBUG_PUBLISH GNUNET_YES 43#define DEBUG_PUBLISH GNUNET_NO
44 44
45/** 45/**
46 * Maximum allowed size for a KBlock. 46 * Maximum allowed size for a KBlock.
diff --git a/src/fs/fs_tree.c b/src/fs/fs_tree.c
index 047fdd332..83da423f3 100644
--- a/src/fs/fs_tree.c
+++ b/src/fs/fs_tree.c
@@ -31,7 +31,7 @@
31#include "platform.h" 31#include "platform.h"
32#include "fs_tree.h" 32#include "fs_tree.h"
33 33
34#define DEBUG_TREE GNUNET_YES 34#define DEBUG_TREE GNUNET_NO
35 35
36/** 36/**
37 * Context for an ECRS-based file encoder that computes 37 * Context for an ECRS-based file encoder that computes
diff --git a/src/fs/gnunet-service-fs.c b/src/fs/gnunet-service-fs.c
index 639780fc2..a810e72cb 100644
--- a/src/fs/gnunet-service-fs.c
+++ b/src/fs/gnunet-service-fs.c
@@ -47,7 +47,7 @@
47#include "gnunet_util_lib.h" 47#include "gnunet_util_lib.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/** 53/**
@@ -875,6 +875,12 @@ read_index_list ()
875 "FS"); 875 "FS");
876 return; 876 return;
877 } 877 }
878 if (GNUNET_NO == GNUNET_DISK_file_test (fn))
879 {
880 /* no index info yet */
881 GNUNET_free (fn);
882 return;
883 }
878 rh = GNUNET_BIO_read_open (fn); 884 rh = GNUNET_BIO_read_open (fn);
879 if (NULL == rh) 885 if (NULL == rh)
880 { 886 {
diff --git a/src/fs/test_fs_directory.c b/src/fs/test_fs_directory.c
index 1f77dcf14..9783e5903 100644
--- a/src/fs/test_fs_directory.c
+++ b/src/fs/test_fs_directory.c
@@ -134,7 +134,7 @@ testDirectory (unsigned int i)
134 (unsigned long long) dlen, 134 (unsigned long long) dlen,
135 s); 135 s);
136 GNUNET_free (s); 136 GNUNET_free (s);
137 if (i < 1000) 137 if (i < 100)
138 { 138 {
139 cls.pos = 0; 139 cls.pos = 0;
140 cls.uri = uris; 140 cls.uri = uris;
@@ -169,10 +169,8 @@ main (int argc, char *argv[])
169 "WARNING", 169 "WARNING",
170#endif 170#endif
171 NULL); 171 NULL);
172 for (i = 17; i < 4000; i *= 2) 172 for (i = 17; i < 1000; i *= 2)
173 failureCount += testDirectory (i); 173 failureCount += testDirectory (i);
174 fprintf (stderr, "\n");
175
176 if (failureCount != 0) 174 if (failureCount != 0)
177 return 1; 175 return 1;
178 return 0; 176 return 0;
diff --git a/src/fs/test_fs_download.c b/src/fs/test_fs_download.c
index f6fb2a1f2..879f054b8 100644
--- a/src/fs/test_fs_download.c
+++ b/src/fs/test_fs_download.c
@@ -29,7 +29,7 @@
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 31
32#define VERBOSE GNUNET_YES 32#define VERBOSE GNUNET_NO
33 33
34#define START_ARM GNUNET_YES 34#define START_ARM GNUNET_YES
35 35
diff --git a/src/fs/test_fs_download_data.conf b/src/fs/test_fs_download_data.conf
index 41678142c..d55191a32 100644
--- a/src/fs/test_fs_download_data.conf
+++ b/src/fs/test_fs_download_data.conf
@@ -19,7 +19,7 @@ HOSTNAME = localhost
19DEFAULTSERVICES = resolver datastore transport core fs 19DEFAULTSERVICES = resolver datastore transport core fs
20 20
21[datastore] 21[datastore]
22DEBUG = YES 22#DEBUG = YES
23 23
24[statistics] 24[statistics]
25PORT = 42467 25PORT = 42467
@@ -36,7 +36,7 @@ HOSTNAME = localhost
36[fs] 36[fs]
37PORT = 42471 37PORT = 42471
38HOSTNAME = localhost 38HOSTNAME = localhost
39DEBUG = YES 39#DEBUG = YES
40 40
41[testing] 41[testing]
42WEAKRANDOM = YES 42WEAKRANDOM = YES