{
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 *
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,
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];
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;
};
/* 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. */