Catch socket errors on uPnP punch
This commit is contained in:
parent
3774630476
commit
c9efcf7389
1 changed files with 2 additions and 1 deletions
|
@ -2,6 +2,7 @@ import logging
|
||||||
import urllib2
|
import urllib2
|
||||||
import re
|
import re
|
||||||
import time
|
import time
|
||||||
|
import socket
|
||||||
|
|
||||||
import gevent
|
import gevent
|
||||||
|
|
||||||
|
@ -70,7 +71,7 @@ class FileServer(ConnectionServer):
|
||||||
self.log.info("Trying to open port using UpnpPunch...")
|
self.log.info("Trying to open port using UpnpPunch...")
|
||||||
try:
|
try:
|
||||||
UpnpPunch.ask_to_open_port(self.port, 'ZeroNet', retries=3, protos=["TCP"])
|
UpnpPunch.ask_to_open_port(self.port, 'ZeroNet', retries=3, protos=["TCP"])
|
||||||
except (UpnpPunch.UpnpError, UpnpPunch.IGDError) as err:
|
except (UpnpPunch.UpnpError, UpnpPunch.IGDError, socket.error) as err:
|
||||||
self.log.error("UpnpPunch run error: %s" %
|
self.log.error("UpnpPunch run error: %s" %
|
||||||
Debug.formatException(err))
|
Debug.formatException(err))
|
||||||
return False
|
return False
|
||||||
|
|
Loading…
Reference in a new issue