File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -152,6 +152,17 @@ def try_connect(self):
152
152
debug3 ('%r: fixed connect result: %s\n ' % (self , e ))
153
153
if e .args [0 ] in [errno .EINPROGRESS , errno .EALREADY ]:
154
154
pass # not connected yet
155
+ elif e .args [0 ] == 0 :
156
+ # connected successfully (weird Linux bug?)
157
+ # Sometimes Linux seems to return EINVAL when it isn't
158
+ # invalid. This *may* be caused by a race condition
159
+ # between connect() and getsockopt(SO_ERROR) (ie. it
160
+ # finishes connecting in between the two, so there is no
161
+ # longer an error). However, I'm not sure of that.
162
+ #
163
+ # I did get at least one report that the problem went away
164
+ # when we added this, however.
165
+ self .connect_to = None
155
166
elif e .args [0 ] == errno .EISCONN :
156
167
# connected successfully (BSD)
157
168
self .connect_to = None
You can’t perform that action at this time.
0 commit comments