mirror of
https://github.com/sshuttle/sshuttle.git
synced 2024-11-29 11:23:09 +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)
|
self.sock.send(request)
|
||||||
|
|
||||||
def callback(self):
|
def callback(self):
|
||||||
|
try:
|
||||||
data = self.sock.recv(4096)
|
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))
|
debug2('DNS response: %d bytes\n' % len(data))
|
||||||
self.mux.send(self.chan, ssnet.CMD_DNS_RESPONSE, data)
|
self.mux.send(self.chan, ssnet.CMD_DNS_RESPONSE, data)
|
||||||
self.ok = False
|
self.ok = False
|
||||||
|
Loading…
Reference in New Issue
Block a user