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.
@@ -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);
