mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-12-06 19:41:15 +01:00
Merge branch 'bug1983-port-tor-fw-helper-to-windows' into bug2046
Conflicts: configure.in src/tools/tor-fw-helper/Makefile.am src/tools/tor-fw-helper/tor-fw-helper-upnp.c src/tools/tor-fw-helper/tor-fw-helper.c
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -73,6 +73,7 @@ const char *tor_libevent_get_version_str(void);
|
||||
#ifdef USE_BUFFEREVENTS
|
||||
#define TOR_LIBEVENT_TICKS_PER_SECOND 3
|
||||
const struct timeval *tor_libevent_get_one_tick_timeout(void);
|
||||
int tor_libevent_using_iocp_bufferevents(void);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
+1
-1
@@ -1892,7 +1892,7 @@ tor_tls_init_bufferevent(tor_tls_t *tls, struct bufferevent *bufev_in,
|
||||
const enum bufferevent_ssl_state state = receiving ?
|
||||
BUFFEREVENT_SSL_ACCEPTING : BUFFEREVENT_SSL_CONNECTING;
|
||||
|
||||
if (filter) {
|
||||
if (filter || tor_libevent_using_iocp_bufferevents()) {
|
||||
/* Grab an extra reference to the SSL, since BEV_OPT_CLOSE_ON_FREE
|
||||
means that the SSL will get freed too.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user