Changeset 5285


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.

Location:
trunk/libtransmission
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/peer-msgs.c

    r5277 r5285  
    975975        const int n = sub->val.s.i / 6 ;
    976976        if( n )
    977             tr_torinf( tor, _( "Got %d peers from peer exchange" ), n );
     977            tr_tordbg( tor, _( "Got %d peers from peer exchange" ), n );
    978978        tr_peerMgrAddPeers( msgs->handle->peerMgr,
    979979                            tor->info.hash,
  • 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}
  • trunk/libtransmission/tracker.c

    r5244 r5285  
    163163***/
    164164
    165 static tr_tracker_info *
     165static const tr_tracker_info *
    166166getCurrentAddress( const tr_tracker * t )
    167167{
     
    296296    if( !req ) /* tracker didn't respond */
    297297    {
     298        tr_ninf( t->name, _( "Tracker hasn't responded yet.  Retrying..." ) );
    298299        moveToNextAddress = TRUE;
    299300    }
     
    349350            t->addressIndex = 0;
    350351        }
     352        else
     353        {
     354            const tr_tracker_info * n = getCurrentAddress( t );
     355            tr_ninf( t->name, _( "Trying next tracker \"%s:%d\"" ), n->address, n->port );
     356        }
    351357    }
    352358}
     
    685691    char * ret;
    686692
    687     char * ann = getCurrentAddress(t)->announce;
     693    const char * ann = getCurrentAddress(t)->announce;
    688694   
    689695    evbuffer_add_printf( buf, "%s"
Note: See TracChangeset for help on using the changeset viewer.