mirror of
https://github.com/sshuttle/sshuttle.git
synced 2025-08-09 15:54:56 +02:00
Handle EHOSTDOWN, ENETDOWN.
Someone on the mailing list reported getting these. Also centralize the list of these errors, so we don't have different parts of the code supporting a different subset of them. Now just use ssnet.NET_ERRS.
This commit is contained in:
@ -130,7 +130,7 @@ class DnsProxy(Handler):
|
||||
try:
|
||||
self.sock.send(self.request)
|
||||
except socket.error, e:
|
||||
if e.args[0] in [errno.ECONNREFUSED, errno.EHOSTUNREACH]:
|
||||
if e.args[0] in ssnet.NET_ERRS:
|
||||
# might have been spurious; try again.
|
||||
# Note: these errors sometimes are reported by recv(),
|
||||
# and sometimes by send(). We have to catch both.
|
||||
@ -145,7 +145,7 @@ class DnsProxy(Handler):
|
||||
try:
|
||||
data = self.sock.recv(4096)
|
||||
except socket.error, e:
|
||||
if e.args[0] in [errno.ECONNREFUSED, errno.EHOSTUNREACH]:
|
||||
if e.args[0] in ssnet.NET_ERRS:
|
||||
# might have been spurious; try again.
|
||||
# Note: these errors sometimes are reported by recv(),
|
||||
# and sometimes by send(). We have to catch both.
|
||||
|
Reference in New Issue
Block a user