Ignore:
Timestamp:
Dec 6, 2006, 3:29:09 AM (15 years ago)
Author:
livings124
Message:

When trying next address in sublist, move it to the front of the sublist.

File:
1 edited

Legend:

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

    r1155 r1156  
    283283    const char   * data;
    284284    int            len, i;
    285     tr_announce_list_item_t * announceItem;
     285    tr_announce_list_item_t * announceItem, * prevAnnounceItem, * tempAnnounceItem;
    286286
    287287    if( ( NULL == tc->http ) && shouldConnect( tc ) )
     
    294294            for( i = 0; i <= tc->announceTierLast; i++ )
    295295            {
     296                prevAnnounceItem = announceItem;
    296297                announceItem = announceItem->nextItem;
    297298            }
     
    302303               
    303304                /* Move address to front of tier in announce list */
     305                prevAnnounceItem->nextItem = announceItem->nextItem;
     306               
     307                tempAnnounceItem = calloc( sizeof( tr_announce_list_item_t ), 1 );
     308                *tempAnnounceItem = inf->trackerAnnounceList[tc->announceTier];
     309                inf->trackerAnnounceList[tc->announceTier] = *announceItem;
     310                inf->trackerAnnounceList[tc->announceTier].nextItem = tempAnnounceItem;
     311               
     312                free( announceItem );
    304313            }
    305314            else
Note: See TracChangeset for help on using the changeset viewer.