Commit 6443a756 authored by Steven Murdoch's avatar Steven Murdoch
Browse files

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
parents cc5b6d6c 850d8c9e
Loading
Loading
Loading
Loading

changes/bug3752

0 → 100644
+5 −0
Changes for changes/bug3752: 5 added lines, 0 removed lines.
Original line number Diff line number Diff line
  o Major bugfixes:
    - The IOCP backend now works even when the user has not specified
      the (internal, debbuging-only) _UseFilteringSSLBufferevents option.
      Fixes part of bug 3752; bugfix on 0.2.3.1-alpha.
+3 −1
Changes for configure.in: 3 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -325,6 +325,7 @@ dnl Where do you live, libevent? And how do we call you?

if test "$bwin32" = true; then
  TOR_LIB_WS32=-lws2_32
  TOR_LIB_IPHLPAPI=-liphlpapi
  # Some of the cargo-cults recommend -lwsock32 as well, but I don't
  # think it's actually necessary.
  TOR_LIB_GDI=-lgdi32
@@ -334,6 +335,7 @@ else
fi
AC_SUBST(TOR_LIB_WS32)
AC_SUBST(TOR_LIB_GDI)
AC_SUBST(TOR_LIB_IPHLPAPI)

dnl We need to do this before we try our disgusting hack below.
AC_CHECK_HEADERS([sys/types.h])
@@ -559,7 +561,7 @@ dnl There are no packages for Debian or Redhat as of this patch

if test "$upnp" = "true"; then
    AC_DEFINE(MINIUPNPC, 1, [Define to 1 if we are building with UPnP.])
    TOR_SEARCH_LIBRARY(libminiupnpc, $trylibminiupnpcdir, [-lminiupnpc -lws2_32 -liphlpapi],
    TOR_SEARCH_LIBRARY(libminiupnpc, $trylibminiupnpcdir, [-lminiupnpc $TOR_LIB_WS32 $TOR_LIB_IPHLPAPI],
        [#include <miniupnpc/miniwget.h>
         #include <miniupnpc/miniupnpc.h>
         #include <miniupnpc/upnpcommands.h>],
+11 −0
Changes for src/common/compat_libevent.c: 11 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -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 −0
Changes for src/common/compat_libevent.h: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -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
Changes for src/common/tortls.c: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -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.

Loading