Implement atom->utp_failed and peerMgrSetUpFailed.

This commit is contained in:
Juliusz Chroboczek 2011-02-18 00:43:31 +00:00
parent 5ba2e40f79
commit 704f984bdf
2 changed files with 14 additions and 0 deletions

View File

@ -132,6 +132,7 @@ struct peer_atom
int8_t blocklisted; /* -1 for unknown, TRUE for blocklisted, FALSE for not blocklisted */
tr_port port;
tr_bool utp_failed; /* We recently failed to connect over uTP */
uint16_t numFails;
time_t time; /* when the peer's connection status last changed */
time_t piece_data_time;
@ -680,6 +681,15 @@ tr_peerMgrSetUtpSupported( tr_torrent * tor, const tr_address * addr )
atom->flags |= ADDED_F_UTP_FLAGS;
}
void
tr_peerMgrSetUtpFailed( tr_torrent *tor, const tr_address *addr, tr_bool failed )
{
struct peer_atom * atom = getExistingAtom( tor->torrentPeers, addr );
if( atom )
atom->utp_failed = failed;
}
/**
*** REQUESTS

View File

@ -152,6 +152,10 @@ tr_bool tr_peerMgrPeerIsSeed( const tr_torrent * tor,
void tr_peerMgrSetUtpSupported( tr_torrent * tor,
const tr_address * addr );
void tr_peerMgrSetUtpFailed( tr_torrent *tor,
const tr_address *addr,
tr_bool failed );
void tr_peerMgrGetNextRequests( tr_torrent * torrent,
tr_peer * peer,
int numwant,