diff --git a/src/proto_tcp.c b/src/proto_tcp.c index 4691e165a..2e5c36a51 100644 --- a/src/proto_tcp.c +++ b/src/proto_tcp.c @@ -603,6 +603,9 @@ int tcp_bind_listener(struct listener *listener, char *errmsg, int errlen) 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) @@ -723,6 +726,7 @@ int tcp_bind_listener(struct listener *listener, char *errmsg, int errlen) setsockopt(fd, IPPROTO_TCP, TCP_QUICKACK, &one, sizeof(one)); #endif + done: /* the socket is ready */ listener_set_state(listener, LI_LISTEN); goto tcp_return; diff --git a/src/proto_uxst.c b/src/proto_uxst.c index ed1fa53ef..7988e00d1 100644 --- a/src/proto_uxst.c +++ b/src/proto_uxst.c @@ -124,6 +124,9 @@ static int uxst_bind_listener(struct listener *listener, char *errmsg, int errle goto uxst_return; } + if (listener->rx.flags & RX_F_MUST_DUP) + goto done; + fd = listener->rx.fd; ready = sock_accepting_conn(&listener->rx) > 0; @@ -134,6 +137,7 @@ static int uxst_bind_listener(struct listener *listener, char *errmsg, int errle goto uxst_close_return; } + done: /* the socket is now listening */ listener_set_state(listener, LI_LISTEN); return err;