Changeset 1559


Ignore:
Timestamp:
Mar 11, 2007, 3:37:14 AM (15 years ago)
Author:
livings124
Message:

divide a termination while loop to make it safer

Location:
branches/pex
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/pex/NEWS

    r1558 r1559  
    66 - Peer exchange (PEX) compatible with Azureus and uTorrent
    77 - Multitracker support
    8  - Listen to trackers announce and min-announce intervals
     8 - Listen to tracker's announce and min-announce intervals
    99 - Fix for sending invalid stats to trackers
    1010 - Better scrape support
  • branches/pex/macosx/Controller.m

    r1503 r1559  
    480480        return;
    481481
    482     //wait for running transfers to stop (5 second timeout) and for NAT to be disabled
     482    //wait for running transfers to stop (5 second timeout)
    483483    NSDate * start = [NSDate date];
    484484    BOOL timeUp = NO;
     
    486486    enumerator = [fTorrents objectEnumerator];
    487487    Torrent * torrent;
    488     while (!timeUp && ((torrent = [enumerator nextObject])
    489             || tr_handleStatus(fLib)->natTraversalStatus != TR_NAT_TRAVERSAL_DISABLED))
     488    while (!timeUp && (torrent = [enumerator nextObject]))
    490489        while (![torrent isPaused] && !(timeUp = [start timeIntervalSinceNow] < -5.0))
    491490        {
     
    493492            [torrent update];
    494493        }
     494   
     495    //wait for NAT to be disabled (5 second timeout)
     496    while (tr_handleStatus(fLib)->natTraversalStatus != TR_NAT_TRAVERSAL_DISABLED
     497            && !([start timeIntervalSinceNow] < -5.0))
     498        usleep(100000);
    495499}
    496500
Note: See TracChangeset for help on using the changeset viewer.