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:
parent
d4baaede82
commit
f37f992086
1 changed files with 5 additions and 2 deletions
|
@ -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];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue