1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-26 17:47:37 +00:00

Also delay the port check if port forwarding was just disabled

This commit is contained in:
Eric Petit 2008-09-07 20:33:10 +00:00
parent d4baaede82
commit f37f992086

View file

@ -344,8 +344,10 @@ tr_handle * fHandle;
{ {
const tr_port_forwarding fwd = tr_sessionGetPortForwarding(fHandle); const tr_port_forwarding fwd = tr_sessionGetPortForwarding(fHandle);
const int port = tr_sessionGetPeerPort(fHandle); const int port = tr_sessionGetPeerPort(fHandle);
BOOL natStatusChanged = (fNatStatus != fwd);
BOOL peerPortChanged = (fPeerPort != port);
if (fNatStatus != fwd || fPeerPort != port ) if (natStatusChanged || peerPortChanged)
{ {
fNatStatus = fwd; fNatStatus = fwd;
fPeerPort = port; fPeerPort = port;
@ -359,7 +361,8 @@ tr_handle * fHandle;
[fPortChecker cancelProbe]; [fPortChecker cancelProbe];
[fPortChecker release]; [fPortChecker release];
} }
fPortChecker = [[PortChecker alloc] initForPort: fPeerPort delay: tr_sessionIsPortForwardingEnabled(fHandle) withDelegate: self]; BOOL delay = natStatusChanged || tr_sessionIsPortForwardingEnabled(fHandle);
fPortChecker = [[PortChecker alloc] initForPort: fPeerPort delay: delay withDelegate: self];
} }
} }