server: proxy: register input and update callbacks in post connect

To avoid a race in which the server received an input event before
proxy's client is initialized, we now only register input and update
callbacks after client is initialized and safe to use.
This commit is contained in:
kubistika 2019-09-25 16:10:04 +03:00 committed by akallabeth
parent 4d175f6008
commit f4d169fb75
1 changed files with 2 additions and 2 deletions

View File

@ -179,6 +179,8 @@ static BOOL pf_server_post_connect(freerdp_peer* client)
return FALSE;
}
pf_server_register_input_callbacks(client->input);
pf_server_register_update_callbacks(client->update);
return TRUE;
}
@ -254,8 +256,6 @@ static DWORD WINAPI pf_server_handle_client(LPVOID arg)
client->PostConnect = pf_server_post_connect;
client->Activate = pf_server_activate;
client->AdjustMonitorsLayout = pf_server_adjust_monitor_layout;
pf_server_register_input_callbacks(client->input);
pf_server_register_update_callbacks(client->update);
client->settings->MultifragMaxRequestSize = 0xFFFFFF; /* FIXME */
client->Initialize(client);
WLog_INFO(TAG, "Client connected: %s", client->local ? "(local)" : client->hostname);