1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-24 08:43:27 +00:00

Propagate uTP and ut_holepunch information over PEX.

This commit is contained in:
Juliusz Chroboczek 2011-02-18 00:24:48 +00:00
parent 5a2710c9da
commit 130006fcb1
2 changed files with 11 additions and 0 deletions

View file

@ -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",

View file

@ -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) */