mirror of
https://github.com/transmission/transmission.git
synced 2025-12-27 13:41:17 +00:00
when getting the list of all trackers, exclude tiers when necessary
This commit is contained in:
@@ -194,7 +194,6 @@
|
||||
trackerString = [@"http://" stringByAppendingString: trackerString];
|
||||
|
||||
//parse tracker string
|
||||
#warning check if it works with https
|
||||
if (tr_httpParseURL([trackerString UTF8String], -1, NULL, NULL, NULL))
|
||||
{
|
||||
NSAlert * alert = [[[NSAlert alloc] init] autorelease];
|
||||
|
||||
@@ -770,15 +770,18 @@ void completenessChangeCallback(tr_torrent * torrent, cp_status_t status, void *
|
||||
return [NSString stringWithUTF8String: fStat->tracker_stat.scrapeResponse];
|
||||
}
|
||||
|
||||
#warning removes separators?
|
||||
- (NSArray *) allTrackers: (BOOL) separators
|
||||
{
|
||||
int count = fInfo->trackerCount;
|
||||
NSMutableArray * allTrackers = [NSMutableArray arrayWithCapacity: count + fInfo->trackers[count-1].tier + 1];
|
||||
int count = fInfo->trackerCount, capacity = count;
|
||||
if (separators)
|
||||
capacity += fInfo->trackers[count-1].tier + 1;
|
||||
NSMutableArray * allTrackers = [NSMutableArray arrayWithCapacity: capacity];
|
||||
|
||||
int i, tier = -1;
|
||||
for (i = 0; i < count; i++)
|
||||
{
|
||||
if (tier != fInfo->trackers[i].tier)
|
||||
if (separators && tier != fInfo->trackers[i].tier)
|
||||
{
|
||||
tier = fInfo->trackers[i].tier;
|
||||
[allTrackers addObject: [NSNumber numberWithInt: tier]];
|
||||
|
||||
Reference in New Issue
Block a user