-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtr-dht.c.patch
27 lines (26 loc) · 987 Bytes
/
tr-dht.c.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
diff --git a/libtransmission/tr-dht.c b/libtransmission/tr-dht.c
index 42bb127..f6ee9b1 100644
--- a/libtransmission/tr-dht.c
+++ b/libtransmission/tr-dht.c
@@ -274,6 +274,7 @@ tr_dhtInit(tr_session *ss)
int rc;
bool have_id = false;
char * dat_file;
+ char * block_this_port;
uint8_t * nodes = NULL, * nodes6 = NULL;
const uint8_t * raw;
size_t len, len6;
@@ -287,6 +288,13 @@ tr_dhtInit(tr_session *ss)
if( getenv( "TR_DHT_VERBOSE" ) != NULL )
dht_debug = stderr;
+ if( getenv( "TR_DHT_PORT_FILTER" ) != NULL )
+ port_filter = stderr;
+
+ block_this_port = getenv( "TR_DHT_BLOCK_THIS_PORT" );
+ if( block_this_port != NULL ) blocked_port = strtol( block_this_port, NULL, 0 );
+ else blocked_port = 0;
+
dat_file = tr_buildPath( ss->configDir, "dht.dat", NULL );
rc = tr_bencLoadFile( &benc, TR_FMT_BENC, dat_file );
tr_free( dat_file );
warning: LF will be replaced by CRLF in libtransmission/tr-dht.c