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

add to RPC info for peers from DHT and LTEP

This commit is contained in:
Mitchell Livingston 2010-01-14 00:25:03 +00:00
parent de82e235af
commit aac5e5cb61
2 changed files with 5 additions and 1 deletions

View file

@ -229,7 +229,9 @@
peersFrom | an object containing: |
+-------------------------+------------+
| fromCache | number | tr_stat
| fromDht | number | tr_stat
| fromIncoming | number | tr_stat
| fromLtep | number | tr_stat
| fromPex | number | tr_stat
| fromTracker | number | tr_stat
-------------------+--------------------------------------+

View file

@ -521,10 +521,12 @@ addField( const tr_torrent * tor, tr_benc * d, const char * key )
tr_bencDictAddInt( d, key, st->peersConnected );
else if( tr_streq( key, keylen, "peersFrom" ) )
{
tr_benc * tmp = tr_bencDictAddDict( d, key, 4 );
tr_benc * tmp = tr_bencDictAddDict( d, key, 6 );
const int * f = st->peersFrom;
tr_bencDictAddInt( tmp, "fromCache", f[TR_PEER_FROM_RESUME] );
tr_bencDictAddInt( tmp, "fromDht", f[TR_PEER_FROM_DHT] );
tr_bencDictAddInt( tmp, "fromIncoming", f[TR_PEER_FROM_INCOMING] );
tr_bencDictAddInt( tmp, "fromLtep", f[TR_PEER_FROM_LTEP] );
tr_bencDictAddInt( tmp, "fromPex", f[TR_PEER_FROM_PEX] );
tr_bencDictAddInt( tmp, "fromTracker", f[TR_PEER_FROM_TRACKER] );
}