allow skipping straight to miniupnpc fallback

This commit is contained in:
Jack Robison 2018-08-07 18:39:16 -04:00
parent 626ebd9b27
commit cab039a9db
No known key found for this signature in database
GPG key ID: DF25C68FE0239BB2

View file

@ -45,7 +45,11 @@ class UPnP(object):
return self.soap_manager.sspd_factory.m_search(address, timeout=timeout, max_devices=max_devices) return self.soap_manager.sspd_factory.m_search(address, timeout=timeout, max_devices=max_devices)
@defer.inlineCallbacks @defer.inlineCallbacks
def discover(self, timeout=1, max_devices=1, keep_listening=False): def discover(self, timeout=1, max_devices=1, keep_listening=False, try_txupnp=True):
found = False
if not try_txupnp and not self.try_miniupnpc_fallback:
log.warning("nothing left to try")
if try_txupnp:
try: try:
yield self.soap_manager.discover_services(timeout=timeout, max_devices=max_devices) yield self.soap_manager.discover_services(timeout=timeout, max_devices=max_devices)
found = True found = True