[fix] only receive remote host info once

This commit is contained in:
dijunkun
2025-06-03 10:33:32 +08:00
parent 094204361c
commit 383ace2493
3 changed files with 3 additions and 3 deletions

View File

@@ -62,7 +62,6 @@ int MouseController::SendMouseCommand(RemoteAction remote_action,
ip.mi.time = 0;
SetCursorPos(ip.mi.dx, ip.mi.dy);
LOG_ERROR("mouse {}x{}", ip.mi.dx, ip.mi.dy);
if (ip.mi.dwFlags != MOUSEEVENTF_MOVE) {
SendInput(1, &ip, sizeof(INPUT));

View File

@@ -269,7 +269,8 @@ void Render::OnReceiveDataBufferCb(const char *data, size_t size,
auto props = render->client_properties_.find(remote_id)->second;
RemoteAction host_info;
if (DeserializeRemoteAction(data, size, host_info)) {
if (ControlType::host_infomation == host_info.type) {
if (ControlType::host_infomation == host_info.type &&
props->remote_host_name_.empty()) {
props->remote_host_name_ =
std::string(host_info.i.host_name, host_info.i.host_name_size);
LOG_INFO("Remote hostname: [{}]", props->remote_host_name_);