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:
Steven Murdoch
2011-08-22 17:53:17 +01:00
10 changed files with 35 additions and 11 deletions
+11
View File
@@ -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
+1
View File
@@ -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
View File
@@ -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.