Reset connection list on UPnP

- reset the already attempted connection list after UPnP port mapping is
  established. This allows to resubmit externally reachable port
This commit is contained in:
Peter Šurda 2017-02-28 01:15:49 +01:00
parent 59e1739136
commit 42246f83ef
Signed by untrusted user: PeterSurda
GPG Key ID: 0C5F50C0B5F37D87

View File

@ -220,6 +220,11 @@ class uPnPThread(threading.Thread, StoppableThread):
self.routers.append(newRouter) self.routers.append(newRouter)
self.createPortMapping(newRouter) self.createPortMapping(newRouter)
queues.UISignalQueue.put(('updateStatusBar', tr._translate("MainWindow",'UPnP port mapping established on port %1').arg(str(self.extPort)))) queues.UISignalQueue.put(('updateStatusBar', tr._translate("MainWindow",'UPnP port mapping established on port %1').arg(str(self.extPort))))
# retry connections so that the submitted port is refreshed
with shared.alreadyAttemptedConnectionsListLock:
shared.alreadyAttemptedConnectionsList.clear()
shared.alreadyAttemptedConnectionsListResetTime = int(
time.time())
break break
except socket.timeout as e: except socket.timeout as e:
pass pass