add -z option to gnunet-namestore-fcfsd
authorChristian Grothoff <christian@grothoff.org>
Thu, 7 Jun 2018 14:42:23 +0000 (16:42 +0200)
committerChristian Grothoff <christian@grothoff.org>
Thu, 7 Jun 2018 14:42:23 +0000 (16:42 +0200)
src/namestore/gnunet-namestore-fcfsd.c

index e0c04e6f185414baa5023cb0edbc6d367e7c8f4b..3e3e598e79288ed3c4ddf6ed5b8564eecfdb4d07 100644 (file)
@@ -1011,12 +1011,16 @@ identity_cb (void *cls,
 
   (void) cls;
   (void) ctx;
-  (void) name;
-  id_op = NULL;
+  if (NULL == name)
+    return;
+  if (0 != strcmp (name,
+                  zone))
+    return;
   if (NULL == ego)
   {
     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
                _("No ego configured for `fcfsd` subsystem\n"));
+    GNUNET_SCHEDULER_shutdown ();
     return;
   }
   fcfs_zone_pkey = *GNUNET_IDENTITY_ego_get_private_key (ego);
@@ -1085,17 +1089,14 @@ run (void *cls,
       return;
     }
   identity = GNUNET_IDENTITY_connect (cfg,
-                                     NULL, NULL);
+                                     &identity_cb,
+                                     NULL);
   if (NULL == identity)
   {
     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
                 _("Failed to connect to identity\n"));
     return;
   }
-  id_op = GNUNET_IDENTITY_get (identity,
-                              zone,
-                              &identity_cb,
-                              NULL);
   GNUNET_SCHEDULER_add_shutdown (&do_shutdown,
                                 NULL);
 }