From d3653063d30ee8174f6ec330124553c6717fbe9c Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Thu, 18 Aug 2011 15:08:49 -0400 Subject: Automatically use filtering bufferevents with IOCP. --- src/common/compat_libevent.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/common/compat_libevent.c') diff --git a/src/common/compat_libevent.c b/src/common/compat_libevent.c index 8752de749..595742f96 100644 --- a/src/common/compat_libevent.c +++ b/src/common/compat_libevent.c @@ -164,6 +164,16 @@ struct event_base *the_event_base = NULL; #endif #endif +#ifdef USE_BUFFEREVENTS +static int using_iocp_bufferevents = 0; + +int +tor_libevent_using_iocp_bufferevents(void) +{ + return using_iocp_bufferevents; +} +#endif + /** Initialize the Libevent library and set up the event base. */ void tor_libevent_initialize(tor_libevent_cfg *torcfg) @@ -187,6 +197,7 @@ tor_libevent_initialize(tor_libevent_cfg *torcfg) if (! torcfg->disable_iocp) { evthread_use_windows_threads(); event_config_set_flag(cfg, EVENT_BASE_FLAG_STARTUP_IOCP); + using_iocp_bufferevents = 1; } #endif -- cgit v1.2.3