From 7d674e9e37e60391a9355a6217d5c3da68ff41b5 Mon Sep 17 00:00:00 2001 From: Avery Pennarun Date: Sun, 2 May 2010 20:53:29 -0400 Subject: [PATCH] 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. --- ssnet.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ssnet.py b/ssnet.py index 4477dd9..d9cfae5 100644 --- a/ssnet.py +++ b/ssnet.py @@ -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