gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r4059 - in GNUnet: . src/applications/dht/tools


From: grothoff
Subject: [GNUnet-SVN] r4059 - in GNUnet: . src/applications/dht/tools
Date: Tue, 26 Dec 2006 21:39:47 -0800 (PST)

Author: grothoff
Date: 2006-12-26 21:39:45 -0800 (Tue, 26 Dec 2006)
New Revision: 4059

Modified:
   GNUnet/src/applications/dht/tools/dht-query.c
   GNUnet/todo
Log:
more DHT hacking

Modified: GNUnet/src/applications/dht/tools/dht-query.c
===================================================================
--- GNUnet/src/applications/dht/tools/dht-query.c       2006-12-27 05:35:16 UTC 
(rev 4058)
+++ GNUnet/src/applications/dht/tools/dht-query.c       2006-12-27 05:39:45 UTC 
(rev 4059)
@@ -32,7 +32,11 @@
 #include "gnunet_util_boot.h"
 #include "gnunet_util_network_client.h"
 
-static unsigned int timeout;
+/**
+ * How long should a "GET" run (or how long should
+ * content last on the network).
+ */
+static cron_t timeout;
 
 static struct GE_Context * ectx;
 
@@ -49,8 +53,8 @@
   COMMAND_LINE_OPTION_HOSTNAME, /* -H */
   COMMAND_LINE_OPTION_LOGGING, /* -L */
   { 'T', "timeout", "TIME",
-    gettext_noop("allow TIME ms to process each command"),
-    1, &gnunet_getopt_configure_set_uint, &timeout },
+    gettext_noop("allow TIME ms to process a GET command or expire PUT content 
after ms TIME"),
+    1, &gnunet_getopt_configure_set_ulong, &timeout },
   COMMAND_LINE_OPTION_VERSION(PACKAGE_VERSION), /* -v */
   COMMAND_LINE_OPTION_VERBOSE,
   COMMAND_LINE_OPTION_END,
@@ -79,7 +83,10 @@
   GE_LOG(ectx,
         GE_DEBUG | GE_REQUEST | GE_USER,
         "Issuing '%s(%s)' command.\n",
-        "get", key);
+        "get", 
+        key);
+  if (timeout == 0)
+    timeout = 30 * cronSECONDS;
   ret = DHT_LIB_get(cfg,
                    ectx,
                    DHT_STRING2STRING_BLOCK,
@@ -111,6 +118,8 @@
         "put",
         key,
         value);
+  if (timeout == 0)
+    timeout = 30 * cronMINUTES;
   if (OK == DHT_LIB_put(cfg,
                        ectx,
                        &hc,
@@ -119,11 +128,13 @@
                        dc)) {
     printf(_("'%s(%s,%s)' succeeded\n"),
           "put",
-          key, value);
+          key,
+          value);
   } else {
     printf(_("'%s(%s,%s)' failed.\n"),
           "put",
-          key, value);
+          key, 
+          value);
   }    
   FREE(dc);
 }

Modified: GNUnet/todo
===================================================================
--- GNUnet/todo 2006-12-27 05:35:16 UTC (rev 4058)
+++ GNUnet/todo 2006-12-27 05:39:45 UTC (rev 4059)
@@ -31,7 +31,7 @@
 0.7.2 [3'07]:
 - new features:
   * XFS / support for location URIs [CG] 
-    + dht/tools: update clients [RC]
+    + dht/tools/api: complete API get implementation [RC]
     + dht/gap integration [RC]
     + ecrs/location URIs [RC]
     + fsui/location URI support [RC]





reply via email to

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