File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -114,6 +114,19 @@ static int handle_sockerr(GIT_SOCKET socket)
114114 return -1 ;
115115}
116116
117+ GIT_INLINE (bool ) connect_would_block (int error )
118+ {
119+ #ifdef GIT_WIN32
120+ if (error == SOCKET_ERROR && WSAGetLastError () == WSAEWOULDBLOCK )
121+ return true;
122+ #endif
123+
124+ if (error == -1 && errno == EINPROGRESS )
125+ return true;
126+
127+ return false;
128+ }
129+
117130static int connect_with_timeout (
118131 GIT_SOCKET socket ,
119132 const struct sockaddr * address ,
@@ -128,7 +141,7 @@ static int connect_with_timeout(
128141
129142 error = connect (socket , address , address_len );
130143
131- if (error == 0 || (error == -1 && errno != EINPROGRESS ))
144+ if (error == 0 || ! connect_would_block (error ))
132145 return error ;
133146
134147 fd .fd = socket ;
You can’t perform that action at this time.
0 commit comments