From 8f652ef0e60a5bcf4d2db80e9c527667992b34ad Mon Sep 17 00:00:00 2001 From: mailchuck Date: Sat, 21 Nov 2015 10:15:20 +0100 Subject: [PATCH] UPnP logging improvlement --- src/upnp.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/upnp.py b/src/upnp.py index b3ce48f1..ec09bc32 100644 --- a/src/upnp.py +++ b/src/upnp.py @@ -25,6 +25,7 @@ def searchRouter(): sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) sock.setsockopt(socket.IPPROTO_IP, socket.IP_MULTICAST_TTL, 2) sock.settimeout(2) + logger.debug("Sending UPnP query") sock.sendto(ssdpRequest, (SSDP_ADDR, SSDP_PORT)) except: logger.exception("UPnP sock failed") @@ -160,10 +161,12 @@ class Router: return resp def DeletePortMapping(self, externalPort, protocol): + from debug import logger resp = self.soapRequest('WANIPConnection:1', 'DeletePortMapping', [ ('NewExternalPort', str(externalPort)), ('NewProtocol', protocol), ]) + logger.info("Removed UPnP mapping on external port %i", extPort) return resp def GetExternalIPAddress(self):