mirror of
https://github.com/transmission/transmission
synced 2024-12-23 08:13:27 +00:00
(trunk) un-remove the conditional DHT compiling for now for reasons discussed @ http://lists.opensuse.org/opensuse-gnome/2009-08/msg00033.html. I'll re-remove it for 1.80. :)
This commit is contained in:
parent
9e2cbbe0a0
commit
e7a4ee9d82
4 changed files with 51 additions and 3 deletions
17
configure.ac
17
configure.ac
|
@ -203,8 +203,20 @@ dnl ----------------------------------------------------------------------------
|
|||
dnl
|
||||
dnl dht
|
||||
|
||||
DHT_CFLAGS="-I\$(top_srcdir)/third-party/dht"
|
||||
DHT_LIBS="\$(top_builddir)/third-party/dht/libdht.a"
|
||||
|
||||
AC_ARG_ENABLE([dht],
|
||||
AS_HELP_STRING([--disable-dht],[omit DHT support]),
|
||||
[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_LIBS)
|
||||
|
||||
|
@ -415,6 +427,7 @@ Configuration:
|
|||
Source code location: ${srcdir}
|
||||
Compiler: ${CXX}
|
||||
System or bundled libevent: ${libevent_source}
|
||||
DHT support: ${enable_dht}
|
||||
|
||||
Build Mac client: ${build_mac}
|
||||
Build GTK+ client: ${build_gtk}
|
||||
|
|
|
@ -880,7 +880,11 @@ tr_sessionInitImpl( void * vdata )
|
|||
|
||||
if( session->isDHTEnabled )
|
||||
{
|
||||
#ifdef WITHOUT_DHT
|
||||
tr_inf( "DHT disabled by packager." );
|
||||
#else
|
||||
tr_dhtInit( session, &session->public_ipv4->addr );
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1641,7 +1645,11 @@ tr_sessionIsPexEnabled( const tr_session * session )
|
|||
tr_bool
|
||||
tr_sessionAllowsDHT( const tr_session * session UNUSED )
|
||||
{
|
||||
#ifdef WITHOUT_DHT
|
||||
return 0;
|
||||
#else
|
||||
return tr_sessionIsDHTEnabled( session );
|
||||
#endif
|
||||
}
|
||||
|
||||
tr_bool
|
||||
|
|
|
@ -50,6 +50,25 @@ THE SOFTWARE.
|
|||
#include "utils.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 ) { 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,
|
||||
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 struct event dht_event;
|
||||
static tr_port dht_port;
|
||||
|
@ -439,3 +458,5 @@ dht_random_bytes( void * buf, size_t size )
|
|||
tr_cryptoRandBuf( buf, size );
|
||||
return size;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
8
third-party/Makefile.am
vendored
8
third-party/Makefile.am
vendored
|
@ -1,4 +1,10 @@
|
|||
SUBDIRS = libnatpmp miniupnp libevent dht
|
||||
if DHT
|
||||
DHT_DIR = dht
|
||||
else
|
||||
DHT_DIR =
|
||||
endif
|
||||
|
||||
SUBDIRS = libnatpmp miniupnp libevent $(DHT_DIR)
|
||||
|
||||
EXTRA_DIST = \
|
||||
macosx-libevent-config.h \
|
||||
|
|
Loading…
Reference in a new issue