1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2025-02-22 22:20:39 +00:00

Don't attempt uTP connexions to peers learned from PEX that didn't signal support.

This commit is contained in:
Juliusz Chroboczek 2011-02-18 00:43:49 +00:00
parent 5af8e26251
commit 828c9888b0

View file

@ -3853,6 +3853,12 @@ initiateConnection( tr_peerMgr * mgr, Torrent * t, struct peer_atom * atom )
const time_t now = tr_time( ); const time_t now = tr_time( );
tr_bool utp = tr_sessionIsUTPEnabled(mgr->session) && !atom->utp_failed; tr_bool utp = tr_sessionIsUTPEnabled(mgr->session) && !atom->utp_failed;
if( atom->fromFirst == TR_PEER_FROM_PEX )
/* PEX has explicit signalling for uTP support. If an atom
originally came from PEX and doesn't have the uTP flag, skip the
uTP connection attempt. Are we being optimistic here? */
utp = utp && (atom->flags & ADDED_F_UTP_FLAGS);
tordbg( t, "Starting an OUTGOING%s connection with %s", tordbg( t, "Starting an OUTGOING%s connection with %s",
utp ? " µTP" : "", utp ? " µTP" : "",
tr_atomAddrStr( atom ) ); tr_atomAddrStr( atom ) );