gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r32357 - in gnunet: doc/man src/gns


From: gnunet
Subject: [GNUnet-SVN] r32357 - in gnunet: doc/man src/gns
Date: Sun, 16 Feb 2014 16:09:39 +0100

Author: grothoff
Date: 2014-02-16 16:09:39 +0100 (Sun, 16 Feb 2014)
New Revision: 32357

Modified:
   gnunet/doc/man/gnunet-gns.1
   gnunet/src/gns/gnunet-gns.c
Log:
add timeout option to gnunet-gns

Modified: gnunet/doc/man/gnunet-gns.1
===================================================================
--- gnunet/doc/man/gnunet-gns.1 2014-02-16 15:06:07 UTC (rev 32356)
+++ gnunet/doc/man/gnunet-gns.1 2014-02-16 15:09:39 UTC (rev 32357)
@@ -22,12 +22,6 @@
 For example a lookup for an IP address will only yield the IP address, no
 descriptive text.
 .B
-.IP "\-t TYPE, \-\-type=TYPE"
-Resource Record Type (TYPE) to look for.
-Supported TYPE's are: A, AAAA, CNAME, NS, PKEY, PSEU, TLSA, SRV, SOA, MX, 
LEHO, VPN, REV, PTR, TXT
-
-Defaults to "A".
-.B
 .IP "\-h, \-\-help"
 Print short help on options.
 .B
@@ -41,6 +35,15 @@
 .IP "\-p PKEY, \-\-public-key=PKEY"
 Public key of the zone to perform the lookup in.  This option should be used 
if the lookup is to be performed against a zone not controlled by this peer 
(alternatively, you could pass a ".zkey" for the name).
 .B
+.IP "\-T DELAY, \-\-timeout=DELAY"
+Set the timeout to DELAY.  By default, gnunet\-gns will continue to try to 
resolve the name until there is a definitive answer or until the user aborts 
with CTRL\-C.
+.B
+.IP "\-t TYPE, \-\-type=TYPE"
+Resource Record Type (TYPE) to look for.
+Supported TYPE's are: A, AAAA, CNAME, NS, PKEY, PSEU, TLSA, SRV, SOA, MX, 
LEHO, VPN, REV, PTR, TXT
+
+Defaults to "A".
+.B
 .IP "\-z NAME, \-\-zone=NAME"
 Name of the ego of the zone to lookup the record in.  The public key 
associated with the ego will be used for the zone.
 .B

Modified: gnunet/src/gns/gnunet-gns.c
===================================================================
--- gnunet/src/gns/gnunet-gns.c 2014-02-16 15:06:07 UTC (rev 32356)
+++ gnunet/src/gns/gnunet-gns.c 2014-02-16 15:09:39 UTC (rev 32357)
@@ -41,6 +41,11 @@
 static struct GNUNET_GNS_Handle *gns;
 
 /**
+ * Desired timeout for the lookup (default is no timeout).
+ */
+static struct GNUNET_TIME_Relative timeout;
+
+/**
  * GNS name to lookup. (-u option)
  */
 static char *lookup_name;
@@ -376,7 +381,7 @@
             _("Failed to connect to GNS\n"));
     return;
   }
-  GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL,
+  GNUNET_SCHEDULER_add_delayed (timeout,
                                &do_shutdown, NULL);
   if (NULL != public_key)
   {
@@ -441,6 +446,9 @@
     {'t', "type", "TYPE",
       gettext_noop ("Specify the type of the record to lookup"), 1,
       &GNUNET_GETOPT_set_string, &lookup_type},
+    { 'T', "timeout", "DELAY",
+      gettext_noop ("Specify timeout for the lookup"), 1,
+      &GNUNET_GETOPT_set_relative_time, &timeout },
     {'r', "raw", NULL,
       gettext_noop ("No unneeded output"), 0,
       &GNUNET_GETOPT_set_one, &raw},
@@ -454,6 +462,7 @@
   };
   int ret;
 
+  timeout = GNUNET_TIME_UNIT_FOREVER_REL;
   if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv))
     return 2;
 




reply via email to

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