| 1966 | } |
| 1967 | |
| 1968 | nlohmann::json CloudTunnel::CloseRemoteSession(const std::string& vm_id, const nlohmann::json& payload) { |
| 1969 | const std::string session_id = payload.value("session_id", ""); |
| 1970 | if (!remote_sessions_.Close(vm_id, session_id)) { |
| 1971 | return Error("remote_session_not_found", "remote session not found"); |
| 1972 | } |
| 1973 | { |
| 1974 | std::lock_guard<std::mutex> lock(remote_peers_mu_); |
| 1975 | remote_peers_.erase(session_id); |
| 1976 | } |
| 1977 | // Drop the per-VM clipboard subscriber so a future session can re-attach |
| 1978 | // without inheriting a stale capture. |
| 1979 | runtime_manager_.ClearClipboardCallback(vm_id); |
| 1980 | return {{"session_id", session_id}, {"closed", true}}; |
| 1981 | } |
| 1982 | |
| 1983 | nlohmann::json CloudTunnel::HandleRemoteSignal( |
| 1984 | const std::string& vm_id, |
nothing calls this directly
no test coverage detected