From: Juliusz Chroboczek Date: Fri, 18 Feb 2011 00:24:48 +0000 (+0000) Subject: Propagate uTP and ut_holepunch information over PEX. X-Git-Tag: 2.30b1~336 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=130006fcb1e992d6f247cbe29b00c8de1dde0688;p=transmission Propagate uTP and ut_holepunch information over PEX. --- diff --git a/libtransmission/peer-mgr.c b/libtransmission/peer-mgr.c index 8394dd205..5051e07a7 100644 --- a/libtransmission/peer-mgr.c +++ b/libtransmission/peer-mgr.c @@ -1958,6 +1958,11 @@ myHandshakeDoneCB( tr_handshake * handshake, atom->flags2 &= ~MYFLAG_UNREACHABLE; } + /* In principle, this flag specifies whether the peer groks uTP, + not whether it's currently connected over uTP. */ + if( io->utp_socket ) + atom->flags |= ADDED_F_UTP_FLAGS; + if( atom->flags2 & MYFLAG_BANNED ) { tordbg( t, "banned peer %s tried to reconnect", diff --git a/libtransmission/peer-msgs.c b/libtransmission/peer-msgs.c index 826682bc4..73cbb9012 100644 --- a/libtransmission/peer-msgs.c +++ b/libtransmission/peer-msgs.c @@ -939,6 +939,12 @@ parseLtepHandshake( tr_peermsgs * msgs, msgs->ut_metadata_id = (uint8_t) i; dbgmsg( msgs, "msgs->ut_metadata_id is %d", (int)msgs->ut_metadata_id ); } + /* We don't support ut_holepunch yet, but we might as well + propagate this information over PEX. */ + if( tr_bencDictFindInt( sub, "ut_holepunch", &i ) ) { + if( i != 0 ) + pex.flags |= ADDED_F_HOLEPUNCH; + } } /* look for metainfo size (BEP 9) */