X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=src%2Ffs%2Fgnunet-publish.c;h=a0863dcbbd2a0153c582b532a823cbc43e42d4c8;hb=1b49510e7736620d7e10a33326076e2d75c86943;hp=39235683c6631be5136b41f85a0bc5745994cea0;hpb=303ab4dafbc680b1b362f95df5b12dae831b1593;p=oweals%2Fgnunet.git diff --git a/src/fs/gnunet-publish.c b/src/fs/gnunet-publish.c index 39235683c..a0863dcbb 100644 --- a/src/fs/gnunet-publish.c +++ b/src/fs/gnunet-publish.c @@ -1,6 +1,6 @@ /* This file is part of GNUnet. - (C) 2001-2013 Christian Grothoff (and other contributing authors) + Copyright (C) 2001-2013 Christian Grothoff (and other contributing authors) GNUnet is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published @@ -14,8 +14,8 @@ You should have received a copy of the GNU General Public License along with GNUnet; see the file COPYING. If not, write to the - Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ /** * @file fs/gnunet-publish.c @@ -30,9 +30,9 @@ #include "gnunet_identity_service.h" /** - * Global return value from 'main'. + * Global return value from #main(). */ -static int ret = 1; +static int ret; /** * Command line option 'verbose' set @@ -124,11 +124,6 @@ static int extract_only; */ static int do_disable_creation_time; -/** - * Task run on CTRL-C to kill everything nicely. - */ -static GNUNET_SCHEDULER_TaskIdentifier kill_task; - /** * Handle to the directory scanner (for recursive insertions). */ @@ -154,48 +149,42 @@ static struct GNUNET_IDENTITY_Handle *identity; * @param tc scheduler context */ static void -do_stop_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) +do_stop_task (void *cls, + const struct GNUNET_SCHEDULER_TaskContext *tc) { struct GNUNET_FS_PublishContext *p; - kill_task = GNUNET_SCHEDULER_NO_TASK; + if (NULL != ds) + { + GNUNET_FS_directory_scan_abort (ds); + ds = NULL; + } + if (NULL != identity) + { + GNUNET_IDENTITY_disconnect (identity); + identity = NULL; + } if (NULL != pc) { p = pc; pc = NULL; GNUNET_FS_publish_stop (p); } + if (NULL != ctx) + { + GNUNET_FS_stop (ctx); + ctx = NULL; + } if (NULL != meta) { GNUNET_CONTAINER_meta_data_destroy (meta); meta = NULL; - } -} - - -/** - * Stop the directory scanner (we had an error). - * - * @param cls closure - * @param tc scheduler context - */ -static void -stop_scanner_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) -{ - kill_task = GNUNET_SCHEDULER_NO_TASK; - if (NULL != ds) - { - GNUNET_FS_directory_scan_abort (ds); - ds = NULL; - } - if (NULL != identity) + } + if (NULL != uri) { - GNUNET_IDENTITY_disconnect (identity); - identity = NULL; + GNUNET_FS_uri_destroy (uri); + uri = NULL; } - GNUNET_FS_stop (ctx); - ctx = NULL; - ret = 1; } @@ -213,7 +202,8 @@ stop_scanner_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) * field in the GNUNET_FS_ProgressInfo struct. */ static void * -progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *info) +progress_cb (void *cls, + const struct GNUNET_FS_ProgressInfo *info) { const char *s; char *suri; @@ -227,50 +217,85 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *info) { s = GNUNET_STRINGS_relative_time_to_string (info->value.publish.eta, GNUNET_YES); - FPRINTF (stdout, _("Publishing `%s' at %llu/%llu (%s remaining)\n"), + FPRINTF (stdout, + _("Publishing `%s' at %llu/%llu (%s remaining)\n"), info->value.publish.filename, (unsigned long long) info->value.publish.completed, (unsigned long long) info->value.publish.size, s); } break; - case GNUNET_FS_STATUS_PUBLISH_ERROR: - FPRINTF (stderr, _("Error publishing: %s.\n"), - info->value.publish.specifics.error.message); - if (kill_task != GNUNET_SCHEDULER_NO_TASK) + case GNUNET_FS_STATUS_PUBLISH_PROGRESS_DIRECTORY: + if (verbose) { - GNUNET_SCHEDULER_cancel (kill_task); - kill_task = GNUNET_SCHEDULER_NO_TASK; + s = GNUNET_STRINGS_relative_time_to_string (info->value.publish.specifics.progress_directory.eta, + GNUNET_YES); + FPRINTF (stdout, + _("Publishing `%s' at %llu/%llu (%s remaining)\n"), + info->value.publish.filename, + (unsigned long long) info->value.publish.specifics.progress_directory.completed, + (unsigned long long) info->value.publish.specifics.progress_directory.total, s); } - kill_task = GNUNET_SCHEDULER_add_now (&do_stop_task, NULL); + break; + case GNUNET_FS_STATUS_PUBLISH_ERROR: + FPRINTF (stderr, + _("Error publishing: %s.\n"), + info->value.publish.specifics.error.message); + ret = 1; + GNUNET_SCHEDULER_shutdown (); break; case GNUNET_FS_STATUS_PUBLISH_COMPLETED: - FPRINTF (stdout, _("Publishing `%s' done.\n"), + FPRINTF (stdout, + _("Publishing `%s' done.\n"), info->value.publish.filename); suri = GNUNET_FS_uri_to_string (info->value.publish.specifics. - completed.chk_uri); - FPRINTF (stdout, _("URI is `%s'.\n"), suri); + completed.chk_uri); + FPRINTF (stdout, + _("URI is `%s'.\n"), + suri); GNUNET_free (suri); + if (NULL != info->value.publish.specifics.completed.sks_uri) + { + suri = GNUNET_FS_uri_to_string (info->value.publish.specifics. + completed.sks_uri); + FPRINTF (stdout, + _("Namespace URI is `%s'.\n"), + suri); + GNUNET_free (suri); + } if (NULL == info->value.publish.pctx) { - if (GNUNET_SCHEDULER_NO_TASK != kill_task) - { - GNUNET_SCHEDULER_cancel (kill_task); - kill_task = GNUNET_SCHEDULER_NO_TASK; - } - kill_task = GNUNET_SCHEDULER_add_now (&do_stop_task, NULL); + ret = 0; + GNUNET_SCHEDULER_shutdown (); } - ret = 0; break; case GNUNET_FS_STATUS_PUBLISH_STOPPED: GNUNET_break (NULL == pc); return NULL; + case GNUNET_FS_STATUS_UNINDEX_START: + FPRINTF (stderr, + "%s", + _("Starting cleanup after abort\n")); + return NULL; case GNUNET_FS_STATUS_UNINDEX_PROGRESS: return NULL; case GNUNET_FS_STATUS_UNINDEX_COMPLETED: - FPRINTF (stderr, "%s", _("Cleanup after abort complete.\n")); + FPRINTF (stderr, + "%s", + _("Cleanup after abort completed.\n")); + GNUNET_FS_unindex_stop (info->value.unindex.uc); + return NULL; + case GNUNET_FS_STATUS_UNINDEX_ERROR: + FPRINTF (stderr, + "%s", + _("Cleanup after abort failed.\n")); + GNUNET_FS_unindex_stop (info->value.unindex.uc); + return NULL; + case GNUNET_FS_STATUS_UNINDEX_STOPPED: return NULL; default: - FPRINTF (stderr, _("Unexpected status: %d\n"), info->status); + FPRINTF (stderr, + _("Unexpected status: %d\n"), + info->status); return NULL; } return ""; /* non-null */ @@ -285,14 +310,17 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *info) * @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_mime_type mime type of @a data * @param data value of the meta data - * @param data_size number of bytes in data + * @param data_size number of bytes in @a data * @return always 0 */ static int -meta_printer (void *cls, const char *plugin_name, enum EXTRACTOR_MetaType type, - enum EXTRACTOR_MetaFormat format, const char *data_mime_type, +meta_printer (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) { if ((EXTRACTOR_METAFORMAT_UTF8 != format) && @@ -300,7 +328,17 @@ meta_printer (void *cls, const char *plugin_name, enum EXTRACTOR_MetaType type, return 0; if (EXTRACTOR_METATYPE_GNUNET_ORIGINAL_FILENAME == type) return 0; - FPRINTF (stdout, "\t%s - %s\n", EXTRACTOR_metatype_to_string (type), data); +#if HAVE_LIBEXTRACTOR + FPRINTF (stdout, + "\t%s - %s\n", + EXTRACTOR_metatype_to_string (type), + data); +#else + FPRINTF (stdout, + "\t%d - %s\n", + type, + data); +#endif return 0; } @@ -311,10 +349,12 @@ meta_printer (void *cls, const char *plugin_name, enum EXTRACTOR_MetaType type, * @param cls closure * @param keyword the keyword * @param is_mandatory is the keyword mandatory (in a search) - * @return GNUNET_OK to continue to iterate, GNUNET_SYSERR to abort + * @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to abort */ static int -keyword_printer (void *cls, const char *keyword, int is_mandatory) +keyword_printer (void *cls, + const char *keyword, + int is_mandatory) { FPRINTF (stdout, "\t%s\n", keyword); return GNUNET_OK; @@ -334,15 +374,18 @@ keyword_printer (void *cls, const char *keyword, int is_mandatory) * @param bo block options * @param do_index should we index? * @param client_info pointer to client context set upon creation (can be modified) - * @return GNUNET_OK to continue, GNUNET_NO to remove - * this entry from the directory, GNUNET_SYSERR + * @return #GNUNET_OK to continue, #GNUNET_NO to remove + * this entry from the directory, #GNUNET_SYSERR * to abort the iteration */ static int -publish_inspector (void *cls, struct GNUNET_FS_FileInformation *fi, - uint64_t length, struct GNUNET_CONTAINER_MetaData *m, +publish_inspector (void *cls, + struct GNUNET_FS_FileInformation *fi, + uint64_t length, + struct GNUNET_CONTAINER_MetaData *m, struct GNUNET_FS_Uri **uri, - struct GNUNET_FS_BlockOptions *bo, int *do_index, + struct GNUNET_FS_BlockOptions *bo, + int *do_index, void **client_info) { char *fn; @@ -385,17 +428,26 @@ publish_inspector (void *cls, struct GNUNET_FS_FileInformation *fi, fn = GNUNET_CONTAINER_meta_data_get_by_type (m, EXTRACTOR_METATYPE_GNUNET_ORIGINAL_FILENAME); fs = GNUNET_STRINGS_byte_size_fancy (length); - FPRINTF (stdout, _("Meta data for file `%s' (%s)\n"), fn, fs); + FPRINTF (stdout, + _("Meta data for file `%s' (%s)\n"), + fn, + fs); GNUNET_CONTAINER_meta_data_iterate (m, &meta_printer, NULL); - FPRINTF (stdout, _("Keywords for file `%s' (%s)\n"), fn, fs); + FPRINTF (stdout, + _("Keywords for file `%s' (%s)\n"), + fn, + fs); GNUNET_free (fn); GNUNET_free (fs); if (NULL != *uri) GNUNET_FS_uri_ksk_get_keywords (*uri, &keyword_printer, NULL); - FPRINTF (stdout, "%s", "\n"); + FPRINTF (stdout, + "%s", + "\n"); } if (GNUNET_YES == GNUNET_FS_meta_data_test_for_directory (m)) - GNUNET_FS_file_information_inspect (fi, &publish_inspector, fi); + GNUNET_FS_file_information_inspect (fi, + &publish_inspector, fi); return GNUNET_OK; } @@ -410,18 +462,18 @@ publish_inspector (void *cls, struct GNUNET_FS_FileInformation *fi, * @param emsg error message, NULL on success */ static void -uri_sks_continuation (void *cls, const struct GNUNET_FS_Uri *sks_uri, +uri_sks_continuation (void *cls, + const struct GNUNET_FS_Uri *sks_uri, const char *emsg) { if (NULL != emsg) { - FPRINTF (stderr, "%s\n", emsg); + FPRINTF (stderr, + "%s\n", + emsg); ret = 1; } - GNUNET_FS_uri_destroy (uri); - uri = NULL; - GNUNET_FS_stop (ctx); - ctx = NULL; + GNUNET_SCHEDULER_shutdown (); } @@ -435,28 +487,34 @@ uri_sks_continuation (void *cls, const struct GNUNET_FS_Uri *sks_uri, * @param emsg error message, NULL on success */ static void -uri_ksk_continuation (void *cls, const struct GNUNET_FS_Uri *ksk_uri, +uri_ksk_continuation (void *cls, + const struct GNUNET_FS_Uri *ksk_uri, const char *emsg) { - const struct GNUNET_CRYPTO_EccPrivateKey *priv; + const struct GNUNET_CRYPTO_EcdsaPrivateKey *priv; if (NULL != emsg) { - FPRINTF (stderr, "%s\n", emsg); + FPRINTF (stderr, + "%s\n", + emsg); ret = 1; } if (NULL != namespace) { priv = GNUNET_IDENTITY_ego_get_private_key (namespace); - GNUNET_FS_publish_sks (ctx, priv, this_id, next_id, meta, uri, &bo, + GNUNET_FS_publish_sks (ctx, + priv, + this_id, + next_id, + meta, + uri, + &bo, GNUNET_FS_PUBLISH_OPTION_NONE, &uri_sks_continuation, NULL); return; } - GNUNET_FS_uri_destroy (uri); - uri = NULL; - GNUNET_FS_stop (ctx); - ctx = NULL; + GNUNET_SCHEDULER_shutdown (); } @@ -476,8 +534,10 @@ get_file_information (struct GNUNET_FS_ShareTreeItem *item) if (GNUNET_YES == item->is_directory) { + if (NULL == item->meta) + item->meta = GNUNET_CONTAINER_meta_data_create (); GNUNET_CONTAINER_meta_data_delete (item->meta, - EXTRACTOR_METATYPE_MIMETYPE, + EXTRACTOR_METATYPE_MIMETYPE, NULL, 0); GNUNET_FS_meta_data_make_directory (item->meta); if (NULL == item->ksk_uri) @@ -488,9 +548,9 @@ get_file_information (struct GNUNET_FS_ShareTreeItem *item) else GNUNET_FS_uri_ksk_add_keyword (item->ksk_uri, GNUNET_FS_DIRECTORY_MIME, GNUNET_NO); - fi = GNUNET_FS_file_information_create_empty_directory (ctx, NULL, + fi = GNUNET_FS_file_information_create_empty_directory (ctx, NULL, item->ksk_uri, - item->meta, + item->meta, &bo, item->filename); for (child = item->children_head; child; child = child->next) { @@ -500,9 +560,9 @@ get_file_information (struct GNUNET_FS_ShareTreeItem *item) } else { - fi = GNUNET_FS_file_information_create_from_file (ctx, NULL, + fi = GNUNET_FS_file_information_create_from_file (ctx, NULL, item->filename, - item->ksk_uri, item->meta, + item->ksk_uri, item->meta, !do_insert, &bo); } @@ -520,15 +580,17 @@ static void directory_trim_complete (struct GNUNET_FS_ShareTreeItem *directory_scan_result) { struct GNUNET_FS_FileInformation *fi; - const struct GNUNET_CRYPTO_EccPrivateKey *priv; + const struct GNUNET_CRYPTO_EcdsaPrivateKey *priv; fi = get_file_information (directory_scan_result); GNUNET_FS_share_tree_free (directory_scan_result); if (NULL == fi) { - FPRINTF (stderr, "%s", _("Could not publish\n")); - GNUNET_SCHEDULER_shutdown (); + FPRINTF (stderr, + "%s", + _("Could not publish\n")); ret = 1; + GNUNET_SCHEDULER_shutdown (); return; } GNUNET_FS_file_information_inspect (fi, &publish_inspector, NULL); @@ -542,16 +604,18 @@ directory_trim_complete (struct GNUNET_FS_ShareTreeItem *directory_scan_result) priv = NULL; else priv = GNUNET_IDENTITY_ego_get_private_key (namespace); - pc = GNUNET_FS_publish_start (ctx, fi, + pc = GNUNET_FS_publish_start (ctx, fi, priv, this_id, next_id, (do_simulate) ? GNUNET_FS_PUBLISH_OPTION_SIMULATE_ONLY : GNUNET_FS_PUBLISH_OPTION_NONE); if (NULL == pc) { - FPRINTF (stderr, "%s", _("Could not start publishing.\n")); - GNUNET_SCHEDULER_shutdown (); + FPRINTF (stderr, + "%s", + _("Could not start publishing.\n")); ret = 1; + GNUNET_SCHEDULER_shutdown (); return; } } @@ -563,14 +627,14 @@ directory_trim_complete (struct GNUNET_FS_ShareTreeItem *directory_scan_result) * * @param cls closure * @param filename which file we are making progress on - * @param is_directory GNUNET_YES if this is a directory, - * GNUNET_NO if this is a file - * GNUNET_SYSERR if it is neither (or unknown) + * @param is_directory #GNUNET_YES if this is a directory, + * #GNUNET_NO if this is a file + * #GNUNET_SYSERR if it is neither (or unknown) * @param reason kind of progress we are making */ static void -directory_scan_cb (void *cls, - const char *filename, +directory_scan_cb (void *cls, + const char *filename, int is_directory, enum GNUNET_FS_DirScannerProgressUpdateReason reason) { @@ -582,40 +646,48 @@ directory_scan_cb (void *cls, if (verbose > 1) { if (is_directory == GNUNET_YES) - FPRINTF (stdout, _("Scanning directory `%s'.\n"), filename); + FPRINTF (stdout, + _("Scanning directory `%s'.\n"), + filename); else - FPRINTF (stdout, _("Scanning file `%s'.\n"), filename); + FPRINTF (stdout, + _("Scanning file `%s'.\n"), + filename); } break; case GNUNET_FS_DIRSCANNER_FILE_IGNORED: - FPRINTF (stderr, + FPRINTF (stderr, _("There was trouble processing file `%s', skipping it.\n"), filename); break; case GNUNET_FS_DIRSCANNER_ALL_COUNTED: if (verbose) - FPRINTF (stdout, "%s", _("Preprocessing complete.\n")); + FPRINTF (stdout, + "%s", + _("Preprocessing complete.\n")); break; case GNUNET_FS_DIRSCANNER_EXTRACT_FINISHED: if (verbose > 2) - FPRINTF (stdout, _("Extracting meta data from file `%s' complete.\n"), filename); + FPRINTF (stdout, + _("Extracting meta data from file `%s' complete.\n"), + filename); break; case GNUNET_FS_DIRSCANNER_FINISHED: if (verbose > 1) - FPRINTF (stdout, "%s", _("Meta data extraction has finished.\n")); + FPRINTF (stdout, + "%s", + _("Meta data extraction has finished.\n")); directory_scan_result = GNUNET_FS_directory_scan_get_result (ds); ds = NULL; GNUNET_FS_share_tree_trim (directory_scan_result); directory_trim_complete (directory_scan_result); break; case GNUNET_FS_DIRSCANNER_INTERNAL_ERROR: - FPRINTF (stdout, "%s", _("Internal error scanning directory.\n")); - if (kill_task != GNUNET_SCHEDULER_NO_TASK) - { - GNUNET_SCHEDULER_cancel (kill_task); - kill_task = GNUNET_SCHEDULER_NO_TASK; - } - kill_task = GNUNET_SCHEDULER_add_now (&stop_scanner_task, NULL); + FPRINTF (stdout, + "%s", + _("Internal error scanning directory.\n")); + ret = 1; + GNUNET_SCHEDULER_shutdown (); break; default: GNUNET_assert (0); @@ -630,7 +702,7 @@ directory_scan_cb (void *cls, * has been initialized. * * @param args0 filename to publish - */ + */ static void identity_continuation (const char *args0) { @@ -640,7 +712,10 @@ identity_continuation (const char *args0) if ( (NULL != pseudonym) && (NULL == namespace) ) { - FPRINTF (stderr, _("Selected pseudonym `%s' unknown\n"), pseudonym); + FPRINTF (stderr, + _("Selected pseudonym `%s' unknown\n"), + pseudonym); + ret = 1; GNUNET_SCHEDULER_shutdown (); return; } @@ -649,14 +724,19 @@ identity_continuation (const char *args0) emsg = NULL; if (NULL == (uri = GNUNET_FS_uri_parse (uri_string, &emsg))) { - FPRINTF (stderr, _("Failed to parse URI: %s\n"), emsg); + FPRINTF (stderr, + _("Failed to parse URI: %s\n"), + emsg); GNUNET_free (emsg); - GNUNET_SCHEDULER_shutdown (); ret = 1; + GNUNET_SCHEDULER_shutdown (); return; } - GNUNET_FS_publish_ksk (ctx, topKeywords, meta, uri, &bo, - GNUNET_FS_PUBLISH_OPTION_NONE, &uri_ksk_continuation, + GNUNET_FS_publish_ksk (ctx, topKeywords, + meta, uri, + &bo, + GNUNET_FS_PUBLISH_OPTION_NONE, + &uri_ksk_continuation, NULL); return; } @@ -669,18 +749,22 @@ identity_continuation (const char *args0) _("Failed to access `%s': %s\n"), args0, STRERROR (errno)); + GNUNET_free_non_null (ex); return; } ds = GNUNET_FS_directory_scan_start (args0, - disable_extractor, - ex, + disable_extractor, + ex, &directory_scan_cb, NULL); if (NULL == ds) { FPRINTF (stderr, - "%s", _("Failed to start meta directory scanner. Is gnunet-helper-publish-fs installed?\n")); + "%s", + _("Failed to start meta directory scanner. Is gnunet-helper-publish-fs installed?\n")); + GNUNET_free_non_null (ex); return; } + GNUNET_free_non_null (ex); } @@ -689,7 +773,7 @@ identity_continuation (const char *args0) * * @param cls closure with 'const char *' of filename to publish * @param ego ego handle - * @param ego_ctx context for application to store data for this ego + * @param ctx context for application to store data for this ego * (during the lifetime of this process, initially NULL) * @param name name assigned by the user for this ego, * NULL if the user just deleted the ego and it @@ -703,11 +787,13 @@ identity_cb (void *cls, { const char *args0 = cls; - if (NULL == ego) + if (NULL == ego) { identity_continuation (args0); return; } + if (NULL == name) + return; if (0 == strcmp (name, pseudonym)) namespace = ego; } @@ -722,7 +808,9 @@ identity_cb (void *cls, * @param c configuration */ static void -run (void *cls, char *const *args, const char *cfgfile, +run (void *cls, + char *const *args, + const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *c) { /* check arguments */ @@ -759,14 +847,16 @@ run (void *cls, char *const *args, const char *cfgfile, { /* ordinary insertion checks */ if (NULL != next_id) { - FPRINTF (stderr, _("Option `%s' makes no sense without option `%s'.\n"), + FPRINTF (stderr, + _("Option `%s' makes no sense without option `%s'.\n"), "-N", "-P"); ret = -1; return; } if (NULL != this_id) { - FPRINTF (stderr, _("Option `%s' makes no sense without option `%s'.\n"), + FPRINTF (stderr, + _("Option `%s' makes no sense without option `%s'.\n"), "-t", "-P"); ret = -1; return; @@ -778,16 +868,19 @@ run (void *cls, char *const *args, const char *cfgfile, GNUNET_FS_FLAGS_NONE, GNUNET_FS_OPTIONS_END); if (NULL == ctx) { - FPRINTF (stderr, _("Could not initialize `%s' subsystem.\n"), "FS"); + FPRINTF (stderr, + _("Could not initialize `%s' subsystem.\n"), + "FS"); ret = 1; return; } - kill_task = - GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, &do_stop_task, - NULL); + GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, + &do_stop_task, + NULL); if (NULL != pseudonym) identity = GNUNET_IDENTITY_connect (cfg, - &identity_cb, args[0]); + &identity_cb, + args[0]); else identity_continuation (args[0]); } @@ -863,7 +956,7 @@ main (int argc, char *const *argv) GNUNET_GETOPT_OPTION_END }; bo.expiration_time = - GNUNET_FS_year_to_time (GNUNET_FS_get_current_year () + 2); + GNUNET_TIME_year_to_time (GNUNET_TIME_get_current_year () + 2); if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv)) return 2;