From d9e4ddab1f8b798e711bb2e57ad6b52c1eb70bde Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Thu, 22 Oct 2009 01:03:17 +0000 Subject: [PATCH] (trunk libT) #2510: port messages not sent for outgoing peer connections --- libtransmission/handshake.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/libtransmission/handshake.c b/libtransmission/handshake.c index 15c6bd03e..bb1a0fb2c 100644 --- a/libtransmission/handshake.c +++ b/libtransmission/handshake.c @@ -312,7 +312,8 @@ parseHandshake( tr_handshake * handshake, tr_peerIoEnableFEXT( handshake->io, HANDSHAKE_HAS_FASTEXT( reserved ) ); - /* This doesn't depend on whether the torrent is private. */ + /* This is independent of whether or not DHT is actually used. + * it's okay to set this flag even for private torrents */ if( tor && tr_sessionAllowsDHT( tor->session ) ) tr_peerIoEnableDHT( handshake->io, HANDSHAKE_HAS_DHT( reserved ) ); @@ -674,6 +675,11 @@ readHandshake( tr_handshake * handshake, tr_peerIoEnableFEXT( handshake->io, HANDSHAKE_HAS_FASTEXT( reserved ) ); + /* This is independent of whether or not DHT is actually used. + * it's okay to set this flag even for private torrents */ + if( tr_sessionAllowsDHT( handshake->session ) ) + tr_peerIoEnableDHT( handshake->io, HANDSHAKE_HAS_DHT( reserved ) ); + /* torrent hash */ tr_peerIoReadBytes( handshake->io, inbuf, hash, sizeof( hash ) ); if( tr_peerIoIsIncoming( handshake->io ) )