[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:
which.linden
2008-06-25 11:53:37 -07:00
parent a5015a6e7d
commit c138b433d8

View File

@@ -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)