eis: immediately disconnect a client without the ei_connection interface

No point going through the setup here, just disconnect immediately.
This commit is contained in:
Peter Hutterer 2023-02-14 09:31:56 +10:00
parent 619b83220d
commit a80b19bb2c

View file

@ -86,23 +86,24 @@ static int
client_msg_done(struct eis_connection_setup *setup)
{
struct eis_client *client = eis_connection_setup_get_client(setup);
int rc = -EPROTO;
if (setup->client_versions.ei_connection != 0) {
eis_client_setup_done(client, setup->name, setup->is_sender, &setup->client_versions);
rc = 0;
}
/* Required interfaces - immediate disconnection if missing */
if (setup->client_versions.ei_connection == 0)
return -EPROTO;
eis_client_setup_done(client, setup->name, setup->is_sender, &setup->client_versions);
client->connection = eis_connection_new(client);
eis_connection_setup_event_connection(setup, eis_connection_get_id(client->connection),
eis_connection_get_version(client->connection));
eis_connection_setup_unref(setup);
client->setup = eis_connection_setup_unref(setup);
/* Force a ping/pong. This isn't necessary but it doesn't hurt much here
* and it ensures that any client implementation doesn't have that part missing */
eis_connection_ping(client->connection, pong, NULL);
return rc;
return 0;
}
static int