It's not strictly necessary, but it's still better to avoid setting
up the same socket multiple times when it's being duplicated to a few
FDs. We don't change that for inherited ones however since they may
really need to be set up, so we only skip duplicated ones.
goto tcp_return;
}
+ if (listener->rx.flags & RX_F_MUST_DUP)
+ goto done;
+
fd = listener->rx.fd;
if (listener->bind_conf->options & BC_O_NOLINGER)
setsockopt(fd, IPPROTO_TCP, TCP_QUICKACK, &one, sizeof(one));
#endif
+ done:
/* the socket is ready */
listener_set_state(listener, LI_LISTEN);
goto tcp_return;
goto uxst_return;
}
+ if (listener->rx.flags & RX_F_MUST_DUP)
+ goto done;
+
fd = listener->rx.fd;
ready = sock_accepting_conn(&listener->rx) > 0;
goto uxst_close_return;
}
+ done:
/* the socket is now listening */
listener_set_state(listener, LI_LISTEN);
return err;