From: Christian Grothoff Date: Wed, 24 Mar 2010 15:12:10 +0000 (+0000) Subject: better X-Git-Tag: initial-import-from-subversion-38251~22382 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=afdadb72f52b2a67d8ec989283ecc66edac6c987;p=oweals%2Fgnunet.git better --- diff --git a/src/fs/fs_publish.c b/src/fs/fs_publish.c index 634f88801..e60b07f5b 100644 --- a/src/fs/fs_publish.c +++ b/src/fs/fs_publish.c @@ -1456,7 +1456,7 @@ GNUNET_FS_publish_sks (struct GNUNET_FS_Handle *h, const char *identifier, const char *update, struct GNUNET_CONTAINER_MetaData *meta, - struct GNUNET_FS_Uri *uri, + const struct GNUNET_FS_Uri *uri, struct GNUNET_TIME_Absolute expirationTime, uint32_t anonymity, uint32_t priority, diff --git a/src/fs/test_fs_namespace.c b/src/fs/test_fs_namespace.c index 825612b1a..0972730d2 100644 --- a/src/fs/test_fs_namespace.c +++ b/src/fs/test_fs_namespace.c @@ -109,40 +109,58 @@ publish_cont (void *cls, search = GNUNET_FS_search_start (fs, uri, 1, "ns-search"); } - static void -testNamespace () +adv_cont (void *cls, + const struct GNUNET_FS_Uri *uri, + const char *emsg) { - struct GNUNET_FS_Namespace *ns; - struct GNUNET_FS_Uri *adv; + struct GNUNET_FS_SearchContext *search; struct GNUNET_CONTAINER_MetaData *meta; + struct GNUNET_FS_Namespace *ns; struct GNUNET_TIME_Absolute expiration; expiration = GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_MINUTES); - meta = GNUNET_CONTAINER_meta_data_create (); - adv = GNUNET_FS_uri_ksk_create ("testNamespace", NULL); ns = GNUNET_FS_namespace_create (fs, "testNamespace"); - GNUNET_FS_namespace_advertise (fs, - ns, - meta, - 1, 1, - expiration, - "root", - &publish_cont, NULL); -#if 0 + meta = GNUNET_CONTAINER_meta_data_create (); + GNUNET_assert (NULL == emsg); + fprintf (stderr, "Starting namespace search...\n"); + search = GNUNET_FS_search_start (fs, uri, 1, "ns-search"); GNUNET_FS_publish_sks (fs, ns, "this", "next", meta, - rootUri, + uri, expiration, 1, 1, GNUNET_FS_PUBLISH_OPTION_NONE, &publish_cont, NULL); -#endif + GNUNET_CONTAINER_meta_data_destroy (meta); + GNUNET_FS_namespace_delete (ns, GNUNET_NO); +} + + +static void +testNamespace () +{ + struct GNUNET_FS_Namespace *ns; + struct GNUNET_TIME_Absolute expiration; + struct GNUNET_CONTAINER_MetaData *meta; + + expiration = GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_MINUTES); + meta = GNUNET_CONTAINER_meta_data_create (); + ns = GNUNET_FS_namespace_create (fs, + "testNamespace"); + GNUNET_FS_namespace_advertise (fs, + ns, + meta, + 1, 1, + expiration, + "root", + &adv_cont, NULL); + GNUNET_FS_namespace_delete (ns, GNUNET_NO); GNUNET_CONTAINER_meta_data_destroy (meta); }