-document clock skew variable a bit more
authorChristian Grothoff <christian@grothoff.org>
Mon, 28 Nov 2011 15:21:02 +0000 (15:21 +0000)
committerChristian Grothoff <christian@grothoff.org>
Mon, 28 Nov 2011 15:21:02 +0000 (15:21 +0000)
src/util/service.c
src/util/time.c

index cf1002ca9e40df2253f2814bf27598aec13cc5b2..b5711972bfaaadeac03baab86bf25adf32be0823 100644 (file)
@@ -1566,17 +1566,17 @@ GNUNET_SERVICE_run (int argc, char *const *argv, const char *serviceName,
   LOG (GNUNET_ERROR_TYPE_DEBUG,
        "Service `%s' runs with configuration from `%s'\n", serviceName, cfg_fn);
 #endif
-  if (GNUNET_OK ==
-      GNUNET_CONFIGURATION_get_value_number (sctx.cfg, "testing", "skew_offset",
-                                             &skew_offset) &&
-      (GNUNET_OK ==
-       GNUNET_CONFIGURATION_get_value_number (sctx.cfg, "testing",
-                                              "skew_variance", &skew_variance)))
+  if ( (GNUNET_OK ==
+       GNUNET_CONFIGURATION_get_value_number (sctx.cfg, "TESTING", "SKEW_OFFSET",
+                                              &skew_offset)) &&
+       (GNUNET_OK ==
+       GNUNET_CONFIGURATION_get_value_number (sctx.cfg, "TESTING",
+                                              "SKEW_VARIANCE", &skew_variance)) )
   {
     clock_offset = skew_offset - skew_variance;
     GNUNET_TIME_set_offset (clock_offset);
 #if DEBUG_SERVICE
-    LOG (GNUNET_ERROR_TYPE_DEBUG, "Skewing clock by %dll\n", clock_offset);
+    LOG (GNUNET_ERROR_TYPE_DEBUG, "Skewing clock by %dll ms\n", clock_offset);
 #endif
   }
   /* actually run service */
index 3ee15516a165185dc8717ba71cee00358f9e6f9d..c57ccd1e224c0e464259e2e64664756975db15cd 100644 (file)
@@ -28,6 +28,9 @@
 
 #define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
 
+/**
+ * Variable used to simulate clock skew.  Used for testing, never in production.
+ */
 static long long timestamp_offset;
 
 /**