Ignore:
Timestamp:
Mar 18, 2008, 4:56:01 PM (14 years ago)
Author:
charles
Message:

changes to message logging: (1) bring back "Torrent hasn't responded yet", but only in the message log. (2) make PEX messages debug. (3) log a message when a torrent reaches completion.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/torrent.c

    r5284 r5285  
    10481048**/
    10491049
     1050static const char *
     1051getCompletionString( int type )
     1052{
     1053    switch( type )
     1054    {
     1055        case TR_CP_DONE:     return _( "Done" );
     1056        case TR_CP_COMPLETE: return _( "Complete" );
     1057        default:             return _( "Incomplete" );
     1058    }
     1059}
     1060
    10501061static void
    10511062fireStatusChange( tr_torrent * tor, cp_status_t status )
     
    10821093
    10831094    cpStatus = tr_cpGetStatus( tor->completion );
    1084     if( cpStatus != tor->cpStatus ) {
     1095
     1096    if( cpStatus != tor->cpStatus )
     1097    {
     1098        const int recentChange = tor->downloadedCur != 0;
     1099
     1100        if( recentChange )
     1101        {
     1102            tr_torinf( tor, _( "State changed from \"%s\" to \"%s\"" ),
     1103                            getCompletionString( tor->cpStatus ),
     1104                            getCompletionString( cpStatus ) );
     1105        }
     1106
    10851107        tor->cpStatus = cpStatus;
    10861108        fireStatusChange( tor, cpStatus );
    1087         if( (cpStatus == TR_CP_COMPLETE) /* ...and if we're complete */
    1088             && tor->downloadedCur ) {        /* and it just happened */
    1089             tr_trackerCompleted( tor->tracker ); /* tell the tracker */
    1090         }
     1109
     1110        if( recentChange && ( cpStatus == TR_CP_COMPLETE ) )
     1111            tr_trackerCompleted( tor->tracker );
     1112
    10911113        saveFastResumeNow( tor );
    10921114    }
     1115
    10931116    tr_torrentUnlock( tor );
    10941117}
Note: See TracChangeset for help on using the changeset viewer.