fix
[oweals/gnunet.git] / src / fs / gnunet-publish.c
index fc00fd26c623be7f51f2eb0bf7129cec5e1f6265..5869fcff5ffad8d815300b2898b9c45f38312bda 100644 (file)
@@ -215,40 +215,6 @@ meta_printer (void *cls,
 }
 
 
-/**
- * Merge metadata entries.
- *
- * @param cls closure, target metadata structure
- * @param plugin_name name of the plugin that generated the meta data
- * @param type type of the meta data
- * @param format format of data
- * @param data_mime_type mime type of data
- * @param data value of the meta data
- * @param data_size number of bytes in data
- * @return always 0
- */
-static int
-meta_merger (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_size)
-{
-  struct GNUNET_CONTAINER_MetaData *m = cls;
-
-  GNUNET_CONTAINER_meta_data_insert (m,
-                                    plugin_name,
-                                    type, 
-                                    format,
-                                    data_mime_type,
-                                    data,
-                                    data_size);
-  return 0;
-}
-
-
 /**
  * Function called on all entries before the publication.  This is
  * where we perform modifications to the default based on command-line
@@ -301,9 +267,11 @@ publish_inspector (void *cls,
       topKeywords = NULL;
     }
   if (NULL != meta) 
-    GNUNET_CONTAINER_meta_data_iterate (meta,
-                                       &meta_merger,
-                                       m);
+    {
+      GNUNET_CONTAINER_meta_data_merge (m, meta);
+      GNUNET_CONTAINER_meta_data_destroy (meta);
+      meta = NULL;
+    }
   if (! do_disable_creation_time)
     GNUNET_CONTAINER_meta_data_add_publication_date (m);
   if (extract_only)
@@ -564,7 +532,8 @@ run (void *cls,
     }
   else if (S_ISDIR (sbuf.st_mode))
     {
-      fi = GNUNET_FS_file_information_create_from_directory (NULL,
+      fi = GNUNET_FS_file_information_create_from_directory (ctx,
+                                                            NULL,
                                                             args[0],
                                                             &GNUNET_FS_directory_scanner_default,
                                                             l,
@@ -576,7 +545,8 @@ run (void *cls,
     }
   else
     {
-      fi = GNUNET_FS_file_information_create_from_file (NULL,
+      fi = GNUNET_FS_file_information_create_from_file (ctx,
+                                                       NULL,
                                                        args[0],
                                                        NULL,
                                                        NULL,