diff options
author | Christian Grothoff <christian@grothoff.org> | 2012-01-29 21:41:24 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2012-01-29 21:41:24 +0000 |
commit | 6756773dbc5aee6135ba8067cbf67aaf48cbfaf6 (patch) | |
tree | 9dd6bfb42ed814653a2e622923332db54b007a7d /src/fs/fs_sharetree.c | |
parent | 68401426269d202ae48d4942842f365198886c57 (diff) | |
download | gnunet-6756773dbc5aee6135ba8067cbf67aaf48cbfaf6.tar.gz gnunet-6756773dbc5aee6135ba8067cbf67aaf48cbfaf6.zip |
-fs publish should basically work now
Diffstat (limited to 'src/fs/fs_sharetree.c')
-rw-r--r-- | src/fs/fs_sharetree.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/fs/fs_sharetree.c b/src/fs/fs_sharetree.c index 8660c8958..a876dac99 100644 --- a/src/fs/fs_sharetree.c +++ b/src/fs/fs_sharetree.c | |||
@@ -305,12 +305,16 @@ migrate_and_drop_metadata (void *cls, const GNUNET_HashCode * key, void *value) | |||
305 | struct MetaCounter *counter = value; | 305 | struct MetaCounter *counter = value; |
306 | 306 | ||
307 | if (counter->count >= tc->move_threshold) | 307 | if (counter->count >= tc->move_threshold) |
308 | { | ||
309 | if (NULL == tc->pos->meta) | ||
310 | tc->pos->meta = GNUNET_CONTAINER_meta_data_create (); | ||
308 | GNUNET_CONTAINER_meta_data_insert (tc->pos->meta, | 311 | GNUNET_CONTAINER_meta_data_insert (tc->pos->meta, |
309 | counter->plugin_name, | 312 | counter->plugin_name, |
310 | counter->type, | 313 | counter->type, |
311 | counter->format, | 314 | counter->format, |
312 | counter->data_mime_type, counter->data, | 315 | counter->data_mime_type, counter->data, |
313 | counter->data_size); | 316 | counter->data_size); |
317 | } | ||
314 | GNUNET_assert (GNUNET_YES == | 318 | GNUNET_assert (GNUNET_YES == |
315 | GNUNET_CONTAINER_multihashmap_remove (tc->metacounter, | 319 | GNUNET_CONTAINER_multihashmap_remove (tc->metacounter, |
316 | key, | 320 | key, |
@@ -350,6 +354,8 @@ share_tree_trim (struct TrimContext *tc, | |||
350 | (0 != strncasecmp (user, tree->short_filename, strlen(user)))) | 354 | (0 != strncasecmp (user, tree->short_filename, strlen(user)))) |
351 | { | 355 | { |
352 | /* only use filename if it doesn't match $USER */ | 356 | /* only use filename if it doesn't match $USER */ |
357 | if (NULL == tree->meta) | ||
358 | tree->meta = GNUNET_CONTAINER_meta_data_create (); | ||
353 | GNUNET_CONTAINER_meta_data_insert (tree->meta, "<libgnunetfs>", | 359 | GNUNET_CONTAINER_meta_data_insert (tree->meta, "<libgnunetfs>", |
354 | EXTRACTOR_METATYPE_GNUNET_ORIGINAL_FILENAME, | 360 | EXTRACTOR_METATYPE_GNUNET_ORIGINAL_FILENAME, |
355 | EXTRACTOR_METAFORMAT_UTF8, | 361 | EXTRACTOR_METAFORMAT_UTF8, |
@@ -364,7 +370,8 @@ share_tree_trim (struct TrimContext *tc, | |||
364 | /* now, count keywords and meta data in children */ | 370 | /* now, count keywords and meta data in children */ |
365 | for (pos = tree->children_head; NULL != pos; pos = pos->next) | 371 | for (pos = tree->children_head; NULL != pos; pos = pos->next) |
366 | { | 372 | { |
367 | GNUNET_CONTAINER_meta_data_iterate (pos->meta, &add_to_meta_counter, tc->metacounter); | 373 | if (NULL != pos->meta) |
374 | GNUNET_CONTAINER_meta_data_iterate (pos->meta, &add_to_meta_counter, tc->metacounter); | ||
368 | if (NULL != pos->ksk_uri) | 375 | if (NULL != pos->ksk_uri) |
369 | GNUNET_FS_uri_ksk_get_keywords (pos->ksk_uri, &add_to_keyword_counter, tc->keywordcounter); | 376 | GNUNET_FS_uri_ksk_get_keywords (pos->ksk_uri, &add_to_keyword_counter, tc->keywordcounter); |
370 | } | 377 | } |