UPnP logging improvlement
This commit is contained in:
parent
1a80db354b
commit
8f652ef0e6
|
@ -25,6 +25,7 @@ def searchRouter():
|
||||||
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
||||||
sock.setsockopt(socket.IPPROTO_IP, socket.IP_MULTICAST_TTL, 2)
|
sock.setsockopt(socket.IPPROTO_IP, socket.IP_MULTICAST_TTL, 2)
|
||||||
sock.settimeout(2)
|
sock.settimeout(2)
|
||||||
|
logger.debug("Sending UPnP query")
|
||||||
sock.sendto(ssdpRequest, (SSDP_ADDR, SSDP_PORT))
|
sock.sendto(ssdpRequest, (SSDP_ADDR, SSDP_PORT))
|
||||||
except:
|
except:
|
||||||
logger.exception("UPnP sock failed")
|
logger.exception("UPnP sock failed")
|
||||||
|
@ -160,10 +161,12 @@ class Router:
|
||||||
return resp
|
return resp
|
||||||
|
|
||||||
def DeletePortMapping(self, externalPort, protocol):
|
def DeletePortMapping(self, externalPort, protocol):
|
||||||
|
from debug import logger
|
||||||
resp = self.soapRequest('WANIPConnection:1', 'DeletePortMapping', [
|
resp = self.soapRequest('WANIPConnection:1', 'DeletePortMapping', [
|
||||||
('NewExternalPort', str(externalPort)),
|
('NewExternalPort', str(externalPort)),
|
||||||
('NewProtocol', protocol),
|
('NewProtocol', protocol),
|
||||||
])
|
])
|
||||||
|
logger.info("Removed UPnP mapping on external port %i", extPort)
|
||||||
return resp
|
return resp
|
||||||
|
|
||||||
def GetExternalIPAddress(self):
|
def GetExternalIPAddress(self):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user