gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [gnunet] branch master updated: use modern time specificati


From: gnunet
Subject: [GNUnet-SVN] [gnunet] branch master updated: use modern time specification for expiration
Date: Tue, 31 Jan 2017 14:46:45 +0100

This is an automated email from the git hooks/post-receive script.

grothoff pushed a commit to branch master
in repository gnunet.

The following commit(s) were added to refs/heads/master by this push:
     new 68aa80774 use modern time specification for expiration
68aa80774 is described below

commit 68aa80774490e7f626bd4e34ca9ecda7fbbf9607
Author: Christian Grothoff <address@hidden>
AuthorDate: Tue Jan 31 14:46:57 2017 +0100

    use modern time specification for expiration
---
 src/dht/gnunet-dht-put.c | 24 ++++++++++++++----------
 1 file changed, 14 insertions(+), 10 deletions(-)

diff --git a/src/dht/gnunet-dht-put.c b/src/dht/gnunet-dht-put.c
index 9b17da01f..64764cb65 100644
--- a/src/dht/gnunet-dht-put.c
+++ b/src/dht/gnunet-dht-put.c
@@ -44,7 +44,7 @@ static char *query_key;
 /**
  * User supplied expiration value
  */
-static unsigned long long expiration_seconds = 3600;
+static struct GNUNET_TIME_Relative expiration;
 
 /**
  * Desired replication level.
@@ -170,13 +170,11 @@ run (void *cls,
 
   GNUNET_CRYPTO_hash (query_key, strlen (query_key), &key);
 
-  expiration =
-      GNUNET_TIME_relative_to_absolute (GNUNET_TIME_relative_multiply
-                                        (GNUNET_TIME_UNIT_SECONDS,
-                                         expiration_seconds));
   if (verbose)
-    FPRINTF (stderr, _("Issuing put request for `%s' with data `%s'!\n"),
-             query_key, data);
+    FPRINTF (stderr,
+             _("Issuing put request for `%s' with data `%s'!\n"),
+             query_key,
+             data);
   ro = GNUNET_DHT_RO_NONE;
   if (demultixplex_everywhere)
     ro |= GNUNET_DHT_RO_DEMULTIPLEX_EVERYWHERE;
@@ -204,7 +202,7 @@ static struct GNUNET_GETOPT_CommandLineOption options[] = {
    1, &GNUNET_GETOPT_set_string, &data},
   {'e', "expiration", "EXPIRATION",
    gettext_noop ("how long to store this entry in the dht (in seconds)"),
-   1, &GNUNET_GETOPT_set_ulong, &expiration_seconds},
+   1, &GNUNET_GETOPT_set_relative_time, &expiration},
   {'k', "key", "KEY",
    gettext_noop ("the query key"),
    1, &GNUNET_GETOPT_set_string, &query_key},
@@ -240,11 +238,17 @@ main (int argc, char *const *argv)
   if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv,
                                                  &argc, &argv))
     return 2;
+  expiration = GNUNET_TIME_UNIT_HOURS;
   return (GNUNET_OK ==
-          GNUNET_PROGRAM_run (argc, argv, "gnunet-dht-put",
+          GNUNET_PROGRAM_run (argc,
+                              argv,
+                              "gnunet-dht-put",
                               gettext_noop
                               ("Issue a PUT request to the GNUnet DHT insert 
DATA under KEY."),
-                              options, &run, NULL)) ? ret : 1;
+                              options,
+                              &run,
+                              NULL))
+    ? ret : 1;
 }
 
 /* end of gnunet-dht-put.c */

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

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