From 42246f83ef1bb055a5705659ffe0a3117703159a Mon Sep 17 00:00:00 2001 From: Peter Surda Date: Tue, 28 Feb 2017 01:15:49 +0100 Subject: [PATCH] Reset connection list on UPnP - reset the already attempted connection list after UPnP port mapping is established. This allows to resubmit externally reachable port --- src/upnp.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/upnp.py b/src/upnp.py index ae93de6a..6c245345 100644 --- a/src/upnp.py +++ b/src/upnp.py @@ -220,6 +220,11 @@ class uPnPThread(threading.Thread, StoppableThread): self.routers.append(newRouter) self.createPortMapping(newRouter) 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 except socket.timeout as e: pass