aboutsummaryrefslogtreecommitdiff
path: root/src/common/util.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2010-10-15 11:16:42 -0400
committerNick Mathewson <nickm@torproject.org>2010-10-15 11:16:42 -0400
commita5289fa79442896b87c2f5dd59eed4289f99c5e4 (patch)
treea1d2df8fea4fee5e35e28cfe04c39fc17177a42f /src/common/util.h
parentadc4f678f17096a1d2a2c693c3364f065a708d6f (diff)
downloadtor-a5289fa79442896b87c2f5dd59eed4289f99c5e4.tar
tor-a5289fa79442896b87c2f5dd59eed4289f99c5e4.tar.gz
Remove the unused old fuzzy-time code
Diffstat (limited to 'src/common/util.h')
-rw-r--r--src/common/util.h24
1 files changed, 16 insertions, 8 deletions
diff --git a/src/common/util.h b/src/common/util.h
index 8c2a9be32..633c613d4 100644
--- a/src/common/util.h
+++ b/src/common/util.h
@@ -248,14 +248,22 @@ void update_approx_time(time_t now);
#endif
/* Fuzzy time. */
-void ftime_set_maximum_sloppiness(int seconds);
-void ftime_set_estimated_skew(int seconds);
-/* typedef struct ftime_t { time_t earliest; time_t latest; } ftime_t; */
-/* void ftime_get_window(time_t now, ftime_t *ft_out); */
-int ftime_maybe_after(time_t now, time_t when);
-int ftime_maybe_before(time_t now, time_t when);
-int ftime_definitely_after(time_t now, time_t when);
-int ftime_definitely_before(time_t now, time_t when);
+
+/** Return true iff <a>a</b> is definitely after <b>b</b>, even if there
+ * could be up to <b>allow_seconds</b> of skew in one of them. */
+static INLINE int
+time_definitely_after(time_t a, time_t b, int allow_skew)
+{
+ return a-allow_skew > b;
+}
+
+/** Return true iff <a>a</b> is definitely before <b>b</b>, even if there
+ * could be up to <b>allow_seconds</b> of skew in one of them. */
+static INLINE int
+time_definitely_before(time_t a, time_t b, int allow_skew)
+{
+ return a+allow_skew < b;
+}
/* Rate-limiter */