From da032e38757d0abe5558f3d993844fcbec615ebe Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Wed, 20 Jul 2022 21:54:41 -0500 Subject: [PATCH] refactor: remove unused tr_stat fields (#3493) --- libtransmission/rpcimpl.cc | 3 ++- libtransmission/torrent.cc | 3 --- libtransmission/transmission.h | 13 ------------- 3 files changed, 2 insertions(+), 17 deletions(-) diff --git a/libtransmission/rpcimpl.cc b/libtransmission/rpcimpl.cc index d1748433e..85d0cdccc 100644 --- a/libtransmission/rpcimpl.cc +++ b/libtransmission/rpcimpl.cc @@ -20,6 +20,7 @@ #include "transmission.h" +#include "announcer.h" #include "completion.h" #include "crypto-utils.h" #include "error.h" @@ -617,7 +618,7 @@ static void initField(tr_torrent const* const tor, tr_stat const* const st, tr_v break; case TR_KEY_manualAnnounceTime: - tr_variantInitInt(initme, st->manualAnnounceTime); + tr_variantInitInt(initme, tr_announcerNextManualAnnounce(tor)); break; case TR_KEY_maxConnectedPeers: diff --git a/libtransmission/torrent.cc b/libtransmission/torrent.cc index a2bd3f9e0..9913c2836 100644 --- a/libtransmission/torrent.cc +++ b/libtransmission/torrent.cc @@ -1059,7 +1059,6 @@ tr_stat const* tr_torrentStat(tr_torrent* tor) s->isStalled = tr_torrentIsStalled(tor, s->idleSecs); s->errorString = tor->error_string.c_str(); - s->manualAnnounceTime = tr_announcerNextManualAnnounce(tor); s->peersConnected = swarm_stats.peer_count; s->peersSendingToUs = swarm_stats.active_peer_count[TR_DOWN]; s->peersGettingFromUs = swarm_stats.active_peer_count[TR_UP]; @@ -1070,8 +1069,6 @@ tr_stat const* tr_torrentStat(tr_torrent* tor) s->peersFrom[i] = swarm_stats.peer_from_count[i]; } - s->rawUploadSpeed_KBps = tr_toSpeedKBps(tor->bandwidth_.getRawSpeedBytesPerSecond(now, TR_UP)); - s->rawDownloadSpeed_KBps = tr_toSpeedKBps(tor->bandwidth_.getRawSpeedBytesPerSecond(now, TR_DOWN)); auto const pieceUploadSpeed_Bps = tor->bandwidth_.getPieceSpeedBytesPerSecond(now, TR_UP); s->pieceUploadSpeed_KBps = tr_toSpeedKBps(pieceUploadSpeed_Bps); auto const pieceDownloadSpeed_Bps = tor->bandwidth_.getPieceSpeedBytesPerSecond(now, TR_DOWN); diff --git a/libtransmission/transmission.h b/libtransmission/transmission.h index 4b6648392..b4d273f4e 100644 --- a/libtransmission/transmission.h +++ b/libtransmission/transmission.h @@ -1545,11 +1545,6 @@ struct tr_stat are moved to `corrupt' or `haveValid'. */ uint64_t haveUnchecked; - /** time when one or more of the torrent's trackers will - allow you to manually ask for more peers, - or 0 if you can't */ - time_t manualAnnounceTime; - /** When the torrent was first added. */ time_t addedDate; @@ -1596,14 +1591,6 @@ struct tr_stat Range is [0..1] */ float seedRatioPercentDone; - /** Speed all data being sent for this torrent. - This includes piece data, protocol messages, and TCP overhead */ - float rawUploadSpeed_KBps; - - /** Speed all data being received for this torrent. - This includes piece data, protocol messages, and TCP overhead */ - float rawDownloadSpeed_KBps; - /** Speed all piece being sent for this torrent. This ONLY counts piece data. */ float pieceUploadSpeed_KBps;