From b7f1530aefc6272d02a9a1d7e9ccfc393089a01c Mon Sep 17 00:00:00 2001 From: Avery Pennarun Date: Wed, 12 Jan 2011 09:18:17 -0800 Subject: [PATCH] Remember which syscall got a particular stream-killing error. --- ssnet.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ssnet.py b/ssnet.py index c325d76..b5723bf 100644 --- a/ssnet.py +++ b/ssnet.py @@ -151,7 +151,7 @@ class SockWrapper: try: self.wsock.shutdown(SHUT_WR) except socket.error, e: - self.seterr(e) + self.seterr('nowrite: %s' % e) def too_full(self): return False # fullness is determined by the socket's select() state @@ -164,7 +164,7 @@ class SockWrapper: return _nb_clean(os.write, self.wsock.fileno(), buf) except OSError, e: # unexpected error... stream is dead - self.seterr(e) + self.seterr('uwrite: %s' % e) return 0 def write(self, buf): @@ -180,7 +180,7 @@ class SockWrapper: try: return _nb_clean(os.read, self.rsock.fileno(), 65536) except OSError, e: - self.seterr(e) + self.seterr('uread: %s' % e) return '' # unexpected error... we'll call it EOF def fill(self):