Changeset 6739


Ignore:
Timestamp:
Sep 7, 2008, 8:33:10 PM (13 years ago)
Author:
titer
Message:

Also delay the port check if port forwarding was just disabled

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/PrefsController.m

    r6738 r6739  
    345345    const tr_port_forwarding fwd = tr_sessionGetPortForwarding(fHandle);
    346346    const int port = tr_sessionGetPeerPort(fHandle);
    347 
    348     if (fNatStatus != fwd || fPeerPort != port )
     347    BOOL natStatusChanged = (fNatStatus != fwd);
     348    BOOL peerPortChanged = (fPeerPort != port);
     349
     350    if (natStatusChanged || peerPortChanged)
    349351    {
    350352        fNatStatus = fwd;
     
    360362            [fPortChecker release];
    361363        }
    362         fPortChecker = [[PortChecker alloc] initForPort: fPeerPort delay: tr_sessionIsPortForwardingEnabled(fHandle) withDelegate: self];
     364        BOOL delay = natStatusChanged || tr_sessionIsPortForwardingEnabled(fHandle);
     365        fPortChecker = [[PortChecker alloc] initForPort: fPeerPort delay: delay withDelegate: self];
    363366    }
    364367}
Note: See TracChangeset for help on using the changeset viewer.