[svn r131] Fix for some SwitchingToDeadGreenlet or TypeError: '_socketobject' object is not iterable exceptions: Passing both read=True and write=True to trampoline would cause the fd to select as both readable and writable in some error conditions. This would cause the greenlet to be spuriously resumed a second time. (commit comment stolen from donovan)
This commit is contained in:
@@ -154,13 +154,13 @@ class wrapped_fd(object):
|
||||
client, addr = res
|
||||
util.set_nonblocking(client)
|
||||
return type(self)(client), addr
|
||||
trampoline(fd, read=True, write=True)
|
||||
trampoline(fd, read=True)
|
||||
|
||||
def connect(self, address):
|
||||
fd = self.fd
|
||||
connect = util.socket_connect
|
||||
while not connect(fd, address):
|
||||
trampoline(fd, read=True, write=True)
|
||||
trampoline(fd, write=True)
|
||||
|
||||
recv = higher_order_recv(util.socket_recv)
|
||||
|
||||
|
Reference in New Issue
Block a user