aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2010-04-22 13:14:29 +0000
committerChristian Grothoff <christian@grothoff.org>2010-04-22 13:14:29 +0000
commiteb5c56279680c2337bb4a752a7d1f269c7d13888 (patch)
treeefe819172ac79e57599ebb249b905030454f9c4f /src
parentdb3d5a7a998d816be1810967a74454b45f830f1c (diff)
downloadgnunet-eb5c56279680c2337bb4a752a7d1f269c7d13888.tar.gz
gnunet-eb5c56279680c2337bb4a752a7d1f269c7d13888.zip
resume and less debug crap
Diffstat (limited to 'src')
-rw-r--r--src/fs/fs_download.c236
-rw-r--r--src/fs/fs_tree.c56
-rw-r--r--src/fs/fs_tree.h30
-rw-r--r--src/fs/gnunet-service-fs_indexing.c2
-rw-r--r--src/fs/test_fs_data.conf4
-rw-r--r--src/fs/test_fs_download.c1
-rw-r--r--src/fs/test_fs_download_data.conf2
-rw-r--r--src/fs/test_fs_list_indexed.c1
-rw-r--r--src/fs/test_fs_list_indexed_data.conf2
-rw-r--r--src/fs/test_fs_namespace.c3
-rw-r--r--src/fs/test_fs_namespace_data.conf2
-rw-r--r--src/fs/test_fs_publish.c1
-rw-r--r--src/fs/test_fs_publish_data.conf2
-rw-r--r--src/fs/test_fs_search.c1
-rw-r--r--src/fs/test_fs_search_data.conf2
-rw-r--r--src/fs/test_fs_start_stop.c3
-rw-r--r--src/fs/test_fs_unindex.c1
-rw-r--r--src/fs/test_fs_unindex_data.conf2
-rw-r--r--src/fs/test_gnunet_fs_idx_data.conf2
-rw-r--r--src/fs/test_gnunet_fs_ns_data.conf2
-rw-r--r--src/fs/test_gnunet_fs_psd_data.conf2
-rw-r--r--src/fs/test_gnunet_fs_rec_data.conf2
22 files changed, 228 insertions, 131 deletions
diff --git a/src/fs/fs_download.c b/src/fs/fs_download.c
index 6e215ed27..eb45f795d 100644
--- a/src/fs/fs_download.c
+++ b/src/fs/fs_download.c
@@ -175,6 +175,61 @@ transmit_download_request (void *cls,
175 175
176 176
177/** 177/**
178 * Closure for iterator processing results.
179 */
180struct ProcessResultClosure
181{
182
183 /**
184 * Hash of data.
185 */
186 GNUNET_HashCode query;
187
188 /**
189 * Data found in P2P network.
190 */
191 const void *data;
192
193 /**
194 * Our download context.
195 */
196 struct GNUNET_FS_DownloadContext *dc;
197
198 /**
199 * Number of bytes in data.
200 */
201 size_t size;
202
203 /**
204 * Type of data.
205 */
206 uint32_t type;
207
208 /**
209 * Flag to indicate if this block should be stored on disk.
210 */
211 int do_store;
212
213};
214
215
216/**
217 * Iterator over entries in the pending requests in the 'active' map for the
218 * reply that we just got.
219 *
220 * @param cls closure (our 'struct ProcessResultClosure')
221 * @param key query for the given value / request
222 * @param value value in the hash map (a 'struct DownloadRequest')
223 * @return GNUNET_YES (we should continue to iterate); unless serious error
224 */
225static int
226process_result_with_request (void *cls,
227 const GNUNET_HashCode * key,
228 void *value);
229
230
231
232/**
178 * Schedule the download of the specified block in the tree. 233 * Schedule the download of the specified block in the tree.
179 * 234 *
180 * @param dc overall download this block belongs to 235 * @param dc overall download this block belongs to
@@ -192,7 +247,12 @@ schedule_block_download (struct GNUNET_FS_DownloadContext *dc,
192 unsigned int depth) 247 unsigned int depth)
193{ 248{
194 struct DownloadRequest *sm; 249 struct DownloadRequest *sm;
250 uint64_t total;
195 uint64_t off; 251 uint64_t off;
252 size_t len;
253 char block[DBLOCK_SIZE];
254 GNUNET_HashCode key;
255 struct ProcessResultClosure prc;
196 256
197#if DEBUG_DOWNLOAD 257#if DEBUG_DOWNLOAD
198 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 258 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -201,20 +261,77 @@ schedule_block_download (struct GNUNET_FS_DownloadContext *dc,
201 depth, 261 depth,
202 GNUNET_h2s (&chk->query)); 262 GNUNET_h2s (&chk->query));
203#endif 263#endif
204 off = compute_disk_offset (GNUNET_ntohll (dc->uri->data.chk.file_length), 264 total = GNUNET_ntohll (dc->uri->data.chk.file_length);
265 off = compute_disk_offset (total,
205 offset, 266 offset,
206 depth, 267 depth,
207 dc->treedepth); 268 dc->treedepth);
269 len = GNUNET_FS_tree_calculate_block_size (total,
270 dc->treedepth,
271 offset,
272 depth);
273 sm = GNUNET_malloc (sizeof (struct DownloadRequest));
274 sm->chk = *chk;
275 sm->offset = offset;
276 sm->depth = depth;
277 sm->is_pending = GNUNET_YES;
278 sm->next = dc->pending;
279 dc->pending = sm;
280 GNUNET_CONTAINER_multihashmap_put (dc->active,
281 &chk->query,
282 sm,
283 GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE);
284
208 if ( (dc->old_file_size > off) && 285 if ( (dc->old_file_size > off) &&
209 (dc->handle != NULL) && 286 (dc->handle != NULL) &&
210 (off == 287 (off ==
211 GNUNET_DISK_file_seek (dc->handle, 288 GNUNET_DISK_file_seek (dc->handle,
212 off, 289 off,
213 GNUNET_DISK_SEEK_SET) ) ) 290 GNUNET_DISK_SEEK_SET) ) &&
291 (len ==
292 GNUNET_DISK_file_read (dc->handle,
293 block,
294 len)) )
214 { 295 {
215 // FIXME: check if block exists on disk! 296 /* FIXME: also check query matches!? */
216 // (read block, encode, compare with 297 if (0 == memcmp (&key,
217 // query; if matches, simply return) 298 &chk->key,
299 sizeof (GNUNET_HashCode)))
300 {
301 char enc[len];
302 struct GNUNET_CRYPTO_AesSessionKey sk;
303 struct GNUNET_CRYPTO_AesInitializationVector iv;
304 GNUNET_HashCode query;
305
306 GNUNET_CRYPTO_hash_to_aes_key (&key, &sk, &iv);
307 GNUNET_CRYPTO_aes_encrypt (block, len,
308 &sk,
309 &iv,
310 enc);
311 GNUNET_CRYPTO_hash (enc, len, &query);
312 if (0 == memcmp (&query,
313 &chk->query,
314 sizeof (GNUNET_HashCode)))
315 {
316 /* already got it! */
317 prc.dc = dc;
318 prc.data = enc;
319 prc.size = len;
320 prc.type = (dc->treedepth == depth)
321 ? GNUNET_DATASTORE_BLOCKTYPE_DBLOCK
322 : GNUNET_DATASTORE_BLOCKTYPE_IBLOCK;
323 prc.query = chk->query;
324 prc.do_store = GNUNET_NO; /* useless */
325 process_result_with_request (&prc,
326 &key,
327 sm);
328 }
329 else
330 {
331 GNUNET_break_op (0);
332 }
333 return;
334 }
218 } 335 }
219 if (depth < dc->treedepth) 336 if (depth < dc->treedepth)
220 { 337 {
@@ -224,17 +341,6 @@ schedule_block_download (struct GNUNET_FS_DownloadContext *dc,
224 // (read block(s), encode, compare with 341 // (read block(s), encode, compare with
225 // query; if matches, simply return) 342 // query; if matches, simply return)
226 } 343 }
227 sm = GNUNET_malloc (sizeof (struct DownloadRequest));
228 sm->chk = *chk;
229 sm->offset = offset;
230 sm->depth = depth;
231 sm->is_pending = GNUNET_YES;
232 sm->next = dc->pending;
233 dc->pending = sm;
234 GNUNET_CONTAINER_multihashmap_put (dc->active,
235 &chk->query,
236 sm,
237 GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE);
238 344
239 if ( (dc->th == NULL) && 345 if ( (dc->th == NULL) &&
240 (dc->client != NULL) ) 346 (dc->client != NULL) )
@@ -395,85 +501,6 @@ try_reconnect (struct GNUNET_FS_DownloadContext *dc);
395 501
396 502
397/** 503/**
398 * Compute how many bytes of data should be stored in
399 * the specified node.
400 *
401 * @param fsize overall file size
402 * @param totaldepth depth of the entire tree
403 * @param offset offset of the node
404 * @param depth depth of the node
405 * @return number of bytes stored in this node
406 */
407static size_t
408calculate_block_size (uint64_t fsize,
409 unsigned int totaldepth,
410 uint64_t offset,
411 unsigned int depth)
412{
413 unsigned int i;
414 size_t ret;
415 uint64_t rsize;
416 uint64_t epos;
417 unsigned int chks;
418
419 GNUNET_assert (offset < fsize);
420 if (depth == totaldepth)
421 {
422 ret = DBLOCK_SIZE;
423 if (offset + ret > fsize)
424 ret = (size_t) (fsize - offset);
425 return ret;
426 }
427
428 rsize = DBLOCK_SIZE;
429 for (i = totaldepth-1; i > depth; i--)
430 rsize *= CHK_PER_INODE;
431 epos = offset + rsize * CHK_PER_INODE;
432 GNUNET_assert (epos > offset);
433 if (epos > fsize)
434 epos = fsize;
435 /* round up when computing #CHKs in our IBlock */
436 chks = (epos - offset + rsize - 1) / rsize;
437 GNUNET_assert (chks <= CHK_PER_INODE);
438 return chks * sizeof (struct ContentHashKey);
439}
440
441
442/**
443 * Closure for iterator processing results.
444 */
445struct ProcessResultClosure
446{
447
448 /**
449 * Hash of data.
450 */
451 GNUNET_HashCode query;
452
453 /**
454 * Data found in P2P network.
455 */
456 const void *data;
457
458 /**
459 * Our download context.
460 */
461 struct GNUNET_FS_DownloadContext *dc;
462
463 /**
464 * Number of bytes in data.
465 */
466 size_t size;
467
468 /**
469 * Type of data.
470 */
471 uint32_t type;
472
473};
474
475
476/**
477 * We found an entry in a directory. Check if the respective child 504 * We found an entry in a directory. Check if the respective child
478 * already exists and if not create the respective child download. 505 * already exists and if not create the respective child download.
479 * 506 *
@@ -764,23 +791,22 @@ process_result_with_request (void *cls,
764 char pt[prc->size]; 791 char pt[prc->size];
765 struct GNUNET_FS_ProgressInfo pi; 792 struct GNUNET_FS_ProgressInfo pi;
766 uint64_t off; 793 uint64_t off;
794 size_t bs;
767 size_t app; 795 size_t app;
768 int i; 796 int i;
769 struct ContentHashKey *chk; 797 struct ContentHashKey *chk;
770 char *emsg; 798 char *emsg;
771 799
772 if (prc->size != calculate_block_size (GNUNET_ntohll (dc->uri->data.chk.file_length), 800 bs = GNUNET_FS_tree_calculate_block_size (GNUNET_ntohll (dc->uri->data.chk.file_length),
773 dc->treedepth, 801 dc->treedepth,
774 sm->offset, 802 sm->offset,
775 sm->depth)) 803 sm->depth);
804 if (prc->size != bs)
776 { 805 {
777#if DEBUG_DOWNLOAD 806#if DEBUG_DOWNLOAD
778 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 807 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
779 "Internal error or bogus download URI (expected %u bytes, got %u)\n", 808 "Internal error or bogus download URI (expected %u bytes, got %u)\n",
780 calculate_block_size (GNUNET_ntohll (dc->uri->data.chk.file_length), 809 bs,
781 dc->treedepth,
782 sm->offset,
783 sm->depth),
784 prc->size); 810 prc->size);
785#endif 811#endif
786 dc->emsg = GNUNET_strdup ("Internal error or bogus download URI"); 812 dc->emsg = GNUNET_strdup ("Internal error or bogus download URI");
@@ -815,7 +841,8 @@ process_result_with_request (void *cls,
815 sm->depth, 841 sm->depth,
816 dc->treedepth); 842 dc->treedepth);
817 /* save to disk */ 843 /* save to disk */
818 if ( (NULL != dc->handle) && 844 if ( ( GNUNET_YES == prc->do_store) &&
845 (NULL != dc->handle) &&
819 ( (sm->depth == dc->treedepth) || 846 ( (sm->depth == dc->treedepth) ||
820 (0 == (dc->options & GNUNET_FS_DOWNLOAD_NO_TEMPORARIES)) ) ) 847 (0 == (dc->options & GNUNET_FS_DOWNLOAD_NO_TEMPORARIES)) ) )
821 { 848 {
@@ -1006,6 +1033,7 @@ process_result (struct GNUNET_FS_DownloadContext *dc,
1006 prc.data = data; 1033 prc.data = data;
1007 prc.size = size; 1034 prc.size = size;
1008 prc.type = type; 1035 prc.type = type;
1036 prc.do_store = GNUNET_YES;
1009 GNUNET_CRYPTO_hash (data, size, &prc.query); 1037 GNUNET_CRYPTO_hash (data, size, &prc.query);
1010#if DEBUG_DOWNLOAD 1038#if DEBUG_DOWNLOAD
1011 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1039 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
diff --git a/src/fs/fs_tree.c b/src/fs/fs_tree.c
index 1280548d8..ef7c560d6 100644
--- a/src/fs/fs_tree.c
+++ b/src/fs/fs_tree.c
@@ -198,9 +198,9 @@ GNUNET_FS_tree_encoder_create (struct GNUNET_FS_Handle *h,
198 * @param offset current offset in the overall file 198 * @param offset current offset in the overall file
199 * @return size of the corresponding IBlock 199 * @return size of the corresponding IBlock
200 */ 200 */
201static uint16_t 201uint16_t
202compute_iblock_size (unsigned int height, 202GNUNET_FS_tree_compute_iblock_size (unsigned int height,
203 uint64_t offset) 203 uint64_t offset)
204{ 204{
205 unsigned int ret; 205 unsigned int ret;
206 unsigned int i; 206 unsigned int i;
@@ -231,6 +231,52 @@ compute_iblock_size (unsigned int height,
231 231
232 232
233/** 233/**
234 * Compute how many bytes of data should be stored in
235 * the specified node.
236 *
237 * @param fsize overall file size
238 * @param totaldepth depth of the entire tree
239 * @param offset offset of the node
240 * @param depth depth of the node
241 * @return number of bytes stored in this node
242 */
243size_t
244GNUNET_FS_tree_calculate_block_size (uint64_t fsize,
245 unsigned int totaldepth,
246 uint64_t offset,
247 unsigned int depth)
248{
249 unsigned int i;
250 size_t ret;
251 uint64_t rsize;
252 uint64_t epos;
253 unsigned int chks;
254
255 GNUNET_assert (offset < fsize);
256 if (depth == totaldepth)
257 {
258 ret = DBLOCK_SIZE;
259 if (offset + ret > fsize)
260 ret = (size_t) (fsize - offset);
261 return ret;
262 }
263 /* FIXME: this code should be *equivalent* to the
264 GNUNET_FS_tree_compute_iblock_size function above! Remove duplication! */
265 rsize = DBLOCK_SIZE;
266 for (i = totaldepth-1; i > depth; i--)
267 rsize *= CHK_PER_INODE;
268 epos = offset + rsize * CHK_PER_INODE;
269 GNUNET_assert (epos > offset);
270 if (epos > fsize)
271 epos = fsize;
272 /* round up when computing #CHKs in our IBlock */
273 chks = (epos - offset + rsize - 1) / rsize;
274 GNUNET_assert (chks <= CHK_PER_INODE);
275 return chks * sizeof (struct ContentHashKey);
276}
277
278
279/**
234 * Compute the offset of the CHK for the 280 * Compute the offset of the CHK for the
235 * current block in the IBlock above. 281 * current block in the IBlock above.
236 * 282 *
@@ -297,8 +343,8 @@ void GNUNET_FS_tree_encoder_next (struct GNUNET_FS_TreeEncoder * te)
297 } 343 }
298 else 344 else
299 { 345 {
300 pt_size = compute_iblock_size (te->chk_tree_depth - te->current_depth, 346 pt_size = GNUNET_FS_tree_compute_iblock_size (te->chk_tree_depth - te->current_depth,
301 te->publish_offset); 347 te->publish_offset);
302 pt_block = &te->chk_tree[te->current_depth * 348 pt_block = &te->chk_tree[te->current_depth *
303 CHK_PER_INODE]; 349 CHK_PER_INODE];
304 } 350 }
diff --git a/src/fs/fs_tree.h b/src/fs/fs_tree.h
index bfbd7019b..82b897bd3 100644
--- a/src/fs/fs_tree.h
+++ b/src/fs/fs_tree.h
@@ -144,6 +144,36 @@ void GNUNET_FS_tree_encoder_finish (struct GNUNET_FS_TreeEncoder * te,
144 char **emsg); 144 char **emsg);
145 145
146 146
147/**
148 * Compute the size of the current IBlock.
149 *
150 * @param height height of the IBlock in the tree (aka overall
151 * number of tree levels minus depth); 0 == DBlock
152 * @param offset current offset in the overall file
153 * @return size of the corresponding IBlock
154 */
155uint16_t
156GNUNET_FS_tree_compute_iblock_size (unsigned int height,
157 uint64_t offset);
158
159
160/**
161 * Compute how many bytes of data should be stored in
162 * the specified node.
163 *
164 * @param fsize overall file size
165 * @param totaldepth depth of the entire tree
166 * @param offset offset of the node
167 * @param depth depth of the node
168 * @return number of bytes stored in this node
169 */
170size_t
171GNUNET_FS_tree_calculate_block_size (uint64_t fsize,
172 unsigned int totaldepth,
173 uint64_t offset,
174 unsigned int depth);
175
176
147#if 0 177#if 0
148/* the functions below will be needed for persistence 178/* the functions below will be needed for persistence
149 but are not yet implemented -- FIXME... */ 179 but are not yet implemented -- FIXME... */
diff --git a/src/fs/gnunet-service-fs_indexing.c b/src/fs/gnunet-service-fs_indexing.c
index 404199742..3095092b8 100644
--- a/src/fs/gnunet-service-fs_indexing.c
+++ b/src/fs/gnunet-service-fs_indexing.c
@@ -244,7 +244,7 @@ signal_index_ok (struct IndexInfo *ii)
244 (void*) ii->filename, 244 (void*) ii->filename,
245 GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY)) 245 GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY))
246 { 246 {
247 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 247 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
248 _("Index request received for file `%s' is already indexed as `%s'. Permitting anyway.\n"), 248 _("Index request received for file `%s' is already indexed as `%s'. Permitting anyway.\n"),
249 ii->filename, 249 ii->filename,
250 (const char*) GNUNET_CONTAINER_multihashmap_get (ifm, 250 (const char*) GNUNET_CONTAINER_multihashmap_get (ifm,
diff --git a/src/fs/test_fs_data.conf b/src/fs/test_fs_data.conf
index c5fd6ec0c..23c263702 100644
--- a/src/fs/test_fs_data.conf
+++ b/src/fs/test_fs_data.conf
@@ -12,12 +12,12 @@ HOSTNAME = localhost
12[transport] 12[transport]
13PORT = 42465 13PORT = 42465
14PLUGINS = 14PLUGINS =
15DEBUG = YES 15#DEBUG = YES
16 16
17[arm] 17[arm]
18PORT = 42466 18PORT = 42466
19HOSTNAME = localhost 19HOSTNAME = localhost
20DEFAULTSERVICES = resolver datastore transport core fs 20DEFAULTSERVICES = resolver datastore fs
21 21
22[datastore] 22[datastore]
23#DEBUG = YES 23#DEBUG = YES
diff --git a/src/fs/test_fs_download.c b/src/fs/test_fs_download.c
index af1fbfa50..f33a1bd4a 100644
--- a/src/fs/test_fs_download.c
+++ b/src/fs/test_fs_download.c
@@ -246,7 +246,6 @@ setup_peer (struct PeerContext *p, const char *cfgname)
246 "-c", cfgname, NULL); 246 "-c", cfgname, NULL);
247#endif 247#endif
248 GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (p->cfg, cfgname)); 248 GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (p->cfg, cfgname));
249 GNUNET_ARM_start_services (p->cfg, sched, "core", NULL);
250} 249}
251 250
252 251
diff --git a/src/fs/test_fs_download_data.conf b/src/fs/test_fs_download_data.conf
index 366a30844..cf84afb72 100644
--- a/src/fs/test_fs_download_data.conf
+++ b/src/fs/test_fs_download_data.conf
@@ -16,7 +16,7 @@ PLUGINS =
16[arm] 16[arm]
17PORT = 42466 17PORT = 42466
18HOSTNAME = localhost 18HOSTNAME = localhost
19DEFAULTSERVICES = resolver datastore transport core fs 19DEFAULTSERVICES = resolver datastore fs
20 20
21[datastore] 21[datastore]
22# DEBUG = YES 22# DEBUG = YES
diff --git a/src/fs/test_fs_list_indexed.c b/src/fs/test_fs_list_indexed.c
index ce704f500..58a3f3a82 100644
--- a/src/fs/test_fs_list_indexed.c
+++ b/src/fs/test_fs_list_indexed.c
@@ -207,7 +207,6 @@ setup_peer (struct PeerContext *p, const char *cfgname)
207 "-c", cfgname, NULL); 207 "-c", cfgname, NULL);
208#endif 208#endif
209 GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (p->cfg, cfgname)); 209 GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (p->cfg, cfgname));
210 GNUNET_ARM_start_services (p->cfg, sched, "core", NULL);
211} 210}
212 211
213 212
diff --git a/src/fs/test_fs_list_indexed_data.conf b/src/fs/test_fs_list_indexed_data.conf
index c2e76b5ae..6c3b024d3 100644
--- a/src/fs/test_fs_list_indexed_data.conf
+++ b/src/fs/test_fs_list_indexed_data.conf
@@ -16,7 +16,7 @@ PLUGINS =
16[arm] 16[arm]
17PORT = 42466 17PORT = 42466
18HOSTNAME = localhost 18HOSTNAME = localhost
19DEFAULTSERVICES = resolver datastore transport core fs 19DEFAULTSERVICES = resolver datastore fs
20 20
21[datastore] 21[datastore]
22#DEBUG = YES 22#DEBUG = YES
diff --git a/src/fs/test_fs_namespace.c b/src/fs/test_fs_namespace.c
index 8e13b211d..b57f19bc9 100644
--- a/src/fs/test_fs_namespace.c
+++ b/src/fs/test_fs_namespace.c
@@ -77,7 +77,6 @@ setup_peer (struct PeerContext *p, const char *cfgname)
77 "-c", cfgname, NULL); 77 "-c", cfgname, NULL);
78#endif 78#endif
79 GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (p->cfg, cfgname)); 79 GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (p->cfg, cfgname));
80 GNUNET_ARM_start_services (p->cfg, sched, "core", NULL);
81} 80}
82 81
83 82
@@ -106,7 +105,6 @@ abort_ksk_search_task (void *cls,
106 ksk_search = NULL; 105 ksk_search = NULL;
107 if (sks_search == NULL) 106 if (sks_search == NULL)
108 { 107 {
109 fprintf (stderr, "initiating shutdown\n");
110 GNUNET_FS_stop (fs); 108 GNUNET_FS_stop (fs);
111 } 109 }
112 } 110 }
@@ -128,7 +126,6 @@ abort_sks_search_task (void *cls,
128 GNUNET_assert (GNUNET_OK == GNUNET_FS_namespace_delete (ns, GNUNET_YES)); 126 GNUNET_assert (GNUNET_OK == GNUNET_FS_namespace_delete (ns, GNUNET_YES));
129 if (ksk_search == NULL) 127 if (ksk_search == NULL)
130 { 128 {
131 fprintf (stderr, "initiating shutdown\n");
132 GNUNET_FS_stop (fs); 129 GNUNET_FS_stop (fs);
133 } 130 }
134} 131}
diff --git a/src/fs/test_fs_namespace_data.conf b/src/fs/test_fs_namespace_data.conf
index 3b4ba5c70..349a9218a 100644
--- a/src/fs/test_fs_namespace_data.conf
+++ b/src/fs/test_fs_namespace_data.conf
@@ -16,7 +16,7 @@ PLUGINS =
16[arm] 16[arm]
17PORT = 42466 17PORT = 42466
18HOSTNAME = localhost 18HOSTNAME = localhost
19DEFAULTSERVICES = resolver datastore transport core fs 19DEFAULTSERVICES = resolver datastore fs
20 20
21[datastore] 21[datastore]
22# DEBUG = YES 22# DEBUG = YES
diff --git a/src/fs/test_fs_publish.c b/src/fs/test_fs_publish.c
index 6ea074807..2d664817c 100644
--- a/src/fs/test_fs_publish.c
+++ b/src/fs/test_fs_publish.c
@@ -196,7 +196,6 @@ setup_peer (struct PeerContext *p, const char *cfgname)
196 "-c", cfgname, NULL); 196 "-c", cfgname, NULL);
197#endif 197#endif
198 GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (p->cfg, cfgname)); 198 GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (p->cfg, cfgname));
199 GNUNET_ARM_start_services (p->cfg, sched, "core", NULL);
200} 199}
201 200
202 201
diff --git a/src/fs/test_fs_publish_data.conf b/src/fs/test_fs_publish_data.conf
index 147c8bc78..5bca3aeae 100644
--- a/src/fs/test_fs_publish_data.conf
+++ b/src/fs/test_fs_publish_data.conf
@@ -16,7 +16,7 @@ PLUGINS =
16[arm] 16[arm]
17PORT = 42466 17PORT = 42466
18HOSTNAME = localhost 18HOSTNAME = localhost
19DEFAULTSERVICES = resolver datastore transport core fs 19DEFAULTSERVICES = resolver datastore fs
20 20
21[datastore] 21[datastore]
22#DEBUG = YES 22#DEBUG = YES
diff --git a/src/fs/test_fs_search.c b/src/fs/test_fs_search.c
index 4320f965f..5f5f7f62a 100644
--- a/src/fs/test_fs_search.c
+++ b/src/fs/test_fs_search.c
@@ -198,7 +198,6 @@ setup_peer (struct PeerContext *p, const char *cfgname)
198 "-c", cfgname, NULL); 198 "-c", cfgname, NULL);
199#endif 199#endif
200 GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (p->cfg, cfgname)); 200 GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (p->cfg, cfgname));
201 GNUNET_ARM_start_services (p->cfg, sched, "core", NULL);
202} 201}
203 202
204 203
diff --git a/src/fs/test_fs_search_data.conf b/src/fs/test_fs_search_data.conf
index ce89cd8df..654754ffe 100644
--- a/src/fs/test_fs_search_data.conf
+++ b/src/fs/test_fs_search_data.conf
@@ -16,7 +16,7 @@ PLUGINS =
16[arm] 16[arm]
17PORT = 42466 17PORT = 42466
18HOSTNAME = localhost 18HOSTNAME = localhost
19DEFAULTSERVICES = resolver datastore transport core fs 19DEFAULTSERVICES = peerinfo resolver datastore fs
20 20
21[datastore] 21[datastore]
22# DEBUG = YES 22# DEBUG = YES
diff --git a/src/fs/test_fs_start_stop.c b/src/fs/test_fs_start_stop.c
index e11684b70..aa991d4a2 100644
--- a/src/fs/test_fs_start_stop.c
+++ b/src/fs/test_fs_start_stop.c
@@ -29,6 +29,8 @@
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_NO
33
32#define START_ARM GNUNET_YES 34#define START_ARM GNUNET_YES
33 35
34static struct GNUNET_SCHEDULER_Handle *sched; 36static struct GNUNET_SCHEDULER_Handle *sched;
@@ -65,7 +67,6 @@ setup_peer (struct PeerContext *p, const char *cfgname)
65 "-c", cfgname, NULL); 67 "-c", cfgname, NULL);
66#endif 68#endif
67 GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (p->cfg, cfgname)); 69 GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (p->cfg, cfgname));
68 GNUNET_ARM_start_services (p->cfg, sched, "core", NULL);
69} 70}
70 71
71 72
diff --git a/src/fs/test_fs_unindex.c b/src/fs/test_fs_unindex.c
index 2690fc0e1..3607144f3 100644
--- a/src/fs/test_fs_unindex.c
+++ b/src/fs/test_fs_unindex.c
@@ -204,7 +204,6 @@ setup_peer (struct PeerContext *p, const char *cfgname)
204 "-c", cfgname, NULL); 204 "-c", cfgname, NULL);
205#endif 205#endif
206 GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (p->cfg, cfgname)); 206 GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (p->cfg, cfgname));
207 GNUNET_ARM_start_services (p->cfg, sched, "core", NULL);
208} 207}
209 208
210 209
diff --git a/src/fs/test_fs_unindex_data.conf b/src/fs/test_fs_unindex_data.conf
index 7f16af126..a92ff5bb7 100644
--- a/src/fs/test_fs_unindex_data.conf
+++ b/src/fs/test_fs_unindex_data.conf
@@ -16,7 +16,7 @@ PLUGINS =
16[arm] 16[arm]
17PORT = 42466 17PORT = 42466
18HOSTNAME = localhost 18HOSTNAME = localhost
19DEFAULTSERVICES = resolver datastore transport core fs 19DEFAULTSERVICES = resolver datastore fs
20 20
21[datastore] 21[datastore]
22#DEBUG = YES 22#DEBUG = YES
diff --git a/src/fs/test_gnunet_fs_idx_data.conf b/src/fs/test_gnunet_fs_idx_data.conf
index 9cfeefc0d..2140e06b3 100644
--- a/src/fs/test_gnunet_fs_idx_data.conf
+++ b/src/fs/test_gnunet_fs_idx_data.conf
@@ -16,7 +16,7 @@ PLUGINS =
16[arm] 16[arm]
17PORT = 46466 17PORT = 46466
18HOSTNAME = localhost 18HOSTNAME = localhost
19DEFAULTSERVICES = resolver datastore transport core statistics fs 19DEFAULTSERVICES = resolver datastore statistics fs
20 20
21[datastore] 21[datastore]
22# DEBUG = YES 22# DEBUG = YES
diff --git a/src/fs/test_gnunet_fs_ns_data.conf b/src/fs/test_gnunet_fs_ns_data.conf
index 50b0d6406..7eef81b65 100644
--- a/src/fs/test_gnunet_fs_ns_data.conf
+++ b/src/fs/test_gnunet_fs_ns_data.conf
@@ -16,7 +16,7 @@ PLUGINS =
16[arm] 16[arm]
17PORT = 47466 17PORT = 47466
18HOSTNAME = localhost 18HOSTNAME = localhost
19DEFAULTSERVICES = resolver datastore transport core statistics fs 19DEFAULTSERVICES = resolver datastore statistics fs
20 20
21[datastore] 21[datastore]
22# DEBUG = YES 22# DEBUG = YES
diff --git a/src/fs/test_gnunet_fs_psd_data.conf b/src/fs/test_gnunet_fs_psd_data.conf
index 221137c14..52be58575 100644
--- a/src/fs/test_gnunet_fs_psd_data.conf
+++ b/src/fs/test_gnunet_fs_psd_data.conf
@@ -16,7 +16,7 @@ PLUGINS =
16[arm] 16[arm]
17PORT = 45466 17PORT = 45466
18HOSTNAME = localhost 18HOSTNAME = localhost
19DEFAULTSERVICES = resolver datastore transport core statistics fs 19DEFAULTSERVICES = resolver datastore statistics fs
20 20
21[datastore] 21[datastore]
22# DEBUG = YES 22# DEBUG = YES
diff --git a/src/fs/test_gnunet_fs_rec_data.conf b/src/fs/test_gnunet_fs_rec_data.conf
index 93c5cffbc..7b758fc15 100644
--- a/src/fs/test_gnunet_fs_rec_data.conf
+++ b/src/fs/test_gnunet_fs_rec_data.conf
@@ -16,7 +16,7 @@ PLUGINS =
16[arm] 16[arm]
17PORT = 44466 17PORT = 44466
18HOSTNAME = localhost 18HOSTNAME = localhost
19DEFAULTSERVICES = resolver datastore transport core statistics fs 19DEFAULTSERVICES = resolver datastore statistics fs
20 20
21[datastore] 21[datastore]
22# DEBUG = YES 22# DEBUG = YES