summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/socket/ipsocket.c9
-rw-r--r--ext/socket/rubysocket.h3
2 files changed, 3 insertions, 9 deletions
diff --git a/ext/socket/ipsocket.c b/ext/socket/ipsocket.c
index 8a64a26b24..013294480f 100644
--- a/ext/socket/ipsocket.c
+++ b/ext/socket/ipsocket.c
@@ -226,7 +226,6 @@ struct fast_fallback_inetsock_arg
int *families;
int family_size;
int additional_flags;
- rb_nativethread_lock_t *lock;
struct fast_fallback_getaddrinfo_entry *getaddrinfo_entries[2];
struct fast_fallback_getaddrinfo_shared *getaddrinfo_shared;
int wait;
@@ -601,8 +600,6 @@ init_fast_fallback_inetsock_internal(VALUE v)
rb_nativethread_lock_initialize(arg->getaddrinfo_shared->lock);
arg->getaddrinfo_shared->notify = hostname_resolution_notifier;
- arg->getaddrinfo_shared->connection_attempt_fds = arg->connection_attempt_fds;
- arg->getaddrinfo_shared->connection_attempt_fds_size = arg->connection_attempt_fds_size;
arg->getaddrinfo_shared->cancelled = false;
wait_arg.cancelled = &arg->getaddrinfo_shared->cancelled;
@@ -620,7 +617,6 @@ init_fast_fallback_inetsock_internal(VALUE v)
if (arg->family_size == 1) {
arg->getaddrinfo_shared->node = NULL;
arg->getaddrinfo_shared->service = NULL;
- arg->getaddrinfo_shared->refcount = 1;
int family = arg->families[0];
arg->remote.res = rsock_addrinfo(
@@ -1007,9 +1003,7 @@ init_fast_fallback_inetsock_internal(VALUE v)
if (connected_fd >= 0) break;
if (!in_progress_fds(arg->connection_attempt_fds_size)) {
- if (any_addrinfos(&resolution_store)) {
- connection_attempt_delay_expires_at = NULL;
- } else if (resolution_store.is_all_finised) {
+ if (!any_addrinfos(&resolution_store) && resolution_store.is_all_finised) {
if (local_status < 0) {
host = arg->local.host;
serv = arg->local.serv;
@@ -1023,6 +1017,7 @@ init_fast_fallback_inetsock_internal(VALUE v)
rsock_syserr_fail_host_port(last_error.ecode, syscall, host, serv);
}
}
+ connection_attempt_delay_expires_at = NULL;
user_specified_connect_timeout_at = NULL;
}
}
diff --git a/ext/socket/rubysocket.h b/ext/socket/rubysocket.h
index d1ea3f98b7..16cc75aa7b 100644
--- a/ext/socket/rubysocket.h
+++ b/ext/socket/rubysocket.h
@@ -440,9 +440,8 @@ struct fast_fallback_getaddrinfo_entry
struct fast_fallback_getaddrinfo_shared
{
- int notify, refcount, connection_attempt_fds_size;
+ int notify, refcount;
int cancelled;
- int *connection_attempt_fds;
char *node, *service;
rb_nativethread_lock_t *lock;
struct fast_fallback_getaddrinfo_entry getaddrinfo_entries[FLEX_ARY_LEN];