Changeset 6 for trunk/libtransmission
- Timestamp:
- Jan 12, 2006, 6:33:20 PM (17 years ago)
- Location:
- trunk/libtransmission
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libtransmission/internal.h
r3 r6 128 128 129 129 int status; 130 int finished; 130 131 char error[128]; 131 132 -
trunk/libtransmission/metainfo.c
r1 r6 42 42 struct stat sb; 43 43 44 snprintf( inf->torrent, MAX_PATH_LENGTH, path );44 snprintf( inf->torrent, MAX_PATH_LENGTH, "%s", path ); 45 45 46 46 if( stat( path, &sb ) ) … … 143 143 return 1; 144 144 } 145 snprintf( inf->trackerAnnounce, MAX_PATH_LENGTH, s2 );145 snprintf( inf->trackerAnnounce, MAX_PATH_LENGTH, "%s", s2 ); 146 146 147 147 /* Piece length */ -
trunk/libtransmission/tracker.c
r3 r6 359 359 tor->status |= TR_TRACKER_ERROR; 360 360 snprintf( tor->error, sizeof( tor->error ), 361 bePeers->val.s.s );361 "%s", bePeers->val.s.s ); 362 362 goto cleanup; 363 363 } … … 607 607 return 0; 608 608 } 609 610 int tr_trackerSeeders( tr_torrent_t * tor) 611 { 612 if (tor->status != TR_STATUS_PAUSE) 613 { 614 return (tor->tracker)->seeders; 615 } 616 return 0; 617 } 618 619 int tr_trackerLeechers( tr_torrent_t * tor) 620 { 621 if (tor->status != TR_STATUS_PAUSE) 622 { 623 return (tor->tracker)->leechers; 624 } 625 return 0; 626 } -
trunk/libtransmission/tracker.h
r1 r6 32 32 void tr_trackerClose ( tr_tracker_t * ); 33 33 34 /*********************************************************************** 35 * tr_trackerSeeders 36 *********************************************************************** 37 * Looks for the seeders/leechers as returned by the tracker. 38 **********************************************************************/ 39 int tr_trackerSeeders ( tr_torrent_t * ); 40 41 /*********************************************************************** 42 * tr_trackerLeechers 43 *********************************************************************** 44 * Looks for the seeders/leechers as returned by the tracker. 45 **********************************************************************/ 46 int tr_trackerLeechers ( tr_torrent_t * ); 47 34 48 int tr_trackerScrape ( tr_torrent_t *, int *, int * ); 35 49 -
trunk/libtransmission/transmission.c
r5 r6 173 173 tor->id = h->id; 174 174 tor->key = h->key; 175 tor->finished = 0; 176 175 177 176 178 /* Guess scrape URL */ … … 316 318 { 317 319 return h->torrentCount; 320 } 321 322 int tr_getFinished( tr_handle_t * h, int i) 323 { 324 return h->torrents[i]->finished; 325 } 326 void tr_setFinished( tr_handle_t * h, int i, int val) 327 { 328 h->torrents[i]->finished = val; 318 329 } 319 330 … … 375 386 s[i].rateDownload = rateDownload( tor ); 376 387 s[i].rateUpload = rateUpload( tor ); 388 389 s[i].seeders = tr_trackerSeeders(tor); 390 s[i].leechers = tr_trackerLeechers(tor); 377 391 378 392 if( s[i].rateDownload < 0.1 ) … … 497 511 /* Done */ 498 512 tor->status = TR_STATUS_SEED; 513 tor->finished = 1; 499 514 tr_trackerCompleted( tor->tracker ); 500 515 } -
trunk/libtransmission/transmission.h
r2 r6 72 72 73 73 /*********************************************************************** 74 * tr_getFinished 75 *********************************************************************** 76 * Tests to see if torrent is finished 77 **********************************************************************/ 78 int tr_getFinished( tr_handle_t *, int ); 79 80 /*********************************************************************** 81 * tr_setFinished 82 *********************************************************************** 83 * Sets the boolean value finished in the torrent back to false 84 **********************************************************************/ 85 void tr_setFinished( tr_handle_t *, int, int ); 86 87 /*********************************************************************** 74 88 * tr_torrentInit 75 89 *********************************************************************** … … 206 220 int peersDownloading; 207 221 char pieces[120]; 222 int seeders; 223 int leechers; 208 224 209 225 uint64_t downloaded;
Note: See TracChangeset
for help on using the changeset viewer.