MCPcopy Create free account
hub / github.com/78/tenbox / ResizeRemoteSession

Method ResizeRemoteSession

src/daemon/cloud_tunnel.cpp:1954–1966  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1952}
1953
1954nlohmann::json CloudTunnel::ResizeRemoteSession(const std::string& vm_id, const nlohmann::json& payload) {
1955 const std::string session_id = payload.value("session_id", "");
1956 auto session = remote_sessions_.GetByVm(vm_id);
1957 if (!session || session->session_id != session_id) {
1958 return Error("remote_session_not_found", "remote session not found");
1959 }
1960 const uint32_t width = AlignDisplaySize(payload.value("width", static_cast<uint32_t>(1280)));
1961 const uint32_t height = AlignDisplaySize(payload.value("height", static_cast<uint32_t>(720)));
1962 if (!runtime_manager_.SetDisplaySize(vm_id, width, height)) {
1963 return Error("runtime_not_attached", "failed to resize runtime display");
1964 }
1965 return {{"session_id", session_id}, {"width", width}, {"height", height}};
1966}
1967
1968nlohmann::json CloudTunnel::CloseRemoteSession(const std::string& vm_id, const nlohmann::json& payload) {
1969 const std::string session_id = payload.value("session_id", "");

Callers

nothing calls this directly

Calls 4

AlignDisplaySizeFunction · 0.85
GetByVmMethod · 0.80
ErrorFunction · 0.70
SetDisplaySizeMethod · 0.45

Tested by

no test coverage detected