aboutsummaryrefslogtreecommitdiff
path: root/src/util/service.c
diff options
context:
space:
mode:
authorNathan S. Evans <evans@in.tum.de>2011-07-25 12:36:16 +0000
committerNathan S. Evans <evans@in.tum.de>2011-07-25 12:36:16 +0000
commit70a2b635b7107f7554e9ae5c4f3262ee6eaacb83 (patch)
tree6773092c3053281f383ec6555e8757bf9387d515 /src/util/service.c
parent00b0f3c22aab316068326a26f89219eddc7f6ef9 (diff)
downloadgnunet-70a2b635b7107f7554e9ae5c4f3262ee6eaacb83.tar.gz
gnunet-70a2b635b7107f7554e9ae5c4f3262ee6eaacb83.zip
clockskew code
Diffstat (limited to 'src/util/service.c')
-rw-r--r--src/util/service.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/util/service.c b/src/util/service.c
index 227593b84..abf3b2ab1 100644
--- a/src/util/service.c
+++ b/src/util/service.c
@@ -1577,6 +1577,9 @@ GNUNET_SERVICE_run (int argc,
1577 char *logfile; 1577 char *logfile;
1578 int do_daemonize; 1578 int do_daemonize;
1579 unsigned int i; 1579 unsigned int i;
1580 unsigned long long skew_offset;
1581 unsigned long long skew_variance;
1582 long long clock_offset;
1580 struct GNUNET_SERVICE_Context sctx; 1583 struct GNUNET_SERVICE_Context sctx;
1581 struct GNUNET_CONFIGURATION_Handle *cfg; 1584 struct GNUNET_CONFIGURATION_Handle *cfg;
1582 struct GNUNET_GETOPT_CommandLineOption service_options[] = { 1585 struct GNUNET_GETOPT_CommandLineOption service_options[] = {
@@ -1623,6 +1626,14 @@ GNUNET_SERVICE_run (int argc,
1623 "Service `%s' runs with configuration from `%s'\n", 1626 "Service `%s' runs with configuration from `%s'\n",
1624 serviceName, cfg_fn); 1627 serviceName, cfg_fn);
1625#endif 1628#endif
1629 if (GNUNET_OK == GNUNET_CONFIGURATION_get_value_number(sctx.cfg, "testing", "skew_offset", &skew_offset) &&
1630 (GNUNET_OK == GNUNET_CONFIGURATION_get_value_number(sctx.cfg, "testing", "skew_variance", &skew_variance)))
1631 {
1632 clock_offset = skew_offset - skew_variance;
1633#if 1
1634 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Skewing clock by %ll\n", clock_offset);
1635#endif
1636 }
1626 /* actually run service */ 1637 /* actually run service */
1627 GNUNET_SCHEDULER_run (&service_task, &sctx); 1638 GNUNET_SCHEDULER_run (&service_task, &sctx);
1628 1639