Changeset 3768


Ignore:
Timestamp:
Nov 9, 2007, 3:06:32 PM (14 years ago)
Author:
livings124
Message:

have libtransmission be in charge of checking if nat traversal is disabled when quitting

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/transmission.c

    r3763 r3768  
    300300    tr_rcClose( h->upload );
    301301    tr_rcClose( h->download );
     302   
     303    tr_natTraversalEnable( h, 0 );
     304    while( tr_handleStatus( h )->natTraversalStatus != TR_NAT_TRAVERSAL_DISABLED )
     305        tr_wait( 100 );
    302306
    303307    tr_sharedClose( h->shared );
  • trunk/macosx/Controller.m

    r3767 r3768  
    546546    [fTorrents removeAllObjects];
    547547   
    548     //disable NAT traversal
    549     tr_natTraversalEnable(fLib, 0);
    550    
    551548    //clear badge
    552549    [fBadger clearBadge];
    553    
    554     //wait for NAT to be disabled (5 second timeout)
    555     NSDate * startDate = [NSDate date];
    556    
    557     #warning do this in tr_close?
    558     while ([startDate timeIntervalSinceNow] >= -5.0 && tr_handleStatus(fLib)->natTraversalStatus != TR_NAT_TRAVERSAL_DISABLED)
    559         usleep(100000);
    560550   
    561551    //remaining calls the same as dealloc
  • trunk/macosx/PrefsController.m

    r3761 r3768  
    106106    [toolbar setDisplayMode: NSToolbarDisplayModeIconAndLabel];
    107107    [toolbar setSizeMode: NSToolbarSizeModeRegular];
     108    [toolbar setSelectedItemIdentifier: TOOLBAR_GENERAL];
    108109    [[self window] setToolbar: toolbar];
    109 
    110     [toolbar setSelectedItemIdentifier: TOOLBAR_GENERAL];
     110    [toolbar release];
     111   
    111112    [self setPrefView: nil];
    112113   
     
    241242    tr_handle_status * stat = tr_handleStatus(fHandle);
    242243   
    243     BOOL change;
    244     if (change = (fNatStatus != stat->natTraversalStatus))
     244    BOOL change = fNatStatus != stat->natTraversalStatus;
     245    if (change)
    245246    {
    246247        fNatStatus = stat->natTraversalStatus;
Note: See TracChangeset for help on using the changeset viewer.