allow skipping straight to miniupnpc fallback
This commit is contained in:
parent
626ebd9b27
commit
cab039a9db
1 changed files with 13 additions and 9 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue