1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2025-02-04 05:22:40 +00:00

experimental commit to save 1888 bytes from each tr_torrent

This commit is contained in:
Charles Kerr 2008-03-31 19:34:20 +00:00
parent cd953b9606
commit 3e4168025b
3 changed files with 14 additions and 17 deletions

View file

@ -554,9 +554,8 @@ tr_torrentStatCached( tr_torrent * tor )
{
const time_t now = time( NULL );
return now == tor->lastStatTime
? &tor->stats[tor->statCur]
: tr_torrentStat( tor );
return now == tor->lastStatTime ? &tor->stats
: tr_torrentStat( tor );
}
const tr_stat *
@ -570,8 +569,7 @@ tr_torrentStat( tr_torrent * tor )
tor->lastStatTime = time( NULL );
tr_torrentRecheckCompleteness( tor );
tor->statCur = !tor->statCur;
s = &tor->stats[tor->statCur];
s = &tor->stats;
s->error = tor->error;
memcpy( s->errorString, tor->errorString,

View file

@ -111,14 +111,14 @@ tr_verify_state;
struct tr_torrent
{
tr_handle * handle;
tr_info info;
tr_handle * handle;
tr_info info;
tr_speedlimit uploadLimitMode;
tr_speedlimit downloadLimitMode;
struct tr_ratecontrol * upload;
struct tr_ratecontrol * download;
struct tr_ratecontrol * swarmspeed;
tr_speedlimit uploadLimitMode;
tr_speedlimit downloadLimitMode;
struct tr_ratecontrol * upload;
struct tr_ratecontrol * download;
struct tr_ratecontrol * swarmspeed;
int error;
char errorString[128];
@ -163,16 +163,15 @@ struct tr_torrent
tr_torrent_active_func * active_func;
void * active_func_user_data;
unsigned int statCur : 1;
unsigned int isRunning : 1;
unsigned int isDeleting : 1;
uint16_t maxConnectedPeers;
tr_verify_state verifyState;
tr_verify_state verifyState;
time_t lastStatTime;
tr_stat stats[2];
tr_stat stats;
tr_torrent * next;
};

View file

@ -780,12 +780,12 @@ struct tr_tracker_stat
/* This is the unmodified string returned by the tracker in response
* to the torrent's most recent scrape request. If no request was
* sent or there was no response, this string is empty. */
char scrapeResponse[512];
char scrapeResponse[256];
/* The unmodified string returned by the tracker in response
* to the torrent's most recent scrape request. If no request was
* sent or there was no response, this string is empty. */
char announceResponse[512];
char announceResponse[256];
/* Time the most recent scrape request was sent,
* or zero if one hasn't been sent yet. */