ssnet: throw a nicer-looking Fatal when the mux connection dies.

When it happens, it's probably because the client died and the server hasn't
noticed yet.
This commit is contained in:
Avery Pennarun 2010-05-02 20:53:29 -04:00
parent a21e8c7a3c
commit 7d674e9e37

View File

@ -287,7 +287,10 @@ class Mux(Handler):
def fill(self):
self.rsock.setblocking(False)
b = _nb_clean(os.read, self.rsock.fileno(), 32768)
try:
b = _nb_clean(os.read, self.rsock.fileno(), 32768)
except OSError, e:
raise Fatal('other end: %r' % e)
#log('<<< %r\n' % b)
if b == '': # EOF
self.ok = False