Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

server.py: handle (throw away) ECONNREFUSED from the DNS server.

This might happen occasionally on a flakey network.  Reported by Ed Maste.
  • Loading branch information...
commit cfb2592346d206c9f0b7307375665a5697e86043 1 parent 2e8381e
@apenwarr apenwarr authored
Showing with 8 additions and 1 deletion.
  1. +8 −1 server.py
View
9 server.py
@@ -119,7 +119,14 @@ def __init__(self, mux, chan, request):
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
Please sign in to comment.
Something went wrong with that request. Please try again.