/* copied from master_settings: */
ARRAY_TYPE(const_string) listen;
bool ssl;
- bool reuse_port;
bool haproxy;
};
ARRAY_DEFINE_TYPE(inet_listener_settings, struct inet_listener_settings *);
const char *chroot;
bool drop_priv_before_exec;
+ bool reuse_port;
unsigned int process_min_avail;
unsigned int process_limit;
DEF(STR, type),
DEF(IN_PORT, port),
DEF(BOOL, ssl),
- DEF(BOOL, reuse_port),
DEF(BOOL, haproxy),
SETTING_DEFINE_LIST_END
.type = "",
.port = 0,
.ssl = FALSE,
- .reuse_port = FALSE,
.haproxy = FALSE
};
DEF(STR, chroot),
DEF(BOOL, drop_priv_before_exec),
+ DEF(BOOL, reuse_port),
DEF(UINT, process_min_avail),
DEF(UINT, process_limit),
.chroot = "",
.drop_priv_before_exec = FALSE,
+ .reuse_port = FALSE,
.process_min_avail = 0,
.process_limit = 0,
if (fd == -1)
#endif
{
- if (set->reuse_port)
+ if (service->set->reuse_port)
flags |= NET_LISTEN_FLAG_REUSEPORT;
fd = net_listen_full(&l->set.inetset.ip, &port, &flags,
service_get_backlog(service));
l->inet_address, set->port);
return errno == EADDRINUSE ? 0 : -1;
}
- l->reuse_port = (flags & NET_LISTEN_FLAG_REUSEPORT) != 0;
}
net_set_nonblock(fd, TRUE);
fd_close_on_exec(fd, TRUE);
listeners = array_get(&service->listeners, &count);
for (i = 0; i < count; i++) {
- if (!listeners[i]->reuse_port || listeners[i]->fd == -1)
+ if (!service->set->reuse_port || listeners[i]->fd == -1)
continue;
old_fd = listeners[i]->fd;
struct ip_addr ip;
} inetset;
} set;
-
- bool reuse_port;
};
struct service {