From aac5e5cb61175f3f3e4f5e9ed98f1704422db8fc Mon Sep 17 00:00:00 2001 From: Mitchell Livingston Date: Thu, 14 Jan 2010 00:25:03 +0000 Subject: [PATCH] add to RPC info for peers from DHT and LTEP --- doc/rpc-spec.txt | 2 ++ libtransmission/rpcimpl.c | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/doc/rpc-spec.txt b/doc/rpc-spec.txt index 489ab4df9..c6d6aa590 100644 --- a/doc/rpc-spec.txt +++ b/doc/rpc-spec.txt @@ -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 -------------------+--------------------------------------+ diff --git a/libtransmission/rpcimpl.c b/libtransmission/rpcimpl.c index 536209218..e86a1ddcb 100644 --- a/libtransmission/rpcimpl.c +++ b/libtransmission/rpcimpl.c @@ -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] ); }