mirror of
https://github.com/sshuttle/sshuttle.git
synced 2024-11-25 09:23:48 +01:00
server.py: handle (throw away) ECONNREFUSED from the DNS server.
This might happen occasionally on a flakey network. Reported by Ed Maste.
This commit is contained in:
parent
2e8381ecda
commit
cfb2592346
@ -119,7 +119,14 @@ class DnsProxy(Handler):
|
||||
self.sock.send(request)
|
||||
|
||||
def callback(self):
|
||||
data = self.sock.recv(4096)
|
||||
try:
|
||||
data = self.sock.recv(4096)
|
||||
except socket.error, e:
|
||||
if e.args[0] == errno.ECONNREFUSED:
|
||||
debug2('DNS response: ignoring ECONNREFUSED.\n')
|
||||
return # might have been spurious; wait for a real answer
|
||||
else:
|
||||
raise
|
||||
debug2('DNS response: %d bytes\n' % len(data))
|
||||
self.mux.send(self.chan, ssnet.CMD_DNS_RESPONSE, data)
|
||||
self.ok = False
|
||||
|
Loading…
Reference in New Issue
Block a user