Implement atom->utp_failed and peerMgrSetUpFailed.
This commit is contained in:
parent
5ba2e40f79
commit
704f984bdf
|
@ -132,6 +132,7 @@ struct peer_atom
|
||||||
int8_t blocklisted; /* -1 for unknown, TRUE for blocklisted, FALSE for not blocklisted */
|
int8_t blocklisted; /* -1 for unknown, TRUE for blocklisted, FALSE for not blocklisted */
|
||||||
|
|
||||||
tr_port port;
|
tr_port port;
|
||||||
|
tr_bool utp_failed; /* We recently failed to connect over uTP */
|
||||||
uint16_t numFails;
|
uint16_t numFails;
|
||||||
time_t time; /* when the peer's connection status last changed */
|
time_t time; /* when the peer's connection status last changed */
|
||||||
time_t piece_data_time;
|
time_t piece_data_time;
|
||||||
|
@ -680,6 +681,15 @@ tr_peerMgrSetUtpSupported( tr_torrent * tor, const tr_address * addr )
|
||||||
atom->flags |= ADDED_F_UTP_FLAGS;
|
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
|
*** REQUESTS
|
||||||
|
|
|
@ -152,6 +152,10 @@ tr_bool tr_peerMgrPeerIsSeed( const tr_torrent * tor,
|
||||||
void tr_peerMgrSetUtpSupported( tr_torrent * tor,
|
void tr_peerMgrSetUtpSupported( tr_torrent * tor,
|
||||||
const tr_address * addr );
|
const tr_address * addr );
|
||||||
|
|
||||||
|
void tr_peerMgrSetUtpFailed( tr_torrent *tor,
|
||||||
|
const tr_address *addr,
|
||||||
|
tr_bool failed );
|
||||||
|
|
||||||
void tr_peerMgrGetNextRequests( tr_torrent * torrent,
|
void tr_peerMgrGetNextRequests( tr_torrent * torrent,
|
||||||
tr_peer * peer,
|
tr_peer * peer,
|
||||||
int numwant,
|
int numwant,
|
||||||
|
|
Loading…
Reference in New Issue