From 26d6b50e3eab857678af1dcbaf88e715837f7036 Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Mon, 25 Oct 2010 21:06:45 +0200 Subject: [PATCH] check error before incoming or outgoing events. Fixes #5991 --- src/common/xmpp/idlequeue.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/common/xmpp/idlequeue.py b/src/common/xmpp/idlequeue.py index 1b0bccb04..d2107af18 100644 --- a/src/common/xmpp/idlequeue.py +++ b/src/common/xmpp/idlequeue.py @@ -388,20 +388,22 @@ class IdleQueue: self.unplug_idle(fd) return False + if flags & IS_CLOSED: + # io error, don't expect more events + self.remove_timeout(obj.fd) + self.unplug_idle(obj.fd) + obj.pollend() + return False + if flags & PENDING_READ: #print 'waiting read on %d, flags are %d' % (fd, flags) obj.pollin() return True - elif flags & PENDING_WRITE: + if flags & PENDING_WRITE: obj.pollout() return True - elif flags & IS_CLOSED: - # io error, don't expect more events - self.remove_timeout(obj.fd) - self.unplug_idle(obj.fd) - obj.pollend() return False def process(self):