GNUNET_free (fn);
return GNUNET_SYSERR;
}
- if ( (GNUNET_OK != GNUNET_BIO_read_int32__(fileR, "Read int32 error!", ranking)) ||
+ emsg = NULL;
+ *ns_name = NULL;
+ if ( (GNUNET_OK != GNUNET_BIO_read_int32 (fileR, ranking)) ||
(GNUNET_OK != GNUNET_BIO_read_string(fileR, "Read string error!", ns_name, 200)) ||
(GNUNET_OK != GNUNET_BIO_read_meta_data(fileR, "Read meta data error!", meta)) )
{
- GNUNET_BIO_read_close(fileR, &emsg);
+ (void) GNUNET_BIO_read_close(fileR, &emsg);
+ GNUNET_free_non_null (emsg);
+ GNUNET_free_non_null (*ns_name);
+ *ns_name = NULL;
GNUNET_break (GNUNET_OK == GNUNET_DISK_directory_remove (fn));
GNUNET_free (fn);
return GNUNET_SYSERR;
}
- emsg = NULL;
if (GNUNET_OK != GNUNET_BIO_read_close(fileR, &emsg))
{
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
fn,
emsg);
GNUNET_break (GNUNET_OK == GNUNET_DISK_directory_remove (fn));
+ GNUNET_CONTAINER_meta_data_destroy (*meta);
+ *meta = NULL;
+ GNUNET_free_non_null (*ns_name);
+ *ns_name = NULL;
GNUNET_free_non_null (emsg);
GNUNET_free (fn);
return GNUNET_SYSERR;
return ret;
}
+
/**
* Change the ranking of a pseudonym.
*
return ranking;
}
-/**
- * Insert metadata into existing MD record (passed as cls).
- *
- * @param cls metadata to add to
- * @param plugin_name name of the plugin that generated the meta data
- * @param type type of entry to insert
- * @param format format of data
- * @param data_mime_type mime type of data
- * @param data value of the meta data
- * @param data_len number of bytes in data
- * @return always 0
- */
-static int
-merge_meta_helper (void *cls,
- const char *plugin_name,
- enum EXTRACTOR_MetaType type,
- enum EXTRACTOR_MetaFormat format,
- const char *data_mime_type,
- const char *data,
- size_t data_len)
-{
- struct GNUNET_CONTAINER_MetaData *meta = cls;
-
- (void) GNUNET_CONTAINER_meta_data_insert (meta, plugin_name,
- type, format,
- data_mime_type,
- data, data_len);
- return 0;
-}
-
-
/**
* Add a pseudonym to the set of known pseudonyms.
if ((0 == STAT (fn, &sbuf)) &&
(GNUNET_OK == read_info (cfg, id, &old, &ranking, &name)))
{
- GNUNET_CONTAINER_meta_data_iterate (meta, &merge_meta_helper, old);
+ GNUNET_CONTAINER_meta_data_merge (old, meta);
write_pseudonym_info (cfg, id, old, ranking, name);
GNUNET_CONTAINER_meta_data_destroy (old);
GNUNET_free_non_null (name);
}
-
-
-
/* end of pseudonym.c */