check error before incoming or outgoing events. Fixes #5991
This commit is contained in:
parent
1d8d6a4542
commit
26d6b50e3e
|
@ -388,20 +388,22 @@ class IdleQueue:
|
||||||
self.unplug_idle(fd)
|
self.unplug_idle(fd)
|
||||||
return False
|
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:
|
if flags & PENDING_READ:
|
||||||
#print 'waiting read on %d, flags are %d' % (fd, flags)
|
#print 'waiting read on %d, flags are %d' % (fd, flags)
|
||||||
obj.pollin()
|
obj.pollin()
|
||||||
return True
|
return True
|
||||||
|
|
||||||
elif flags & PENDING_WRITE:
|
if flags & PENDING_WRITE:
|
||||||
obj.pollout()
|
obj.pollout()
|
||||||
return True
|
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
|
return False
|
||||||
|
|
||||||
def process(self):
|
def process(self):
|
||||||
|
|
Loading…
Reference in New Issue