summaryrefslogtreecommitdiff
path: root/src/ext
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2016-04-13 11:10:36 -0400
committerNick Mathewson <nickm@torproject.org>2016-04-15 09:03:22 -0400
commitc77cf8825a33d902c5827f0b4f0a71cec97a3a85 (patch)
tree2e6daadd8704c779708b2f752099c7af870ecebb /src/ext
parent9d6c530015e4eefd7b333885eaeca1f9fcbc6578 (diff)
downloadtor-c77cf8825a33d902c5827f0b4f0a71cec97a3a85.tar.gz
tor-c77cf8825a33d902c5827f0b4f0a71cec97a3a85.zip
Quick function to find out the timeout object's view of "now"
Diffstat (limited to 'src/ext')
-rw-r--r--src/ext/timeouts/timeout.c3
-rw-r--r--src/ext/timeouts/timeout.h3
2 files changed, 6 insertions, 0 deletions
diff --git a/src/ext/timeouts/timeout.c b/src/ext/timeouts/timeout.c
index 70bc0eba0a..dbc24fa00a 100644
--- a/src/ext/timeouts/timeout.c
+++ b/src/ext/timeouts/timeout.c
@@ -467,6 +467,9 @@ TIMEOUT_PUBLIC void timeouts_update(struct timeouts *T, abstime_t curtime) {
return;
} /* timeouts_update() */
+TIMEOUT_PUBLIC timeout_t timeouts_get_curtime(struct timeouts *T) {
+ return T->curtime;
+} /* timeouts_get_curtime() */
TIMEOUT_PUBLIC void timeouts_step(struct timeouts *T, reltime_t elapsed) {
timeouts_update(T, T->curtime + elapsed);
diff --git a/src/ext/timeouts/timeout.h b/src/ext/timeouts/timeout.h
index 6d7359a6a2..3b08f19255 100644
--- a/src/ext/timeouts/timeout.h
+++ b/src/ext/timeouts/timeout.h
@@ -177,6 +177,9 @@ TIMEOUT_PUBLIC void timeouts_update(struct timeouts *, timeout_t);
TIMEOUT_PUBLIC void timeouts_step(struct timeouts *, timeout_t);
/* step timing wheel by relative time */
+TIMEOUT_PUBLIC timeout_t timeouts_get_curtime(struct timeouts *);
+/* Return the current tick. */
+
TIMEOUT_PUBLIC timeout_t timeouts_timeout(struct timeouts *);
/* return interval to next required update */