diff options
author | Nick Mathewson <nickm@torproject.org> | 2011-08-18 15:08:49 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2011-08-18 15:16:05 -0400 |
commit | d3653063d30ee8174f6ec330124553c6717fbe9c (patch) | |
tree | 8b79ef5db5ab4b85cf5296f26836b21b7210db3e /src/common/compat_libevent.c | |
parent | 52e36feda153e70cd08d624df73035b7e59a95ef (diff) | |
download | tor-d3653063d30ee8174f6ec330124553c6717fbe9c.tar.gz tor-d3653063d30ee8174f6ec330124553c6717fbe9c.zip |
Automatically use filtering bufferevents with IOCP.
Diffstat (limited to 'src/common/compat_libevent.c')
-rw-r--r-- | src/common/compat_libevent.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/common/compat_libevent.c b/src/common/compat_libevent.c index 8752de7492..595742f961 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 |