From de82e235af7ca94b7295a1e0aace1d6ebc975772 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Wed, 13 Jan 2010 22:46:22 +0000 Subject: [PATCH] (trunk) second half of r9927.... :/ --- doc/rpc-spec.txt | 1 + libtransmission/announcer.c | 12 ++++++------ libtransmission/rpcimpl.c | 2 +- libtransmission/transmission.h | 2 +- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/doc/rpc-spec.txt b/doc/rpc-spec.txt index 7ba4ed4a8..489ab4df9 100644 --- a/doc/rpc-spec.txt +++ b/doc/rpc-spec.txt @@ -258,6 +258,7 @@ | hasAnnounced | boolean | tr_tracker_stat | hasScraped | boolean | tr_tracker_stat | host | string | tr_tracker_stat + | id | number | tr_tracker_stat | isBackup | boolean | tr_tracker_stat | lastAnnouncePeerCount | number | tr_tracker_stat | lastAnnounceResult | number | tr_tracker_stat diff --git a/libtransmission/announcer.c b/libtransmission/announcer.c index 95a7fd5e1..5c5218abd 100644 --- a/libtransmission/announcer.c +++ b/libtransmission/announcer.c @@ -296,7 +296,7 @@ typedef struct int downloadCount; int downloaderCount; - uint32_t identifier; + uint32_t id; /* sent as the "key" argument in tracker requests * to verify us if our IP address changes. @@ -322,13 +322,13 @@ static tr_tracker_item* trackerNew( tr_announcer * announcer, const char * announce, const char * scrape, - uint32_t identifier ) + uint32_t id ) { tr_tracker_item * tracker = tr_new0( tr_tracker_item, 1 ); tracker->host = getHost( announcer, announce ); tracker->announce = tr_strdup( announce ); tracker->scrape = tr_strdup( scrape ); - tracker->identifier = identifier; + tracker->id = id; generateKeyParam( tracker->key_param, KEYLEN ); tracker->seederCount = -1; tracker->leecherCount = -1; @@ -453,9 +453,9 @@ tierAddTracker( tr_announcer * announcer, tr_tier * tier, const char * announce, const char * scrape, - uint32_t identifier ) + uint32_t id ) { - tr_tracker_item * tracker = trackerNew( announcer, announce, scrape, identifier ); + tr_tracker_item * tracker = trackerNew( announcer, announce, scrape, id ); tr_ptrArrayAppend( &tier->trackers, tracker ); dbgmsg( tier, "adding tracker %s", announce ); @@ -1754,7 +1754,7 @@ tr_announcerStats( const tr_torrent * torrent, const tr_tracker_item * tracker = tr_ptrArrayNth( (tr_ptrArray*)&tier->trackers, j ); tr_tracker_stat * st = ret + out++; - st->identifier = tracker->identifier; + st->id = tracker->id; tr_strlcpy( st->host, tracker->host->name, sizeof( st->host ) ); tr_strlcpy( st->announce, tracker->announce, sizeof( st->announce ) ); st->tier = i + 1; diff --git a/libtransmission/rpcimpl.c b/libtransmission/rpcimpl.c index a2dd1190b..536209218 100644 --- a/libtransmission/rpcimpl.c +++ b/libtransmission/rpcimpl.c @@ -382,7 +382,7 @@ addTrackerStats( const tr_tracker_stat * st, int n, tr_benc * list ) tr_bencDictAddBool( d, "hasAnnounced", s->hasAnnounced ); tr_bencDictAddBool( d, "hasScraped", s->hasScraped ); tr_bencDictAddStr ( d, "host", s->host ); - tr_bencDictAddInt ( d, "identifier", s->identifier ); + tr_bencDictAddInt ( d, "id", s->id ); tr_bencDictAddBool( d, "isBackup", s->isBackup ); tr_bencDictAddInt ( d, "lastAnnouncePeerCount", s->lastAnnouncePeerCount ); tr_bencDictAddStr ( d, "lastAnnounceResult", s->lastAnnounceResult ); diff --git a/libtransmission/transmission.h b/libtransmission/transmission.h index 709d3e41f..df6059dc6 100644 --- a/libtransmission/transmission.h +++ b/libtransmission/transmission.h @@ -1462,7 +1462,7 @@ typedef struct int tier; /* used to match to a tr_tracker_info */ - uint32_t identifier; + uint32_t id; } tr_tracker_stat;