Changeset 3178
- Timestamp:
- Sep 26, 2007, 1:55:04 AM (15 years ago)
- Location:
- trunk
- Files:
-
- 12 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/README
r3014 r3178 10 10 and BeOS (native interface). 11 11 12 For more information (including build instructions), please consult the13 website: http://transmission.m0k.org/12 For more information (including build instructions), 13 please consult the website: http://transmission.m0k.org/ 14 14 15 15 … … 17 17 ===================== 18 18 19 Transmission has an Xcode project file (Transmission.xcodeproj) that allows it to be built in Xcode. 19 Transmission has an Xcode project file (Transmission.xcodeproj) 20 that allows it to be built in Xcode. 20 21 21 22 Building a Transmission release from the command line: -
trunk/gtk/torrent-inspector.c
r3154 r3178 814 814 { 815 815 GtkWidget * state_lb; 816 GtkWidget * corrupt_dl_lb; 816 817 GtkWidget * valid_dl_lb; 817 818 GtkWidget * dl_lb; … … 833 834 Activity * a = (Activity*) g_object_get_data (G_OBJECT(top), "activity-data"); 834 835 const tr_stat * stat = tr_torrent_stat( a->gtor ); 835 guint64 size;836 836 char *pch; 837 837 … … 840 840 g_free (pch); 841 841 842 size = stat->downloadedValid; 843 pch = readablesize (size); 842 pch = readablesize (stat->corruptEver); 843 gtk_label_set_text (GTK_LABEL(a->corrupt_dl_lb), pch); 844 g_free (pch); 845 846 pch = readablesize (stat->haveValid); 844 847 gtk_label_set_text (GTK_LABEL(a->valid_dl_lb), pch); 845 848 g_free (pch); 846 849 847 pch = readablesize (stat->downloaded );850 pch = readablesize (stat->downloadedEver); 848 851 gtk_label_set_text (GTK_LABEL(a->dl_lb), pch); 849 852 g_free (pch); 850 853 851 pch = readablesize (stat->uploaded );854 pch = readablesize (stat->uploadedEver); 852 855 gtk_label_set_text (GTK_LABEL(a->ul_lb), pch); 853 856 g_free (pch); 854 857 855 pch = ratiostr (stat->downloaded , stat->uploaded);858 pch = ratiostr (stat->downloadedEver, stat->uploadedEver); 856 859 gtk_label_set_text (GTK_LABEL(a->ratio_lb), pch); 857 860 g_free (pch); … … 861 864 g_free (pch); 862 865 863 pch = readablesize (stat->left );866 pch = readablesize (stat->leftUntilDone); 864 867 gtk_label_set_text (GTK_LABEL(a->remaining_lb), pch); 865 868 g_free (pch); … … 900 903 g_snprintf (name, sizeof(name), namefmt, _("State")); 901 904 l = a->state_lb = gtk_label_new (NULL); 905 hig_workarea_add_row (t, &row, name, l, NULL); 906 907 g_snprintf (name, sizeof(name), namefmt, _("Corrupt DL")); 908 l = a->corrupt_dl_lb = gtk_label_new (NULL); 902 909 hig_workarea_add_row (t, &row, name, l, NULL); 903 910 -
trunk/gtk/tr_core.c
r3111 r3178 610 610 MC_DONE, st->completedFromTracker, 611 611 MC_TRACKER, st->tracker, 612 MC_DOWN, st->downloaded ,613 MC_UP, st->uploaded ,614 MC_LEFT, st->left ,612 MC_DOWN, st->downloadedEver, 613 MC_UP, st->uploadedEver, 614 MC_LEFT, st->leftUntilDone, 615 615 -1 ); 616 616 } -
trunk/libtransmission/completion.c
r3111 r3178 291 291 292 292 uint64_t 293 tr_cp DownloadedValid( const tr_completion * cp )293 tr_cpHaveValid( const tr_completion * cp ) 294 294 { 295 295 uint64_t b = 0; … … 309 309 return b; 310 310 } 311 312 uint64_t 313 tr_cpHaveTotal( const tr_completion * cp ) 314 { 315 return cp->completeHave; 316 } -
trunk/libtransmission/completion.h
r3105 r3178 37 37 38 38 cp_status_t tr_cpGetStatus ( const tr_completion * ); 39 uint64_t tr_cpDownloadedValid( const tr_completion * ); 39 uint64_t tr_cpHaveTotal( const tr_completion * ); 40 uint64_t tr_cpHaveValid( const tr_completion * ); 40 41 uint64_t tr_cpLeftUntilComplete( const tr_completion * ); 41 42 uint64_t tr_cpLeftUntilDone( const tr_completion * ); -
trunk/libtransmission/ipcparse.c
r3111 r3178 768 768 { 769 769 case IPC_ST_COMPLETED: 770 tr_bencInitInt( item, st->downloadedValid ); 770 case IPC_ST_DOWNVALID: 771 tr_bencInitInt( item, st->haveValid ); 771 772 break; 772 773 case IPC_ST_DOWNSPEED: … … 774 775 break; 775 776 case IPC_ST_DOWNTOTAL: 776 tr_bencInitInt( item, st->downloaded ); 777 break; 778 case IPC_ST_DOWNVALID: 779 tr_bencInitInt( item, st->downloadedValid ); 777 tr_bencInitInt( item, st->downloadedEver ); 780 778 break; 781 779 case IPC_ST_ERROR: … … 922 920 break; 923 921 case IPC_ST_UPTOTAL: 924 tr_bencInitInt( item, st->uploaded );922 tr_bencInitInt( item, st->uploadedEver ); 925 923 break; 926 924 default: -
trunk/libtransmission/peer-mgr-private.h
r3144 r3178 31 31 unsigned int doDisconnect : 1; 32 32 33 uint8_t from; 34 uint16_t port; 33 35 struct in_addr in_addr; 34 uint16_t port;35 36 struct tr_peerIo * io; 36 uint8_t from;37 37 38 38 struct tr_bitfield * banned; … … 46 46 time_t clientSentPieceDataAt; 47 47 time_t peerSentPieceDataAt; 48 time_t peerSentKeepaliveAt;49 48 time_t chokeChangedAt; 50 49 time_t connectionChangedAt; -
trunk/libtransmission/peer-msgs.c
r3169 r3178 621 621 tr_peerIoReadUint32( msgs->io, inbuf, &len ); 622 622 623 if( len == 0 ) {/* peer sent us a keepalive message */623 if( len == 0 ) /* peer sent us a keepalive message */ 624 624 dbgmsg( msgs, "peer sent us a keepalive message..." ); 625 msgs->info->peerSentKeepaliveAt = time( NULL ); 626 } else { 625 else { 627 626 dbgmsg( msgs, "peer is sending us a message with %"PRIu64" bytes...\n", (uint64_t)len ); 628 627 msgs->incomingMessageLength = len; 629 628 msgs->state = AWAITING_BT_MESSAGE; 630 } return READ_AGAIN; 629 } 630 631 return READ_AGAIN; 631 632 } 632 633 -
trunk/libtransmission/torrent.c
r3170 r3178 761 761 762 762 s->percentDone = tr_cpPercentDone( tor->completion ); 763 s->left = tr_cpLeftUntilDone( tor->completion );763 s->leftUntilDone = tr_cpLeftUntilDone( tor->completion ); 764 764 765 765 switch( tor->runStatus ) { … … 802 802 s->eta = s->rateDownload < 0.1 803 803 ? -1.0f 804 : (s->left / s->rateDownload / 1024.0); 805 806 s->corrupt = tor->corruptCur + tor->corruptPrev; 807 s->uploaded = tor->uploadedCur + tor->uploadedPrev; 808 s->downloaded = tor->downloadedCur + tor->downloadedPrev; 809 s->downloadedValid = tr_cpDownloadedValid( tor->completion ); 804 : (s->leftUntilDone / s->rateDownload / 1024.0); 805 806 s->corruptEver = tor->corruptCur + tor->corruptPrev; 807 s->downloadedEver = tor->downloadedCur + tor->downloadedPrev; 808 s->uploadedEver = tor->uploadedCur + tor->uploadedPrev; 809 s->haveValid = tr_cpHaveValid( tor->completion ); 810 s->haveUnchecked = tr_cpHaveTotal( tor->completion ) - s->haveValid; 810 811 811 s->ratio = s->downloaded || s->downloadedValid 812 ? (float)s->uploaded / (float)MAX(s->downloaded, s->downloadedValid) 813 : TR_RATIO_NA; 812 s->ratio = s->downloadedEver ? s->uploadedEver / (float)s->downloadedEver 813 : TR_RATIO_NA; 814 814 815 815 tr_torrentUnlock( tor ); -
trunk/libtransmission/transmission.h
r3170 r3178 63 63 #define TR_DEFAULT_PORT 9090 64 64 65 #define TR_PEER_FROM__MAX 4 66 #define TR_PEER_FROM_INCOMING 0 /* connections made to the listening port */ 67 #define TR_PEER_FROM_TRACKER 1 /* peers received from a tracker */ 68 #define TR_PEER_FROM_CACHE 2 /* peers read from the peer cache */ 69 #define TR_PEER_FROM_PEX 3 /* peers discovered via PEX */ 65 enum 66 { 67 TR_PEER_FROM_INCOMING = 0, /* connections made to the listening port */ 68 TR_PEER_FROM_TRACKER = 1, /* peers received from a tracker */ 69 TR_PEER_FROM_CACHE = 2, /* peers read from the peer cache */ 70 TR_PEER_FROM_PEX = 3, /* peers discovered via PEX */ 71 TR_PEER_FROM__MAX 72 }; 70 73 71 74 /*********************************************************************** … … 645 648 int completedFromTracker; 646 649 647 uint64_t left; 648 uint64_t downloaded; 649 uint64_t downloadedValid; 650 uint64_t uploaded; 651 uint64_t corrupt; 650 /* Byte count of how much data is left to be downloaded until 651 * we're done -- that is, until we've got all the pieces we wanted. */ 652 uint64_t leftUntilDone; 653 654 /* Byte count of all the corrupt data you've ever downloaded for 655 * this torrent. If you're on a poisoned torrent, this number can 656 * grow very large. */ 657 uint64_t corruptEver; 658 659 /* Byte count of all data you've ever uploaded for this torrent. */ 660 uint64_t uploadedEver; 661 662 /* Byte count of all the non-corrupt data you've ever downloaded 663 * for this torrent. If you deleted the files and downloaded a second time, 664 * this will be 2*totalSize.. */ 665 uint64_t downloadedEver; 666 667 /* Byte count of all the checksum-verified data we have for this torrent. */ 668 uint64_t haveValid; 669 670 /* Byte count of all the partial piece data we have for this torrent. 671 * As pieces become complete, this value may decrease as portions of it are 672 * moved to `corrupt' or `haveValid'. */ 673 uint64_t haveUnchecked; 674 652 675 float swarmspeed; 653 676 -
trunk/wx/filter.cc
r3109 r3178 50 50 : FLAG_IDLE; 51 51 52 flags |= s->left 52 flags |= s->leftUntilDone 53 53 ? FLAG_INCOMPLETE 54 54 : FLAG_COMPLETE; -
trunk/wx/torrent-list.cc
r3137 r3178 275 275 276 276 case COL_RATIO: 277 xstr = wxString::Format( _T("%%%d"), (int)(s->uploaded / (double)s->downloadedValid) );277 xstr = wxString::Format( _T("%%%d"), (int)(s->uploadedEver / (double)s->downloadedEver) ); 278 278 break; 279 279 280 280 case COL_RECEIVED: 281 xstr = getReadableSize( s->downloaded );281 xstr = getReadableSize( s->downloadedEver ); 282 282 break; 283 283 284 284 case COL_REMAINING: 285 xstr = getReadableSize( s->left );285 xstr = getReadableSize( s->leftUntilDone ); 286 286 break; 287 287 … … 294 294 295 295 case COL_SENT: 296 xstr = getReadableSize( s->uploaded );296 xstr = getReadableSize( s->uploadedEver ); 297 297 break; 298 298 … … 448 448 449 449 case COL_RATIO: { 450 const double ra = sa->uploaded / (double) sa->downloadedValid;451 const double rb = sb->uploaded / (double) sb->downloadedValid;450 const double ra = sa->uploadedEver / (double)(sa->downloadedEver + 0.01); 451 const double rb = sb->uploadedEver / (double)(sb->downloadedEver + 0.01); 452 452 if( ra < rb ) 453 453 ret = -1; … … 460 460 461 461 case COL_RECEIVED: 462 if( sa->downloaded < sb->downloaded)462 if( sa->downloadedEver < sb->downloadedEver ) 463 463 ret = -1; 464 else if( sa->downloaded > sb->downloaded)464 else if( sa->downloadedEver > sb->downloadedEver ) 465 465 ret = 1; 466 466 else … … 469 469 470 470 case COL_REMAINING: 471 if( sa->left < sb->left)471 if( sa->leftUntilDone < sb->leftUntilDone ) 472 472 ret = -1; 473 else if( sa->left > sb->left)473 else if( sa->leftUntilDone > sb->leftUntilDone ) 474 474 ret = 1; 475 475 else … … 483 483 484 484 case COL_SENT: 485 if( sa->uploaded < sb->uploaded)485 if( sa->uploadedEver < sb->uploadedEver ) 486 486 ret = -1; 487 else if( sa->uploaded > sb->uploaded)487 else if( sa->uploadedEver > sb->uploadedEver ) 488 488 ret = 1; 489 489 else
Note: See TracChangeset
for help on using the changeset viewer.