diff --git a/txupnp/__init__.py b/txupnp/__init__.py index b7dc9ef..71c452f 100644 --- a/txupnp/__init__.py +++ b/txupnp/__init__.py @@ -1,4 +1,4 @@ -__version__ = "0.0.1a7" +__version__ = "0.0.1a8" __name__ = "txupnp" __author__ = "Jack Robison" __maintainer__ = "Jack Robison" diff --git a/txupnp/scpd.py b/txupnp/scpd.py index ec0b6d7..0c8da65 100644 --- a/txupnp/scpd.py +++ b/txupnp/scpd.py @@ -385,6 +385,7 @@ class UPnPFallback(object): raise NotImplementedError() @return_types(none_or_str, int, str, int, str, bool, str, int) + @defer.inlineCallbacks def GetGenericPortMappingEntry(self, NewPortMappingIndex): """ Returns (NewRemoteHost, NewExternalPort, NewProtocol, NewInternalPort, NewInternalClient, NewEnabled, @@ -392,7 +393,11 @@ class UPnPFallback(object): """ if not self.available: raise NotImplementedError() - return threads.deferToThread(self._upnp.getgenericportmapping, NewPortMappingIndex) + result = yield threads.deferToThread(self._upnp.getgenericportmapping, NewPortMappingIndex) + if not result: + raise UPnPError() + ext_port, protocol, (int_host, int_port), desc, enabled, remote_host, lease = result + defer.returnValue((remote_host, ext_port, protocol, int_port, int_host, enabled, desc, lease)) @return_types(int, str, bool, str, int) def GetSpecificPortMappingEntry(self, NewRemoteHost, NewExternalPort, NewProtocol):