Changeset 1213


Ignore:
Timestamp:
Dec 14, 2006, 6:47:01 AM (15 years ago)
Author:
livings124
Message:

fix and improvement

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/multitracker/libtransmission/tracker.c

    r1212 r1213  
    186186static void failureAnnouncing( tr_tracker_t * tc )
    187187{
     188    tr_torrent_t * tor = tc->tor;
    188189    tr_info_t    * inf = &tor->info;
    189190   
     
    296297{
    297298    tr_torrent_t * tor = tc->tor;
     299    tr_info_t    * inf = &tor->info;
    298300    const char   * data;
    299301    int            len, i;
     
    308310            tr_inf( "Tracker: failed to connect to %s, trying next", tc->trackerAddress );
    309311           
    310             prevAnnouncePtr = tc->trackerAnnounceListPtr[tc->announceTier];
    311             announcePtr = prevAnnouncePtr->nextItem;
    312             for( i = 0; i < tc->announceTierLast; i++ )
     312            if( tc->announceTierLast + 1 < inf->trackerList[tc->announceTier].count )
    313313            {
    314                 prevAnnouncePtr = announcePtr;
    315                 announcePtr = announcePtr->nextItem;
    316             }
    317            
    318             if( announcePtr != NULL )
    319             {
    320                 tc->announceTierLast++;
     314                prevAnnouncePtr = tc->trackerAnnounceListPtr[tc->announceTier];
     315                announcePtr = prevAnnouncePtr->nextItem;
     316                for( i = 0; i < tc->announceTierLast; i++ )
     317                {
     318                    prevAnnouncePtr = announcePtr;
     319                    announcePtr = announcePtr->nextItem;
     320                }
    321321               
    322322                /* Move address to front of tier in announce list */
     
    324324                announcePtr->nextItem =  tc->trackerAnnounceListPtr[tc->announceTier];
    325325                tc->trackerAnnounceListPtr[tc->announceTier] = announcePtr;
     326               
     327                tc->announceTierLast++;
    326328            }
    327329            else
Note: See TracChangeset for help on using the changeset viewer.