aboutsummaryrefslogtreecommitdiff
path: root/src/common/compat_libevent.c
diff options
context:
space:
mode:
authorGeorge Kadianakis <desnacked@gmail.com>2011-11-13 14:47:11 +0100
committerGeorge Kadianakis <desnacked@gmail.com>2011-11-13 14:47:11 +0100
commit406ae1ba5ad529a4d0e710229dab6ed645d42b50 (patch)
tree2bd05b7af82b902151643881f383df4ed6faed67 /src/common/compat_libevent.c
parente097bffaed72af6b19f7293722021196bb94de1e (diff)
downloadtor-406ae1ba5ad529a4d0e710229dab6ed645d42b50.tar
tor-406ae1ba5ad529a4d0e710229dab6ed645d42b50.tar.gz
Use callback-driven approach to block renegotiations.
Also use this new approach in the bufferevents-enabled case.
Diffstat (limited to 'src/common/compat_libevent.c')
-rw-r--r--src/common/compat_libevent.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/common/compat_libevent.c b/src/common/compat_libevent.c
index 320173870..ea7f5d1bb 100644
--- a/src/common/compat_libevent.c
+++ b/src/common/compat_libevent.c
@@ -518,6 +518,15 @@ tor_check_libevent_header_compatibility(void)
#endif
}
+/** Wrapper around libevent's event_base_once(). Sets a
+ * timeout-triggered event with no associated file descriptor. */
+int
+tor_event_base_once(void (*cb)(evutil_socket_t, short, void *),
+ void *arg, struct timeval *timer)
+{
+ return event_base_once(tor_libevent_get_base(), -1, EV_TIMEOUT, cb, arg, timer);
+}
+
/*
If possible, we're going to try to use Libevent's periodic timer support,
since it does a pretty good job of making sure that periodic events get