We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e671b51 commit cc224f7Copy full SHA for cc224f7
main/network.c
@@ -407,6 +407,10 @@ PHPAPI int php_network_connect_socket(php_socket_t sockfd,
407
while (true) {
408
n = php_pollfd_for(sockfd, events, timeout ? &working_timeout : NULL);
409
if (n < 0) {
410
+#ifdef PHP_ASYNC_API
411
+ // We need to update the error information because we called some functions before this.
412
+ error = errno;
413
+#endif
414
if (errno == EINTR) {
415
#ifdef HAVE_GETTIMEOFDAY
416
if (timeout) {
@@ -440,7 +444,6 @@ PHPAPI int php_network_connect_socket(php_socket_t sockfd,
440
444
441
445
ok:
442
446
if (!asynchronous) {
443
- error = errno;
447
/* back to blocking mode */
448
RESTORE_SOCKET_BLOCKING_MODE(sockfd, orig_flags);
449
}
0 commit comments