if (!s->accept)
return true;
- LIST_FOREACH(port, p, s->ports)
+ LIST_FOREACH(port, p, s->ports) {
+
+ if (p->type != SOCKET_SOCKET)
+ return true;
+
if (!socket_address_can_accept(&p->address))
return true;
+ }
return false;
}
if (!s->exec_command[c])
continue;
- fprintf(f, "%s→ %s:\n",
+ fprintf(f, "%s-> %s:\n",
prefix, socket_exec_command_to_string(c));
exec_command_dump_list(s->exec_command[c], f, prefix2);
if (p->fd < 0)
continue;
- p->fd_watch.data.socket_accept =
+ p->fd_watch.socket_accept =
s->accept &&
+ p->type == SOCKET_SOCKET &&
socket_address_can_accept(&p->address);
if ((r = unit_watch_fd(UNIT(s), p->fd, EPOLLIN, &p->fd_watch)) < 0)
socket_close_fds(s);
if (state != old_state)
- log_debug("%s changed %s → %s",
+ log_debug("%s changed %s -> %s",
s->meta.id,
socket_state_to_string(old_state),
socket_state_to_string(state));
}
}
- if (sent) {
+ if (sent && s->control_pid > 0) {
if ((r = unit_watch_timer(UNIT(s), s->timeout_usec, &s->timer_watch)) < 0)
goto fail;
goto fail;
}
- if (w->data.socket_accept) {
+ if (w->socket_accept) {
for (;;) {
if ((cfd = accept4(fd, NULL, NULL, SOCK_NONBLOCK)) < 0) {
}
}
- log_debug("cfd=%i", cfd);
socket_enter_running(s, cfd);
return;