diff options
author | Nick Mathewson <nickm@torproject.org> | 2011-11-29 17:06:09 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2011-11-29 17:08:29 -0500 |
commit | aba25a6939a5907d40dbcff7433a8c130ffd12ad (patch) | |
tree | 5182d775e7e9e2fb1dea57d861cce7a22a7486db /src/common/compat_libevent.h | |
parent | b5a306e82c684bdd30b832fdfd9e2b55c06b54ae (diff) | |
download | tor-aba25a6939a5907d40dbcff7433a8c130ffd12ad.tar.gz tor-aba25a6939a5907d40dbcff7433a8c130ffd12ad.zip |
Make pending libevent actions cancelable
This avoids a dangling pointer issue in the 3412 code, and should
fix bug 4599.
Diffstat (limited to 'src/common/compat_libevent.h')
-rw-r--r-- | src/common/compat_libevent.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/common/compat_libevent.h b/src/common/compat_libevent.h index 3f916d16b0..4076cc0e08 100644 --- a/src/common/compat_libevent.h +++ b/src/common/compat_libevent.h @@ -44,10 +44,12 @@ void tor_event_free(struct event *ev); #define tor_evdns_add_server_port evdns_add_server_port #endif -typedef struct periodic_timer_t periodic_timer_t; - -int tor_run_in_libevent_loop(void (*cb)(void *arg), void *arg); +typedef struct tor_libevent_action_t tor_libevent_action_t; +tor_libevent_action_t *tor_run_in_libevent_loop(void (*cb)(void *arg), + void *arg); +void tor_cancel_libevent_action(tor_libevent_action_t *action); +typedef struct periodic_timer_t periodic_timer_t; periodic_timer_t *periodic_timer_new(struct event_base *base, const struct timeval *tv, void (*cb)(periodic_timer_t *timer, void *data), |