fix implementation of connect_ex so it always returns the error code rather than raising
This commit is contained in:
@@ -195,11 +195,11 @@ class GreenSocket(object):
|
||||
else:
|
||||
end = time.time() + self.gettimeout()
|
||||
while True:
|
||||
try:
|
||||
if socket_connect(fd, address):
|
||||
return 0
|
||||
if time.time() >= end:
|
||||
raise socket.timeout(errno.EAGAIN)
|
||||
try:
|
||||
trampoline(fd, write=True, timeout=end-time.time(),
|
||||
timeout_exc=socket.timeout(errno.EAGAIN))
|
||||
except socket.error, ex:
|
||||
@@ -589,4 +589,3 @@ def serve(sock, handle, concurrency=1000):
|
||||
connections until the existing ones complete.
|
||||
"""
|
||||
pass
|
||||
|
||||
|
Reference in New Issue
Block a user