]> granicus.if.org Git - transmission/commitdiff
Return session ID as part of "session-get" response
authorMike Gelfand <mikedld@mikedld.com>
Mon, 5 Sep 2016 19:16:56 +0000 (22:16 +0300)
committerMike Gelfand <mikedld@mikedld.com>
Tue, 27 Sep 2016 18:18:36 +0000 (21:18 +0300)
extras/rpc-spec.txt
libtransmission/quark.c
libtransmission/quark.h
libtransmission/rpcimpl.c

index 7c6878956460270dc9a13e37f9a00489eb177900..6f4a9d7070b6baa7d98593072a3b4d7ae259f9b0 100644 (file)
 
    Method name: "session-set"
    Request arguments: one or more of 4.1's arguments, except: "blocklist-size",
-                      "config-dir", "rpc-version", "rpc-version-minimum", and
-                      "version"
+                      "config-dir", "rpc-version", "rpc-version-minimum",
+                      "version", and "session-id"
    Response arguments: none
 
 4.1.2.  Accessors
          |         | yes       | torrent-add          | new return arg "torrent-duplicate"
    ------+---------+-----------+----------------------+-------------------------------
    16    | 3.00    | yes       | session-get          | new request arg "fields"
+         |         | yes       | session-get          | new arg "session-id"
 
 5.1.  Upcoming Breakage
 
index 466bb3563230c85435cbdb90ca081d2b66bb1b2a..21b5774822d90ac3feebff02c4af28a68b1ef1ea 100644 (file)
@@ -315,6 +315,7 @@ static const struct tr_key_struct my_static[] =
   { "seederCount", 11 },
   { "seeding-time-seconds", 20 },
   { "session-count", 13 },
+  { "session-id", 10 },
   { "sessionCount", 12 },
   { "show-backup-trackers", 20 },
   { "show-extra-peer-details", 23 },
index b67f2c9ba133cc32b1082bbc11fa88fa9fd488f3..cbbc9d8a50dfe52aeee5a6b3e3c9532d3d2ec1f7 100644 (file)
@@ -316,6 +316,7 @@ enum
   TR_KEY_seederCount,
   TR_KEY_seeding_time_seconds,
   TR_KEY_session_count,
+  TR_KEY_session_id,
   TR_KEY_sessionCount,
   TR_KEY_show_backup_trackers,
   TR_KEY_show_extra_peer_details,
index b17490091a22f550e95216853b849c7edc4968f0..211a1a8c688f657e8bd8abc662c636031cb98524 100644 (file)
@@ -26,6 +26,7 @@
 #include "platform-quota.h" /* tr_device_info_get_free_space() */
 #include "rpcimpl.h"
 #include "session.h"
+#include "session-id.h"
 #include "torrent.h"
 #include "utils.h"
 #include "variant.h"
@@ -2260,6 +2261,10 @@ addSessionField (tr_session * s,
           tr_variantDictAddStr (d, key, str);
           break;
         }
+
+      case TR_KEY_session_id:
+        tr_variantDictAddStr (d, key, tr_session_id_get_current (s->session_id));
+        break;
     }
 }