Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/util/UpnpPunch.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,16 @@ def _retrieve_igd_profile(url):
"""
Retrieve the device's UPnP profile.
"""

from lib.PySocks.socks import SOCKS5Error

try:
return urllib2.urlopen(url.geturl(), timeout=5).read()
except socket.error:
raise IGDError('IGD profile query timed out')
except SOCKS5Error:
logging.info("Warning: SOCKS server refused our UPnP request.")
raise IGDError('IGD profile query failed - SOCKS server failure')


def _get_first_child_data(node):
Expand Down