From b9e8624b3c0421512563583cb7b34e85a9901d6c Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Tue, 2 Feb 2010 18:27:57 +0000 Subject: [PATCH] (trunk daemon) #2751 "display-remote -si should show config directory" -- implemented for 1.90 --- daemon/remote.c | 4 +++- doc/rpc-spec.txt | 4 +++- libtransmission/rpcimpl.c | 1 + 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/daemon/remote.c b/daemon/remote.c index a17db2ae0..80ba89921 100644 --- a/daemon/remote.c +++ b/daemon/remote.c @@ -1053,7 +1053,9 @@ printSession( tr_benc * top ) printf( " RPC minimum version: %" PRId64 "\n", i ); printf( "\n" ); - printf( "TRANSFER\n" ); + printf( "CONFIG\n" ); + if( tr_bencDictFindStr( args, "config-dir", &str ) ) + printf( " Configuration directory: %s\n", str ); if( tr_bencDictFindStr( args, TR_PREFS_KEY_DOWNLOAD_DIR, &str ) ) printf( " Download directory: %s\n", str ); if( tr_bencDictFindInt( args, TR_PREFS_KEY_PEER_PORT, &i ) ) diff --git a/doc/rpc-spec.txt b/doc/rpc-spec.txt index 5ec649ef4..6836f49e4 100644 --- a/doc/rpc-spec.txt +++ b/doc/rpc-spec.txt @@ -430,7 +430,8 @@ Method name: "session-set" Request arguments: one or more of 4.1's arguments, except: "blocklist-size", - "rpc-version", "rpc-version-minimum", and "version" + "config-dir", "rpc-version", "rpc-version-minimum", + and "version" Response arguments: none 4.1.2. Accessors @@ -577,4 +578,5 @@ ------+---------+-----------+----------------+------------------------------- 8 | 1.90 | yes | session-set | new arg "rename-partial-files" | | yes | session-get | new arg "rename-partial-files" + | | yes | session-get | new arg "config-dir" | | yes | torrent-add | new arg "bandwidthPriority" diff --git a/libtransmission/rpcimpl.c b/libtransmission/rpcimpl.c index d5bfd3e0a..cb54f0b01 100644 --- a/libtransmission/rpcimpl.c +++ b/libtransmission/rpcimpl.c @@ -1282,6 +1282,7 @@ sessionGet( tr_session * s, tr_bencDictAddBool( d, TR_PREFS_KEY_ALT_SPEED_TIME_ENABLED, tr_sessionUsesAltSpeedTime(s) ); tr_bencDictAddBool( d, TR_PREFS_KEY_BLOCKLIST_ENABLED, tr_blocklistIsEnabled( s ) ); tr_bencDictAddInt ( d, "blocklist-size", tr_blocklistGetRuleCount( s ) ); + tr_bencDictAddStr ( d, "config-dir", tr_sessionGetConfigDir( s ) ); tr_bencDictAddStr ( d, TR_PREFS_KEY_DOWNLOAD_DIR, tr_sessionGetDownloadDir( s ) ); tr_bencDictAddInt ( d, TR_PREFS_KEY_PEER_LIMIT_GLOBAL, tr_sessionGetPeerLimit( s ) ); tr_bencDictAddInt ( d, TR_PREFS_KEY_PEER_LIMIT_TORRENT, tr_sessionGetPeerLimitPerTorrent( s ) );