Changeset 1132
- Timestamp:
- Nov 25, 2006, 6:56:15 AM (16 years ago)
- Location:
- branches/scrape
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/scrape/libtransmission/tracker.c
r1131 r1132 40 40 int leechers; 41 41 int hasManyPeers; 42 int downloaded; 42 43 43 44 uint64_t dateTry; … … 77 78 tc->seeders = -1; 78 79 tc->leechers = -1; 80 tc->downloaded = -1; 79 81 80 82 tc->lastAttempt = TC_ATTEMPT_NOREACH; … … 151 153 152 154 uint64_t now = tr_date(); 153 uint64_t interval = 1000 * tc->scrapeInterval;155 uint64_t interval = 1000 * MAX(tc->scrapeInterval, 60); 154 156 155 157 // scrape half as often if there is no need to … … 653 655 return; 654 656 } 657 655 658 val2 = tr_bencDictFind( val1, "complete" ); 656 659 if( !val2 ) … … 660 663 } 661 664 tc->seeders = val2->val.i; 665 662 666 val2 = tr_bencDictFind( val1, "incomplete" ); 663 667 if( !val2 ) … … 668 672 tc->leechers = val2->val.i; 669 673 674 val2 = tr_bencDictFind( val1, "downloaded" ); 675 if( !val2 ) 676 { 677 tr_bencFree( &scrape ); 678 return; 679 } 680 tc->downloaded = val2->val.i; 681 670 682 val2 = tr_bencDictFind( val1, "flags" ); 671 683 if (val2) … … 700 712 return tc->leechers; 701 713 } 714 715 int tr_trackerDownloaded( tr_tracker_t * tc ) 716 { 717 if( !tc ) 718 { 719 return -1; 720 } 721 return tc->downloaded; 722 } -
branches/scrape/libtransmission/tracker.h
r1127 r1132 38 38 * tr_trackerSeeders 39 39 *********************************************************************** 40 * Looks for the seeders /leechersas returned by the tracker.40 * Looks for the seeders as returned by the tracker. 41 41 **********************************************************************/ 42 int 42 int tr_trackerSeeders ( tr_tracker_t * ); 43 43 44 44 /*********************************************************************** 45 45 * tr_trackerLeechers 46 46 *********************************************************************** 47 * Looks for the seeders/leechers as returned by the tracker.47 * Looks for the leechers as returned by the tracker. 48 48 **********************************************************************/ 49 int tr_trackerLeechers ( tr_tracker_t * ); 49 int tr_trackerLeechers ( tr_tracker_t * ); 50 51 /*********************************************************************** 52 * tr_trackerDownloaded 53 *********************************************************************** 54 * Looks for number of completed trackers as returned by the tracker 55 * (from scrape). 56 **********************************************************************/ 57 int tr_trackerDownloaded( tr_tracker_t * tc ); 50 58 51 59 #endif -
branches/scrape/libtransmission/transmission.c
r1130 r1132 366 366 } 367 367 368 /***********************************************************************369 * tr_torrentScrape370 **********************************************************************/371 /*int tr_torrentScrape( tr_torrent_t * tor, int * s, int * l )372 {373 return tr_trackerScrape( tor, s, l );374 }*/375 376 368 void tr_torrentSetFolder( tr_torrent_t * tor, const char * path ) 377 369 { … … 540 532 s->seeders = tr_trackerSeeders(tor->tracker); 541 533 s->leechers = tr_trackerLeechers(tor->tracker); 534 s->completedFromTracker = tr_trackerDownloaded(tor->tracker); 542 535 543 536 s->swarmspeed = tr_rcRate( tor->swarmspeed ); -
branches/scrape/libtransmission/transmission.h
r1127 r1132 203 203 204 204 /*********************************************************************** 205 * tr_torrentScrape206 ***********************************************************************207 * Asks the tracker for the count of seeders and leechers. Returns 0208 * and fills 's' and 'l' if successful. Otherwise returns 1 if the209 * tracker doesn't support the scrape protocol, is unreachable or210 * replied with some error. tr_torrentScrape may block up to 20 seconds211 * before returning.212 **********************************************************************/213 //int tr_torrentScrape( tr_torrent_t *, int * s, int * l );214 215 /***********************************************************************216 205 * tr_torrentStart 217 206 *********************************************************************** … … 369 358 int seeders; 370 359 int leechers; 360 int completedFromTracker; 371 361 372 362 uint64_t downloaded; -
branches/scrape/macosx/English.lproj/InfoWindow.nib/classes.nib
r1124 r1132 20 20 OUTLETS = { 21 21 fCommentView = NSTextView; 22 fCompletedFromTrackerField = NSTextField; 22 23 fConnectedPeersField = NSTextField; 23 24 fCreatorField = NSTextField; -
branches/scrape/macosx/InfoWindowController.h
r1124 r1132 50 50 IBOutlet NSTableView * fPeerTable; 51 51 IBOutlet NSTextField * fSeedersField, * fLeechersField, * fConnectedPeersField, 52 * fDownloadingFromField, * fUploadingToField ;52 * fDownloadingFromField, * fUploadingToField, * fCompletedFromTrackerField; 53 53 54 54 IBOutlet NSTableView * fFileTable; -
branches/scrape/macosx/InfoWindowController.m
r1125 r1132 182 182 [fSeedersField setStringValue: @""]; 183 183 [fLeechersField setStringValue: @""]; 184 [fCompletedFromTrackerField setStringValue: @""]; 184 185 [fConnectedPeersField setStringValue: @""]; 185 186 [fDownloadingFromField setStringValue: @""]; … … 327 328 Torrent * torrent = [fTorrents objectAtIndex: 0]; 328 329 329 int seeders = [torrent seeders], leechers = [torrent leechers] ;330 int seeders = [torrent seeders], leechers = [torrent leechers], downloaded = [torrent completedFromTracker]; 330 331 [fSeedersField setStringValue: seeders < 0 ? @"" : [NSString stringWithInt: seeders]]; 331 332 [fLeechersField setStringValue: leechers < 0 ? @"" : [NSString stringWithInt: leechers]]; 333 [fCompletedFromTrackerField setStringValue: downloaded < 0 ? @"" : [NSString stringWithInt: downloaded]]; 332 334 333 335 BOOL active = [torrent isActive]; -
branches/scrape/macosx/Torrent.h
r1119 r1132 143 143 - (int) seeders; 144 144 - (int) leechers; 145 - (int) completedFromTracker; 145 146 - (int) totalPeers; 146 147 - (int) totalPeersIncoming; -
branches/scrape/macosx/Torrent.m
r1119 r1132 884 884 } 885 885 886 - (int) completedFromTracker 887 { 888 return fStat->completedFromTracker; 889 } 890 886 891 - (int) totalPeers 887 892 {
Note: See TracChangeset
for help on using the changeset viewer.