diff --git a/src/libeis-connection-setup.c b/src/libeis-connection-setup.c index 3f09aab..60b9ca1 100644 --- a/src/libeis-connection-setup.c +++ b/src/libeis-connection-setup.c @@ -99,11 +99,18 @@ client_msg_done(struct eis_connection_setup *setup) eis_connection_setup_event_connection(setup, eis_connection_get_id(client->connection), eis_connection_get_version(client->connection)); - client->setup = eis_connection_setup_unref(setup); + /* These aren't required but libei is pointless without them, so let's enforce them + * by establishing the connection and immediately sending the disconnect */ + if (setup->client_versions.ei_seat == 0 || + setup->client_versions.ei_device == 0) { + eis_client_disconnect(client); + } else { + /* 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); + } - /* 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); + client->setup = eis_connection_setup_unref(setup); return 0; }