mirror of
https://github.com/transmission/transmission
synced 2025-03-11 14:43:42 +00:00
(trunk) RPC: add "scrape" to the trackerStats array, making it a proper superset of the "trackers" array. Also, very minor tweaks to the RPC spec
This commit is contained in:
parent
05fabc6255
commit
92e06acf74
4 changed files with 15 additions and 10 deletions
|
@ -104,9 +104,9 @@
|
|||
"seedIdleMode" | number which seeding inactivity to use. See tr_inactvelimit
|
||||
"seedRatioLimit" | double torrent-level seeding ratio
|
||||
"seedRatioMode" | number which ratio to use. See tr_ratiolimit
|
||||
"trackerAdd" | array strings of URLs to add
|
||||
"trackerRemove" | array strings of URLs to remove
|
||||
"trackerReplace" | array pairs of old/new announce URLs
|
||||
"trackerAdd" | array strings of announce URLs to add
|
||||
"trackerRemove" | array strings of announce URLs to remove
|
||||
"trackerReplace" | array pairs of old/new announce announce URLs
|
||||
"uploadLimit" | number maximum upload speed (KBps)
|
||||
"uploadLimited" | boolean true if "uploadLimit" is honored
|
||||
|
||||
|
@ -208,7 +208,6 @@
|
|||
-------------------+--------+-----------------------------+
|
||||
files | array of objects, each containing: |
|
||||
+-------------------------+------------+
|
||||
| key | type |
|
||||
| bytesCompleted | number | tr_torrent
|
||||
| length | number | tr_info
|
||||
| name | string | tr_info
|
||||
|
@ -261,9 +260,9 @@
|
|||
trackers | array of objects, each containing: |
|
||||
+-------------------------+------------+
|
||||
| announce | string | tr_tracker_info
|
||||
| id | number | tr_tracker_info
|
||||
| scrape | string | tr_tracker_info
|
||||
| tier | number | tr_tracker_info
|
||||
| id | number | tr_tracker_info
|
||||
-------------------+--------------------------------------+
|
||||
trackerStats | array of objects, each containing: |
|
||||
+-------------------------+------------+
|
||||
|
@ -289,6 +288,7 @@
|
|||
| leecherCount | number | tr_tracker_stat
|
||||
| nextAnnounceTime | number | tr_tracker_stat
|
||||
| nextScrapeTime | number | tr_tracker_stat
|
||||
| scrape | string | tr_tracker_stat
|
||||
| scrapeState | number | tr_tracker_stat
|
||||
| seederCount | number | tr_tracker_stat
|
||||
| tier | number | tr_tracker_stat
|
||||
|
|
|
@ -1993,6 +1993,7 @@ tr_announcerStats( const tr_torrent * torrent,
|
|||
st->id = tracker->id;
|
||||
tr_strlcpy( st->host, tracker->host->name, sizeof( st->host ) );
|
||||
tr_strlcpy( st->announce, tracker->announce, sizeof( st->announce ) );
|
||||
tr_strlcpy( st->scrape, tracker->scrape, sizeof( st->scrape ) );
|
||||
st->tier = i;
|
||||
st->isBackup = tracker != tier->currentTracker;
|
||||
st->lastScrapeStartTime = tier->lastScrapeStartTime;
|
||||
|
|
|
@ -386,7 +386,7 @@ addTrackerStats( const tr_tracker_stat * st, int n, tr_benc * list )
|
|||
for( i=0; i<n; ++i )
|
||||
{
|
||||
const tr_tracker_stat * s = &st[i];
|
||||
tr_benc * d = tr_bencListAddDict( list, 25 );
|
||||
tr_benc * d = tr_bencListAddDict( list, 26 );
|
||||
tr_bencDictAddStr ( d, "announce", s->announce );
|
||||
tr_bencDictAddInt ( d, "announceState", s->announceState );
|
||||
tr_bencDictAddInt ( d, "downloadCount", s->downloadCount );
|
||||
|
@ -409,6 +409,7 @@ addTrackerStats( const tr_tracker_stat * st, int n, tr_benc * list )
|
|||
tr_bencDictAddInt ( d, "leecherCount", s->leecherCount );
|
||||
tr_bencDictAddInt ( d, "nextAnnounceTime", s->nextAnnounceTime );
|
||||
tr_bencDictAddInt ( d, "nextScrapeTime", s->nextScrapeTime );
|
||||
tr_bencDictAddStr ( d, "scrape", s->scrape );
|
||||
tr_bencDictAddInt ( d, "scrapeState", s->scrapeState );
|
||||
tr_bencDictAddInt ( d, "seederCount", s->seederCount );
|
||||
tr_bencDictAddInt ( d, "tier", s->tier );
|
||||
|
|
|
@ -1472,18 +1472,18 @@ typedef enum
|
|||
{
|
||||
/* we won't (announce,scrape) this torrent to this tracker because
|
||||
* the torrent is stopped, or because of an error, or whatever */
|
||||
TR_TRACKER_INACTIVE,
|
||||
TR_TRACKER_INACTIVE = 0,
|
||||
|
||||
/* we will (announce,scrape) this torrent to this tracker, and are
|
||||
* waiting for enough time to pass to satisfy the tracker's interval */
|
||||
TR_TRACKER_WAITING,
|
||||
TR_TRACKER_WAITING = 1,
|
||||
|
||||
/* it's time to (announce,scrape) this torrent, and we're waiting on a
|
||||
* a free slot to open up in the announce manager */
|
||||
TR_TRACKER_QUEUED,
|
||||
TR_TRACKER_QUEUED = 2,
|
||||
|
||||
/* we're (announcing,scraping) this torrent right now */
|
||||
TR_TRACKER_ACTIVE
|
||||
TR_TRACKER_ACTIVE = 3
|
||||
}
|
||||
tr_tracker_state;
|
||||
|
||||
|
@ -1504,6 +1504,9 @@ typedef struct
|
|||
/* the full announce URL */
|
||||
char announce[1024];
|
||||
|
||||
/* the full scrape URL */
|
||||
char scrape[1024];
|
||||
|
||||
/* Transmission uses one tracker per tier,
|
||||
* and the others are kept as backups */
|
||||
tr_bool isBackup;
|
||||
|
|
Loading…
Add table
Reference in a new issue