1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2025-01-02 13:05:08 +00:00

refactor: remove unused tr_stat fields (#3493)

This commit is contained in:
Charles Kerr 2022-07-20 21:54:41 -05:00 committed by GitHub
parent 9f7afe4ea5
commit da032e3875
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 2 additions and 17 deletions

View file

@ -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:

View file

@ -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);

View file

@ -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;