aboutsummaryrefslogtreecommitdiff
path: root/src/fs/gnunet-helper-fs-publish.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/fs/gnunet-helper-fs-publish.c')
-rw-r--r--src/fs/gnunet-helper-fs-publish.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/fs/gnunet-helper-fs-publish.c b/src/fs/gnunet-helper-fs-publish.c
index 8df53a6c3..d429f603d 100644
--- a/src/fs/gnunet-helper-fs-publish.c
+++ b/src/fs/gnunet-helper-fs-publish.c
@@ -364,8 +364,7 @@ extract_files (struct ScanTreeNode *item)
364 364
365 /* this is the expensive operation, *afterwards* we'll check for aborts */ 365 /* this is the expensive operation, *afterwards* we'll check for aborts */
366 meta = GNUNET_CONTAINER_meta_data_create (); 366 meta = GNUNET_CONTAINER_meta_data_create ();
367 if (NULL != plugins) 367 EXTRACTOR_extract (plugins, item->filename, NULL, 0, &add_to_md, meta);
368 EXTRACTOR_extract (plugins, item->filename, NULL, 0, &add_to_md, meta);
369 slen = strlen (item->filename) + 1; 368 slen = strlen (item->filename) + 1;
370 size = GNUNET_CONTAINER_meta_data_get_serialized_size (meta); 369 size = GNUNET_CONTAINER_meta_data_get_serialized_size (meta);
371 if (-1 == size) 370 if (-1 == size)
@@ -462,6 +461,7 @@ int main(int argc,
462 FPRINTF (stderr, 461 FPRINTF (stderr,
463 "%s", 462 "%s",
464 "gnunet-helper-fs-publish needs exactly one or two arguments\n"); 463 "gnunet-helper-fs-publish needs exactly one or two arguments\n");
464 GNUNET_free ((void*) argv);
465 return 1; 465 return 1;
466 } 466 }
467 filename_expanded = argv[1]; 467 filename_expanded = argv[1];
@@ -480,13 +480,19 @@ int main(int argc,
480 &root)) 480 &root))
481 { 481 {
482 (void) write_message (GNUNET_MESSAGE_TYPE_FS_PUBLISH_HELPER_ERROR, NULL, 0); 482 (void) write_message (GNUNET_MESSAGE_TYPE_FS_PUBLISH_HELPER_ERROR, NULL, 0);
483 EXTRACTOR_plugin_remove_all (plugins);
484 GNUNET_free ((void*) argv);
483 return 2; 485 return 2;
484 } 486 }
485 /* signal that we're done counting files, so that a percentage of 487 /* signal that we're done counting files, so that a percentage of
486 progress can now be calculated */ 488 progress can now be calculated */
487 if (GNUNET_OK != 489 if (GNUNET_OK !=
488 write_message (GNUNET_MESSAGE_TYPE_FS_PUBLISH_HELPER_COUNTING_DONE, NULL, 0)) 490 write_message (GNUNET_MESSAGE_TYPE_FS_PUBLISH_HELPER_COUNTING_DONE, NULL, 0))
491 {
492 EXTRACTOR_plugin_remove_all (plugins);
493 GNUNET_free ((void*) argv);
489 return 3; 494 return 3;
495 }
490 if (NULL != root) 496 if (NULL != root)
491 { 497 {
492 if (GNUNET_OK != 498 if (GNUNET_OK !=
@@ -494,15 +500,16 @@ int main(int argc,
494 { 500 {
495 (void) write_message (GNUNET_MESSAGE_TYPE_FS_PUBLISH_HELPER_ERROR, NULL, 0); 501 (void) write_message (GNUNET_MESSAGE_TYPE_FS_PUBLISH_HELPER_ERROR, NULL, 0);
496 free_tree (root); 502 free_tree (root);
503 EXTRACTOR_plugin_remove_all (plugins);
504 GNUNET_free ((void*) argv);
497 return 4; 505 return 4;
498 } 506 }
499 free_tree (root); 507 free_tree (root);
500 } 508 }
501 /* enable "clean" shutdown by telling parent that we are done */ 509 /* enable "clean" shutdown by telling parent that we are done */
502 (void) write_message (GNUNET_MESSAGE_TYPE_FS_PUBLISH_HELPER_FINISHED, NULL, 0); 510 (void) write_message (GNUNET_MESSAGE_TYPE_FS_PUBLISH_HELPER_FINISHED, NULL, 0);
503 if (NULL != plugins) 511 EXTRACTOR_plugin_remove_all (plugins);
504 EXTRACTOR_plugin_remove_all (plugins); 512 GNUNET_free ((void*) argv);
505
506 return 0; 513 return 0;
507} 514}
508 515