]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Fix fencepost error with HearbeatPeriod option
authorSebastian Hahn <sebastian@torproject.org>
Sun, 22 Jan 2012 12:39:56 +0000 (13:39 +0100)
committerRoger Dingledine <arma@torproject.org>
Wed, 8 Feb 2012 09:44:15 +0000 (04:44 -0500)
We'd only log every HeartbeatPeriod + 1 seconds. Discovered by Scott
Bennett, reported as bug 4942.

changes/bug4942 [new file with mode: 0644]
src/or/main.c

diff --git a/changes/bug4942 b/changes/bug4942
new file mode 100644 (file)
index 0000000..012d105
--- /dev/null
@@ -0,0 +1,5 @@
+  o Minor bugfixes:
+    - Actually log the heartbeat message every HeartbeatPeriod seconds, not
+      every HeartbeatPeriod + 1 seconds. Fixes bug 4942; bugfix on
+      0.2.3.1-alpha.. Bug reported by Scott Bennett.
+
index 7ef14aaa76c17b9c4e40ba9330321e7de55aa435..9022f2eb877456949ee93670fe2ffe1ad7977709 100644 (file)
@@ -1533,7 +1533,7 @@ run_scheduled_events(time_t now)
 
   /** 12. write the heartbeat message */
   if (options->HeartbeatPeriod &&
-      time_to_next_heartbeat < now) {
+      time_to_next_heartbeat <= now) {
     log_heartbeat(now);
     time_to_next_heartbeat = now+options->HeartbeatPeriod;
   }