(trunk) #2222: revert r8967, as foreshadowed in http://trac.transmissionbt.com/ticket/2222#comment:20
This commit is contained in:
parent
e4f1abfe5f
commit
06004319d7
15
configure.ac
15
configure.ac
|
@ -208,19 +208,8 @@ dnl
|
||||||
dnl dht
|
dnl dht
|
||||||
|
|
||||||
|
|
||||||
AC_ARG_ENABLE([dht],
|
DHT_CFLAGS="-I\$(top_srcdir)/third-party/dht"
|
||||||
AS_HELP_STRING([--disable-dht],[omit DHT support]),
|
DHT_LIBS="\$(top_builddir)/third-party/dht/libdht.a"
|
||||||
[enable_dht=${enableval}],
|
|
||||||
[enable_dht=yes])
|
|
||||||
if test "x$enable_dht" = "xno" ; then
|
|
||||||
AC_DEFINE([WITHOUT_DHT], 1)
|
|
||||||
DHT_CFLAGS=""
|
|
||||||
DHT_LIBS=""
|
|
||||||
else
|
|
||||||
DHT_CFLAGS="-I\$(top_srcdir)/third-party/dht"
|
|
||||||
DHT_LIBS="\$(top_builddir)/third-party/dht/libdht.a"
|
|
||||||
fi
|
|
||||||
AM_CONDITIONAL(DHT, test "x$enable_dht" = "xyes")
|
|
||||||
AC_SUBST(DHT_CFLAGS)
|
AC_SUBST(DHT_CFLAGS)
|
||||||
AC_SUBST(DHT_LIBS)
|
AC_SUBST(DHT_LIBS)
|
||||||
|
|
||||||
|
|
|
@ -540,13 +540,11 @@ privacyPage( GObject * core )
|
||||||
gtr_widget_set_tooltip_text( w, s );
|
gtr_widget_set_tooltip_text( w, s );
|
||||||
hig_workarea_add_wide_control( t, &row, w );
|
hig_workarea_add_wide_control( t, &row, w );
|
||||||
|
|
||||||
#ifndef WITHOUT_DHT
|
|
||||||
s = _( "Use _DHT to find more peers" );
|
s = _( "Use _DHT to find more peers" );
|
||||||
w = new_check_button( s, TR_PREFS_KEY_DHT_ENABLED, core );
|
w = new_check_button( s, TR_PREFS_KEY_DHT_ENABLED, core );
|
||||||
s = _( "DHT is a tool for finding peers without a tracker." );
|
s = _( "DHT is a tool for finding peers without a tracker." );
|
||||||
gtr_widget_set_tooltip_text( w, s );
|
gtr_widget_set_tooltip_text( w, s );
|
||||||
hig_workarea_add_wide_control( t, &row, w );
|
hig_workarea_add_wide_control( t, &row, w );
|
||||||
#endif
|
|
||||||
|
|
||||||
hig_workarea_finish( t, &row );
|
hig_workarea_finish( t, &row );
|
||||||
g_object_weak_ref( G_OBJECT( t ), privacyPageDestroyed, data );
|
g_object_weak_ref( G_OBJECT( t ), privacyPageDestroyed, data );
|
||||||
|
|
|
@ -700,11 +700,7 @@ tr_sessionInitImpl( void * vdata )
|
||||||
|
|
||||||
if( session->isDHTEnabled )
|
if( session->isDHTEnabled )
|
||||||
{
|
{
|
||||||
#ifdef WITHOUT_DHT
|
|
||||||
tr_inf( "DHT disabled by packager." );
|
|
||||||
#else
|
|
||||||
tr_dhtInit( session, &session->public_ipv4->addr );
|
tr_dhtInit( session, &session->public_ipv4->addr );
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* cleanup */
|
/* cleanup */
|
||||||
|
@ -1704,11 +1700,7 @@ tr_sessionIsPexEnabled( const tr_session * session )
|
||||||
tr_bool
|
tr_bool
|
||||||
tr_sessionAllowsDHT( const tr_session * session UNUSED )
|
tr_sessionAllowsDHT( const tr_session * session UNUSED )
|
||||||
{
|
{
|
||||||
#ifdef WITHOUT_DHT
|
|
||||||
return 0;
|
|
||||||
#else
|
|
||||||
return tr_sessionIsDHTEnabled( session );
|
return tr_sessionIsDHTEnabled( session );
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
tr_bool
|
tr_bool
|
||||||
|
|
|
@ -50,35 +50,6 @@ THE SOFTWARE.
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
#include "version.h"
|
#include "version.h"
|
||||||
|
|
||||||
#ifdef WITHOUT_DHT
|
|
||||||
|
|
||||||
/**
|
|
||||||
*** These are the stubs for when we're building without DHT support
|
|
||||||
**/
|
|
||||||
|
|
||||||
int tr_dhtInit( tr_session * session UNUSED,
|
|
||||||
tr_address * address UNUSED ) { return TR_DHT_STOPPED; }
|
|
||||||
|
|
||||||
void tr_dhtUninit( tr_session * session UNUSED ) { }
|
|
||||||
|
|
||||||
tr_bool tr_dhtEnabled( const tr_session * session UNUSED ) { return FALSE; }
|
|
||||||
|
|
||||||
tr_port tr_dhtPort ( const tr_session * sesssion UNUSED ) { return 0; }
|
|
||||||
|
|
||||||
int tr_dhtStatus( tr_session * session UNUSED,
|
|
||||||
int * setmeCount UNUSED ) { return TR_DHT_STOPPED; }
|
|
||||||
|
|
||||||
int tr_dhtAddNode( tr_session * session UNUSED,
|
|
||||||
const tr_address * addr UNUSED,
|
|
||||||
tr_port port UNUSED,
|
|
||||||
tr_bool bootstrap UNUSED ) { return 0; }
|
|
||||||
|
|
||||||
int tr_dhtAnnounce( tr_torrent * session UNUSED,
|
|
||||||
tr_bool announce UNUSED ) { return -1; }
|
|
||||||
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
static int dht_socket;
|
static int dht_socket;
|
||||||
static struct event dht_event;
|
static struct event dht_event;
|
||||||
static tr_port dht_port;
|
static tr_port dht_port;
|
||||||
|
@ -470,5 +441,3 @@ dht_random_bytes( void * buf, size_t size )
|
||||||
tr_cryptoRandBuf( buf, size );
|
tr_cryptoRandBuf( buf, size );
|
||||||
return size;
|
return size;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
|
@ -1,10 +1,4 @@
|
||||||
if DHT
|
SUBDIRS = libnatpmp miniupnp libevent dht
|
||||||
DHT_DIR = dht
|
|
||||||
else
|
|
||||||
DHT_DIR =
|
|
||||||
endif
|
|
||||||
|
|
||||||
SUBDIRS = libnatpmp miniupnp libevent $(DHT_DIR)
|
|
||||||
|
|
||||||
EXTRA_DIST = \
|
EXTRA_DIST = \
|
||||||
macosx-libevent-config.h \
|
macosx-libevent-config.h \
|
||||||
|
|
Loading…
Reference in New Issue