aboutsummaryrefslogtreecommitdiff
path: root/src/fs
diff options
context:
space:
mode:
Diffstat (limited to 'src/fs')
-rw-r--r--src/fs/fs_dirmetascan.c3
-rw-r--r--src/fs/fs_misc.c8
-rw-r--r--src/fs/fs_publish_ublock.c1
-rw-r--r--src/fs/gnunet-search.c2
-rw-r--r--src/fs/plugin_block_fs.c17
-rwxr-xr-xsrc/fs/test_gnunet_fs_psd.py.in6
6 files changed, 26 insertions, 11 deletions
diff --git a/src/fs/fs_dirmetascan.c b/src/fs/fs_dirmetascan.c
index 7b9f178fd..8a3e37b49 100644
--- a/src/fs/fs_dirmetascan.c
+++ b/src/fs/fs_dirmetascan.c
@@ -246,6 +246,9 @@ finish_scan (void *cls)
246 * 246 *
247 * @param cls the closure (directory scanner object) 247 * @param cls the closure (directory scanner object)
248 * @param msg message from the helper process 248 * @param msg message from the helper process
249 * @return #GNUNET_OK on success,
250 * #GNUNET_NO to stop further processing (no error)
251 * #GNUNET_SYSERR to stop further processing with error
249 */ 252 */
250static int 253static int
251process_helper_msgs (void *cls, 254process_helper_msgs (void *cls,
diff --git a/src/fs/fs_misc.c b/src/fs/fs_misc.c
index bcb8620cf..b26de431c 100644
--- a/src/fs/fs_misc.c
+++ b/src/fs/fs_misc.c
@@ -1,6 +1,6 @@
1/* 1/*
2 This file is part of GNUnet. 2 This file is part of GNUnet.
3 Copyright (C) 2010, 2011 GNUnet e.V. 3 Copyright (C) 2010, 2011, 2017 GNUnet e.V.
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
@@ -43,6 +43,8 @@ GNUNET_FS_meta_data_suggest_filename (const struct GNUNET_CONTAINER_MetaData
43 {"application/gnunet-directory", ".gnd"}, 43 {"application/gnunet-directory", ".gnd"},
44 {"application/java", ".class"}, 44 {"application/java", ".class"},
45 {"application/msword", ".doc"}, 45 {"application/msword", ".doc"},
46 {"application/nar", ".nar"},
47 {"application/narinfo", ".narinfo"},
46 {"application/ogg", ".ogg"}, 48 {"application/ogg", ".ogg"},
47 {"application/pdf", ".pdf"}, 49 {"application/pdf", ".pdf"},
48 {"application/pgp-keys", ".key"}, 50 {"application/pgp-keys", ".key"},
@@ -53,8 +55,8 @@ GNUNET_FS_meta_data_suggest_filename (const struct GNUNET_CONTAINER_MetaData
53 {"application/xml", ".xml"}, 55 {"application/xml", ".xml"},
54 {"application/x-debian-package", ".deb"}, 56 {"application/x-debian-package", ".deb"},
55 {"application/x-dvi", ".dvi"}, 57 {"application/x-dvi", ".dvi"},
56 {"applixation/x-flac", ".flac"}, 58 {"application/x-flac", ".flac"},
57 {"applixation/x-gzip", ".gz"}, 59 {"application/x-gzip", ".gz"},
58 {"application/x-java-archive", ".jar"}, 60 {"application/x-java-archive", ".jar"},
59 {"application/x-java-vm", ".class"}, 61 {"application/x-java-vm", ".class"},
60 {"application/x-python-code", ".pyc"}, 62 {"application/x-python-code", ".pyc"},
diff --git a/src/fs/fs_publish_ublock.c b/src/fs/fs_publish_ublock.c
index e21443ccb..189a6909a 100644
--- a/src/fs/fs_publish_ublock.c
+++ b/src/fs/fs_publish_ublock.c
@@ -301,6 +301,7 @@ GNUNET_FS_publish_ublock_ (struct GNUNET_FS_Handle *h,
301 uc->task = GNUNET_SCHEDULER_add_now (&run_cont, 301 uc->task = GNUNET_SCHEDULER_add_now (&run_cont,
302 uc); 302 uc);
303 } 303 }
304 GNUNET_free (ub_enc);
304 return uc; 305 return uc;
305} 306}
306 307
diff --git a/src/fs/gnunet-search.c b/src/fs/gnunet-search.c
index ef1743436..89811669f 100644
--- a/src/fs/gnunet-search.c
+++ b/src/fs/gnunet-search.c
@@ -164,7 +164,7 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *info)
164 info->value.search.specifics.result.meta, 164 info->value.search.specifics.result.meta,
165 NULL); 165 NULL);
166 uri = GNUNET_FS_uri_to_string (info->value.search.specifics.result.uri); 166 uri = GNUNET_FS_uri_to_string (info->value.search.specifics.result.uri);
167 printf ("#%u:\n", cnt++); 167 printf ("#%u:\n", ++cnt);
168 filename = 168 filename =
169 GNUNET_CONTAINER_meta_data_get_by_type (info->value.search. 169 GNUNET_CONTAINER_meta_data_get_by_type (info->value.search.
170 specifics.result.meta, 170 specifics.result.meta,
diff --git a/src/fs/plugin_block_fs.c b/src/fs/plugin_block_fs.c
index 902519f15..c762835ce 100644
--- a/src/fs/plugin_block_fs.c
+++ b/src/fs/plugin_block_fs.c
@@ -71,17 +71,22 @@ block_plugin_fs_create_group (void *cls,
71 return NULL; 71 return NULL;
72 case GNUNET_BLOCK_TYPE_FS_UBLOCK: 72 case GNUNET_BLOCK_TYPE_FS_UBLOCK:
73 guard = va_arg (va, const char *); 73 guard = va_arg (va, const char *);
74 if (0 != strcmp (guard, 74 if (0 == strcmp (guard,
75 "seen-set-size")) 75 "seen-set-size"))
76 { 76 {
77 /* va-args invalid! bad bug, complain! */ 77 size = GNUNET_BLOCK_GROUP_compute_bloomfilter_size (va_arg (va, unsigned int),
78 GNUNET_break (0); 78 BLOOMFILTER_K);
79 size = 8; 79 }
80 else if (0 == strcmp (guard,
81 "filter-size"))
82 {
83 size = va_arg (va, unsigned int);
80 } 84 }
81 else 85 else
82 { 86 {
83 size = GNUNET_BLOCK_GROUP_compute_bloomfilter_size (va_arg (va, unsigned int), 87 /* va-args invalid! bad bug, complain! */
84 BLOOMFILTER_K); 88 GNUNET_break (0);
89 size = 8;
85 } 90 }
86 if (0 == size) 91 if (0 == size)
87 size = raw_data_size; /* not for us to determine, use what we got! */ 92 size = raw_data_size; /* not for us to determine, use what we got! */
diff --git a/src/fs/test_gnunet_fs_psd.py.in b/src/fs/test_gnunet_fs_psd.py.in
index 2efac58ae..87fcf1130 100755
--- a/src/fs/test_gnunet_fs_psd.py.in
+++ b/src/fs/test_gnunet_fs_psd.py.in
@@ -24,6 +24,11 @@ import subprocess
24import re 24import re
25import shutil 25import shutil
26 26
27# Force encoding to utf-8, as this test otherwise fails
28# on some systems (see #5094).
29reload(sys)
30sys.setdefaultencoding('utf8')
31
27srcdir = "../.." 32srcdir = "../.."
28gnunet_pyexpect_dir = os.path.join (srcdir, "contrib") 33gnunet_pyexpect_dir = os.path.join (srcdir, "contrib")
29if gnunet_pyexpect_dir not in sys.path: 34if gnunet_pyexpect_dir not in sys.path:
@@ -62,7 +67,6 @@ try:
62 s = pexpect () 67 s = pexpect ()
63 s.spawn (None, [search, '-V', '-t', '1000 ms', '-N', '1', '-c', 'test_gnunet_fs_psd_data.conf', 'tst'], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) 68 s.spawn (None, [search, '-V', '-t', '1000 ms', '-N', '1', '-c', 'test_gnunet_fs_psd_data.conf', 'tst'], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
64 s.expect ("stdout", re.compile (r'gnunet-download -o "test_gnunet_fs_rec_data.tgz" gnunet://fs/chk/2ZMHKPV74CB6GB1GFKQRR95BXJQA2SER25FN48GAW7WSBPA0GDEM5Y74V1ZJHM0NA6919TVW376BHTFDRE3RYS0KRY92M1QJVKPHFCR\.49BT3V5C10KA1695JF71FCT8ZZG4JMJSH04BD9CT22R6KEM915A7CEST17RD0QYTHXV5M4HHEGJMEZSFRDB7JAYC0EMJAN2V781E9DG\.17822\r?\n')) 69 s.expect ("stdout", re.compile (r'gnunet-download -o "test_gnunet_fs_rec_data.tgz" gnunet://fs/chk/2ZMHKPV74CB6GB1GFKQRR95BXJQA2SER25FN48GAW7WSBPA0GDEM5Y74V1ZJHM0NA6919TVW376BHTFDRE3RYS0KRY92M1QJVKPHFCR\.49BT3V5C10KA1695JF71FCT8ZZG4JMJSH04BD9CT22R6KEM915A7CEST17RD0QYTHXV5M4HHEGJMEZSFRDB7JAYC0EMJAN2V781E9DG\.17822\r?\n'))
65 s.expect ("stdout", re.compile (r"\s*description: Test archive\r?\n"))
66 70
67 down = pexpect () 71 down = pexpect ()
68 down.spawn (None, [download, '-c', 'test_gnunet_fs_psd_data.conf', '-o', 'test_gnunet_fs_rec_data.tar.gz', 'gnunet://fs/chk/2ZMHKPV74CB6GB1GFKQRR95BXJQA2SER25FN48GAW7WSBPA0GDEM5Y74V1ZJHM0NA6919TVW376BHTFDRE3RYS0KRY92M1QJVKPHFCR.49BT3V5C10KA1695JF71FCT8ZZG4JMJSH04BD9CT22R6KEM915A7CEST17RD0QYTHXV5M4HHEGJMEZSFRDB7JAYC0EMJAN2V781E9DG.17822'], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) 72 down.spawn (None, [download, '-c', 'test_gnunet_fs_psd_data.conf', '-o', 'test_gnunet_fs_rec_data.tar.gz', 'gnunet://fs/chk/2ZMHKPV74CB6GB1GFKQRR95BXJQA2SER25FN48GAW7WSBPA0GDEM5Y74V1ZJHM0NA6919TVW376BHTFDRE3RYS0KRY92M1QJVKPHFCR.49BT3V5C10KA1695JF71FCT8ZZG4JMJSH04BD9CT22R6KEM915A7CEST17RD0QYTHXV5M4HHEGJMEZSFRDB7JAYC0EMJAN2V781E9DG.17822'], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)