[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor/master] Quick function to find out the timeout object's view of "now"



commit c77cf8825a33d902c5827f0b4f0a71cec97a3a85
Author: Nick Mathewson <nickm@xxxxxxxxxxxxxx>
Date:   Wed Apr 13 11:10:36 2016 -0400

    Quick function to find out the timeout object's view of "now"
---
 src/ext/timeouts/timeout.c | 3 +++
 src/ext/timeouts/timeout.h | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/src/ext/timeouts/timeout.c b/src/ext/timeouts/timeout.c
index 70bc0eb..dbc24fa 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 6d7359a..3b08f19 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 */
 



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits