refuse pair enable requests while session is running

This commit is contained in:
caszuu
2026-02-27 16:03:18 +01:00
committed by xytovl
parent b96833cc9b
commit 1903d5c910
2 changed files with 16 additions and 0 deletions
+9
View File
@@ -657,6 +657,15 @@ gboolean on_handle_rename_key(WivrnServer * skeleton, GDBusMethodInvocation * in
gboolean on_handle_enable_pairing(WivrnServer * skeleton, GDBusMethodInvocation * invocation, gpointer user_data)
{
bool server_running = server_watch != 0 or connection_thread;
if (server_running)
{
std::cerr << "Cannot enable pairing while session is active." << pin << std::endl;
g_dbus_method_invocation_return_value(invocation, g_variant_new("(s)", ""));
return G_SOURCE_CONTINUE;
}
set_encryption_state(wivrn_connection::encryption_state::pairing);
if (pairing_timeout)