aboutsummaryrefslogtreecommitdiff
path: root/src/or/status.c
diff options
context:
space:
mode:
authorSebastian Hahn <sebastian@torproject.org>2010-12-01 03:24:03 +0200
committerNick Mathewson <nickm@torproject.org>2011-02-22 12:40:36 -0500
commit098b6ba72d636cf00cfa091e745c25a649fba493 (patch)
tree76d4890c31b79fc686d1d79f6440b11d88a9adbc /src/or/status.c
parent0ba69714b4c51bfddcce16b7e1b309fad4e3e3bc (diff)
downloadtor-098b6ba72d636cf00cfa091e745c25a649fba493.tar.gz
tor-098b6ba72d636cf00cfa091e745c25a649fba493.zip
Initial heartbeat subsystem commit.
Sets: * Documentation * Logging domain * Configuration option * Scheduled event * Makefile It also creates status.c and the log_heartbeat() function. All code was written by Sebastian Hahn. Commit message was written by me (George Kadianakis).
Diffstat (limited to 'src/or/status.c')
-rw-r--r--src/or/status.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/or/status.c b/src/or/status.c
new file mode 100644
index 0000000000..0cd9a07226
--- /dev/null
+++ b/src/or/status.c
@@ -0,0 +1,27 @@
+/* Copyright (c) 2010, The Tor Project, Inc. */
+/* See LICENSE for licensing information */
+
+/**
+ * \file status.c
+ * \brief Keep status information and log the heartbeat messages.
+ **/
+
+#include "or.h"
+
+
+/****************************************************************************/
+
+
+
+#define BEAT(x) log_fn(LOG_NOTICE, LD_HEARTBEAT, (x) )
+
+void
+log_heartbeat(time_t now) {
+ or_options_t *opt = get_options();
+
+ (void) now;
+ log_fn(LOG_NOTICE, LD_HEARTBEAT, "This is the Tor heartbeat message.");
+ if (!server_mode(opt))
+ BEAT("you are a client, hahaha");
+
+}