From a6a29923c7af0b3082884b2305ad63e2245d519d Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Fri, 16 Jan 2009 01:03:33 +0000 Subject: [PATCH] (trunk) add interface versioning to the RPC spec --- doc/rpc-spec.txt | 30 ++++++++++++++++++++++++++++++ libtransmission/rpcimpl.c | 2 ++ 2 files changed, 32 insertions(+) diff --git a/doc/rpc-spec.txt b/doc/rpc-spec.txt index 89573bfa9..b35a13c3e 100644 --- a/doc/rpc-spec.txt +++ b/doc/rpc-spec.txt @@ -323,6 +323,16 @@ "speed-limit-up" | number max global upload speed (in K/s) "speed-limit-up-enabled" | 'boolean' true means enabled "version" | string long version string "$version ($revision)" + "rpc-version" | number the current RPC API version + "rpc-version-minimum" | number the minimum RPC API version supported + + "rpc-version" indicates the RPC interface version supported by the RPC server. + It is incremented when a new version of Transmission changes the RPC interface. + + "rpc-version-minimum" indicates the oldest API supported by the RPC server. + It is changes when a new version of Transmission changes the RPC interface + in a way that is not backwards compatible. There are no plans for this + to be common behavior. 4.1.1. Mutators @@ -353,3 +363,23 @@ "uploadSpeed" | number +5.0. Protocol Versions + + The following changes have been made to the RPC interface: + + RPC | Release | Backwards | | + Vers. | Version | Compat? | Method | Description + ------+---------+-----------+----------------+------------------------------- + 1 | 1.30 | n/a | n/a | Initial version + ------+---------+-----------+----------------+------------------------------- + 2 | 1.34 | yes | torrent-get | new arg "peers" + ------+---------+-----------+----------------+------------------------------- + 3 | 1.41 | yes | torrent-get | added "port" to "peers" + | | | torrent-get | new arg "downloaders" + | | | session-get | new arg "version" + | | | torrent-remove | new method + ------+---------+-----------+----------------+------------------------------- + 4 | 1.50 | yes | session-get | new arg "rpc-version" + | | | session-get | new arg "rpc-version-minimum" + ------+---------+-----------+----------------+------------------------------- + diff --git a/libtransmission/rpcimpl.c b/libtransmission/rpcimpl.c index b50f1b0e5..db52e9f53 100644 --- a/libtransmission/rpcimpl.c +++ b/libtransmission/rpcimpl.c @@ -718,6 +718,8 @@ sessionGet( tr_session * session, tr_bencDictAddInt( d, "pex-allowed", tr_sessionIsPexEnabled( session ) ); tr_bencDictAddInt( d, "port", tr_sessionGetPeerPort( session ) ); tr_bencDictAddInt( d, "port-forwarding-enabled", tr_sessionIsPortForwardingEnabled( session ) ); + tr_bencDictAddInt( d, "rpc-version", 4 ); + tr_bencDictAddInt( d, "rpc-version-minimum", 1 ); tr_bencDictAddInt( d, "speed-limit-up", tr_sessionGetSpeedLimit( session, TR_UP ) ); tr_bencDictAddInt( d, "speed-limit-up-enabled", tr_sessionIsSpeedLimitEnabled( session, TR_UP ) ); tr_bencDictAddInt( d, "speed-limit-down", tr_sessionGetSpeedLimit( session, TR_DOWN ) ); -- 2.40.0