gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r10684 - gnunet/src/fs


From: gnunet
Subject: [GNUnet-SVN] r10684 - gnunet/src/fs
Date: Wed, 24 Mar 2010 16:12:10 +0100

Author: grothoff
Date: 2010-03-24 16:12:10 +0100 (Wed, 24 Mar 2010)
New Revision: 10684

Modified:
   gnunet/src/fs/fs_publish.c
   gnunet/src/fs/test_fs_namespace.c
Log:
better

Modified: gnunet/src/fs/fs_publish.c
===================================================================
--- gnunet/src/fs/fs_publish.c  2010-03-24 15:08:11 UTC (rev 10683)
+++ gnunet/src/fs/fs_publish.c  2010-03-24 15:12:10 UTC (rev 10684)
@@ -1456,7 +1456,7 @@
                       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,

Modified: gnunet/src/fs/test_fs_namespace.c
===================================================================
--- gnunet/src/fs/test_fs_namespace.c   2010-03-24 15:08:11 UTC (rev 10683)
+++ gnunet/src/fs/test_fs_namespace.c   2010-03-24 15:12:10 UTC (rev 10684)
@@ -109,43 +109,61 @@
   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_SearchContext *search;
+  struct GNUNET_CONTAINER_MetaData *meta;
   struct GNUNET_FS_Namespace *ns;
-  struct GNUNET_FS_Uri *adv;
-  struct GNUNET_CONTAINER_MetaData *meta;
   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);
+}
+
 #if 0
   fprintf (stderr, "Completed namespace search...\n");
   GNUNET_assert (GNUNET_OK == GNUNET_FS_namespace_delete (NULL, cfg, &pid));





reply via email to

[Prev in Thread] Current Thread [Next in Thread]