ext/kgio/accept.c in kgio-2.10.0 vs ext/kgio/accept.c in kgio-2.11.0
- old
+ new
@@ -158,10 +158,16 @@
rb_raise(rb_eRuntimeError, "getnameinfo: %s", gai_strerror(rc));
rb_str_set_len(host, strlen(host_ptr));
return rb_ivar_set(io, iv_kgio_addr, host);
}
+#if defined(__linux__)
+# define post_accept kgio_autopush_accept
+#else
+# define post_accept(a,b) for(;0;)
+#endif
+
static VALUE
my_accept(struct accept_args *a, int force_nonblock)
{
int client_fd;
VALUE client_io;
@@ -203,9 +209,10 @@
default:
rb_sys_fail("accept");
}
}
client_io = sock_for_fd(a->accepted_class, client_fd);
+ post_accept(a->accept_io, client_io);
if (a->addr)
in_addr_set(client_io,
(struct sockaddr_storage *)a->addr, *a->addrlen);
else