gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r8547 - in gnunet: . src/include src/util


From: gnunet
Subject: [GNUnet-SVN] r8547 - in gnunet: . src/include src/util
Date: Wed, 10 Jun 2009 23:30:19 -0600

Author: grothoff
Date: 2009-06-10 23:30:19 -0600 (Wed, 10 Jun 2009)
New Revision: 8547

Modified:
   gnunet/TODO
   gnunet/src/include/gnunet_configuration_lib.h
   gnunet/src/util/configuration.c
   gnunet/src/util/service.c
Log:
get time cfg api added

Modified: gnunet/TODO
===================================================================
--- gnunet/TODO 2009-06-11 05:22:06 UTC (rev 8546)
+++ gnunet/TODO 2009-06-11 05:30:19 UTC (rev 8547)
@@ -7,7 +7,6 @@
   => bootstrap should use plugins, possible multiple at the same time!
 
 Util:
-* consider adding "get_time" to "configuration" API
 * improve disk API [Nils]
 
 TESTCASES WANTED:
@@ -52,7 +51,7 @@
   - handle_transport_notify_disconnect
 
 
-PHASE #2: (Goal: recover basic core functionality)
+PHASE #2: (Goal: recover basic file-sharing functionality)
 
 Datastores:
 * implement sqlite-based sqstore/datastore service
@@ -70,17 +69,9 @@
 * FS / fs-libs
 
 Databases:
-* mysql & postgres backend
+* have ONE backend working
 
-Transports:
-* UDP backend (need LIBRARY to support (de)fragmentation!)
-* HTTP backend
-* Testing:
-  +  Testcases for set_quota, timeouts, disconnects, transmit_ready_cancel
-  + Better coverage of gnunet-service-transport (hello validation)
-  + direct test of plugins compliance to plugin API
 
-
 PHASE #3: (Goal: ready for pre-release) [completion-goal: end of 2009]
 
 * testing
@@ -90,8 +81,19 @@
 * tracekit
 * vpn
 
+Transports:
+* UDP backend (need LIBRARY to support (de)fragmentation!)
+* HTTP backend
+* Testing:
+  +  Testcases for set_quota, timeouts, disconnects, transmit_ready_cancel
+  + Better coverage of gnunet-service-transport (hello validation)
+  + direct test of plugins compliance to plugin API
 
+Databases:
+* sqlite, mysql & postgres backend
 
+
+
 Minor TODO items:
 * SERVER:
   - inefficient memmove

Modified: gnunet/src/include/gnunet_configuration_lib.h
===================================================================
--- gnunet/src/include/gnunet_configuration_lib.h       2009-06-11 05:22:06 UTC 
(rev 8546)
+++ gnunet/src/include/gnunet_configuration_lib.h       2009-06-11 05:30:19 UTC 
(rev 8547)
@@ -38,6 +38,7 @@
 #endif
 
 #include "gnunet_common.h"
+#include "gnunet_time_lib.h"
 
 /**
  * A configuration object.
@@ -99,6 +100,17 @@
                                            unsigned long long *number);
 
 /**
+ * Get a configuration value that should be a relative time.
+ *
+ * @param time set to the time value stored in the configuration
+ * @return GNUNET_OK on success, GNUNET_SYSERR on error
+ */
+int GNUNET_CONFIGURATION_get_value_time (struct GNUNET_CONFIGURATION_Handle
+                                        *cfg, const char *section,
+                                        const char *option,
+                                        struct GNUNET_TIME_Relative *time);
+
+/**
  * Test if we have a value for a particular option
  * @return GNUNET_YES if so, GNUNET_NO if not.
  */

Modified: gnunet/src/util/configuration.c
===================================================================
--- gnunet/src/util/configuration.c     2009-06-11 05:22:06 UTC (rev 8546)
+++ gnunet/src/util/configuration.c     2009-06-11 05:30:19 UTC (rev 8547)
@@ -402,6 +402,24 @@
 }
 
 int
+GNUNET_CONFIGURATION_get_value_time (struct GNUNET_CONFIGURATION_Handle
+                                    *cfg, const char *section,
+                                    const char *option,
+                                    struct GNUNET_TIME_Relative *time)
+{
+  unsigned long long num;
+  int ret;
+
+  ret = GNUNET_CONFIGURATION_get_value_number (cfg,
+                                              section,
+                                              option,
+                                              &num);
+  if (ret == GNUNET_OK)
+    time->value = (uint64_t) num;
+  return ret;
+}
+
+int
 GNUNET_CONFIGURATION_get_value_string (struct GNUNET_CONFIGURATION_Handle
                                        *cfg, const char *section,
                                        const char *option, char **value)

Modified: gnunet/src/util/service.c
===================================================================
--- gnunet/src/util/service.c   2009-06-11 05:22:06 UTC (rev 8546)
+++ gnunet/src/util/service.c   2009-06-11 05:30:19 UTC (rev 8547)
@@ -754,7 +754,7 @@
 setup_service (struct GNUNET_SERVICE_Context *sctx)
 {
   unsigned long long maxbuf;
-  unsigned long long idleout;
+  struct GNUNET_TIME_Relative idleout;
   char *hostname;
   unsigned long long port;
   int disablev6;
@@ -768,12 +768,12 @@
                                        sctx->serviceName, "TIMEOUT"))
     {
       if (GNUNET_OK !=
-          GNUNET_CONFIGURATION_get_value_number (sctx->cfg,
-                                                 sctx->serviceName,
-                                                 "TIMEOUT", &idleout))
+          GNUNET_CONFIGURATION_get_value_time (sctx->cfg,
+                                              sctx->serviceName,
+                                              "TIMEOUT", &idleout))
         return GNUNET_SYSERR;
 
-      sctx->timeout.value = idleout;
+      sctx->timeout = idleout;
     }
   else
     sctx->timeout = GNUNET_TIME_UNIT_FOREVER_REL;





reply via email to

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