diff options
author | Christian Grothoff <christian@grothoff.org> | 2010-04-28 08:07:19 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2010-04-28 08:07:19 +0000 |
commit | b393f0f2c8f2075c16310a8edbe552020fd8b147 (patch) | |
tree | d6b91d0939ab540d2f66291cf0659ed40bda9626 /src/util/pseudonym.c | |
parent | 1c90bd35e34a9a237ebde4440367322a8cc2a686 (diff) | |
download | gnunet-b393f0f2c8f2075c16310a8edbe552020fd8b147.tar.gz gnunet-b393f0f2c8f2075c16310a8edbe552020fd8b147.zip |
merge meta data for search results
Diffstat (limited to 'src/util/pseudonym.c')
-rw-r--r-- | src/util/pseudonym.c | 34 |
1 files changed, 1 insertions, 33 deletions
diff --git a/src/util/pseudonym.c b/src/util/pseudonym.c index fcef2e9f8..643d5717e 100644 --- a/src/util/pseudonym.c +++ b/src/util/pseudonym.c | |||
@@ -539,38 +539,6 @@ GNUNET_PSEUDONYM_rank (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
539 | 539 | ||
540 | 540 | ||
541 | /** | 541 | /** |
542 | * Insert metadata into existing MD record (passed as cls). | ||
543 | * | ||
544 | * @param cls metadata to add to | ||
545 | * @param plugin_name name of the plugin that generated the meta data | ||
546 | * @param type type of entry to insert | ||
547 | * @param format format of data | ||
548 | * @param data_mime_type mime type of data | ||
549 | * @param data value of the meta data | ||
550 | * @param data_len number of bytes in data | ||
551 | * @return always 0 | ||
552 | */ | ||
553 | static int | ||
554 | merge_meta_helper (void *cls, | ||
555 | const char *plugin_name, | ||
556 | enum EXTRACTOR_MetaType type, | ||
557 | enum EXTRACTOR_MetaFormat format, | ||
558 | const char *data_mime_type, | ||
559 | const char *data, | ||
560 | size_t data_len) | ||
561 | { | ||
562 | struct GNUNET_CONTAINER_MetaData *meta = cls; | ||
563 | |||
564 | (void) GNUNET_CONTAINER_meta_data_insert (meta, plugin_name, | ||
565 | type, format, | ||
566 | data_mime_type, | ||
567 | data, data_len); | ||
568 | return 0; | ||
569 | } | ||
570 | |||
571 | |||
572 | |||
573 | /** | ||
574 | * Add a pseudonym to the set of known pseudonyms. | 542 | * Add a pseudonym to the set of known pseudonyms. |
575 | * For all pseudonym advertisements that we discover | 543 | * For all pseudonym advertisements that we discover |
576 | * FS should automatically call this function. | 544 | * FS should automatically call this function. |
@@ -597,7 +565,7 @@ GNUNET_PSEUDONYM_add (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
597 | if ((0 == STAT (fn, &sbuf)) && | 565 | if ((0 == STAT (fn, &sbuf)) && |
598 | (GNUNET_OK == read_info (cfg, id, &old, &ranking, &name))) | 566 | (GNUNET_OK == read_info (cfg, id, &old, &ranking, &name))) |
599 | { | 567 | { |
600 | GNUNET_CONTAINER_meta_data_iterate (meta, &merge_meta_helper, old); | 568 | GNUNET_CONTAINER_meta_data_merge (old, meta); |
601 | write_pseudonym_info (cfg, id, old, ranking, name); | 569 | write_pseudonym_info (cfg, id, old, ranking, name); |
602 | GNUNET_CONTAINER_meta_data_destroy (old); | 570 | GNUNET_CONTAINER_meta_data_destroy (old); |
603 | GNUNET_free_non_null (name); | 571 | GNUNET_free_non_null (name); |