The master process passes two pipes to anvil as listen fds: nonblocking_fd
for KILL notifications from the master itself, and blocking_fd shared by
all service processes for CONNECT/DISCONNECT/KILL. Only the first one was
detected as the master FIFO via listen_fd == MASTER_LISTEN_FD_FIRST, so
connections from service processes arriving via blocking_fd were
classified as regular admin connections.
This had no visible effect previously, but later commits restrict
CONNECT/DISCONNECT/KILL to the shared FIFO connection type, which would
reject these commands from service processes.
Use conn->fifo instead, which is TRUE for both master pipes and never
set for unix listeners that anvil currently has.
static void client_connected(struct master_service_connection *conn)
{
- /* The first listen_fd is a pipe connected directly to the master
- process. It's not actually the first configured listener in the
- service settings. */
+ /* The master process passes two pipes to anvil as the first listen
+ fds: one for KILL notifications from the master itself, and one
+ shared by all service processes for CONNECT/DISCONNECT/KILL. Both
+ arrive here as fifo connections and use the same connection type. */
enum anvil_connection_type type;
- if (conn->listen_fd == MASTER_LISTEN_FD_FIRST)
+ if (conn->fifo)
type = ANVIL_CONNECTION_TYPE_MASTER;
else {
const char *type_str = master_service_connection_get_type(conn);