Skip to content

Commit 07544a8

Browse files
author
Maurits Dijkstra
committed
Fix EINPROGRESS very rarely occurring in php_network_connect_socket in synchronous mode
1 parent 4a48729 commit 07544a8

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

main/network.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,11 @@ PHPAPI int php_network_connect_socket(php_socket_t sockfd,
365365
if (getsockopt(sockfd, SOL_SOCKET, SO_ERROR, (char*)&error, &len) != 0) {
366366
ret = -1;
367367
}
368+
if (error == EINPROGRESS) {
369+
/* Is leftover from the earlier connect call, since php_socket_errno
370+
* does not clear it. */
371+
error = 0;
372+
}
368373
} else {
369374
/* whoops: sockfd has disappeared */
370375
ret = -1;

0 commit comments

Comments
 (0)