pulse-server: move parts of client creation

Move some portions of the client creation logic into client.c
so that it is easier to keep it in sync with `client_free()`, etc.
This commit is contained in:
Barnabás Pőcze 2021-11-11 23:24:41 +01:00 committed by Wim Taymans
parent 9c218b2d08
commit 6d2e6fde75
3 changed files with 26 additions and 13 deletions

View file

@ -379,22 +379,10 @@ on_connect(void *data, int fd, uint32_t mask)
goto error;
}
client = calloc(1, sizeof(*client));
client = client_new(server);
if (client == NULL)
goto error;
client->impl = impl;
client->ref = 1;
client->connect_tag = SPA_ID_INVALID;
client->server = server;
spa_list_append(&server->clients, &client->link);
server->n_clients++;
pw_map_init(&client->streams, 16, 16);
spa_list_init(&client->out_messages);
spa_list_init(&client->operations);
spa_list_init(&client->pending_samples);
spa_list_init(&client->pending_streams);
pw_log_debug("server %p: new client %p fd:%d", server, client, client_fd);
client->source = pw_loop_add_io(impl->loop,