aboutsummaryrefslogtreecommitdiff
path: root/src/or
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2016-06-21 08:54:49 -0400
committerNick Mathewson <nickm@torproject.org>2016-06-21 08:54:49 -0400
commitdd9cebf1099996d3361110fddfc2cf47beb94c5d (patch)
tree0253138022d8626d909ec1077000d066bc81b659 /src/or
parent49e8f47505a64f46981e3caa8c167594ae6936ff (diff)
parentf038e9cb00b9324b24a100d7cd3576410a7ae7f3 (diff)
downloadtor-dd9cebf1099996d3361110fddfc2cf47beb94c5d.tar.gz
tor-dd9cebf1099996d3361110fddfc2cf47beb94c5d.zip
Merge branch 'maint-0.2.8'
Diffstat (limited to 'src/or')
-rw-r--r--src/or/main.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/or/main.c b/src/or/main.c
index 9f3306dc4f..4de2e70a1d 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -2004,18 +2004,24 @@ check_fw_helper_app_callback(time_t now, const or_options_t *options)
return PORT_FORWARDING_CHECK_INTERVAL;
}
+/** Callback to write heartbeat message in the logs. */
static int
heartbeat_callback(time_t now, const or_options_t *options)
{
static int first = 1;
- /* 12. write the heartbeat message */
+
+ /* Check if heartbeat is disabled */
+ if (!options->HeartbeatPeriod) {
+ return PERIODIC_EVENT_NO_UPDATE;
+ }
+
+ /* Write the heartbeat message */
if (first) {
first = 0; /* Skip the first one. */
} else {
log_heartbeat(now);
}
- /* XXXX This isn't such a good way to handle possible changes in the
- * callback event */
+
return options->HeartbeatPeriod;
}