Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit aa797a0

Browse files
committed
Reset nfds in every loop
1 parent c089a52 commit aa797a0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ext/socket/ipsocket.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,6 @@ init_fast_fallback_inetsock_internal(VALUE v)
572572
struct wait_fast_fallback_arg wait_arg;
573573
struct timeval *ends_at = NULL;
574574
struct timeval delay = (struct timeval){ -1, -1 };
575-
wait_arg.nfds = 0;
576575
wait_arg.writefds = NULL;
577576
wait_arg.status = 0;
578577

@@ -916,6 +915,7 @@ init_fast_fallback_inetsock_internal(VALUE v)
916915
wait_arg.delay = NULL;
917916
}
918917

918+
wait_arg.nfds = 0;
919919
if (arg->connection_attempt_fds_size) {
920920
FD_ZERO(wait_arg.writefds);
921921
int n = 0;

0 commit comments

Comments
 (0)