- moved timeout handling responsibility from for nat tests from caller to the library
[oweals/gnunet.git] / src / namecache / gnunet-namecache.c
index 8635fa75f2398a8c1f077b6403c4631e5a7763c7..4215af642b090db5e269fec1954886143400e279 100644 (file)
@@ -1,4 +1,3 @@
-
 /*
      This file is part of GNUnet.
      (C) 2012, 2013 Christian Grothoff (and other contributing authors)
  * - test
  */
 #include "platform.h"
-#include <gnunet_util_lib.h>
-#include <gnunet_dnsparser_lib.h>
-#include <gnunet_identity_service.h>
-#include <gnunet_gnsrecord_lib.h>
-#include <gnunet_namecache_service.h>
-#include <gnunet_namestore_service.h>
+#include "gnunet_util_lib.h"
+#include "gnunet_dnsparser_lib.h"
+#include "gnunet_identity_service.h"
+#include "gnunet_gnsrecord_lib.h"
+#include "gnunet_namecache_service.h"
 
 
 /**
@@ -199,9 +197,18 @@ run (void *cls, char *const *args, const char *cfgfile,
     GNUNET_SCHEDULER_shutdown ();
     return;
   }
+  if (NULL == name)
+  {
+    fprintf (stderr,
+             _("You must specify a name\n"));
+    return;
+  }
+
+
   GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL,
                                 &do_shutdown,
                                 NULL);
+  ns = GNUNET_NAMECACHE_connect (cfg);
   GNUNET_GNSRECORD_query_from_public_key (&pubkey,
                                           name,
                                           &dhash);