Implement SSH X11 forwarding Phase 4: Save X11ForwardContext
- Save X11ForwardContext to Channel.x11_forward_context - Clone context for later use in data forwarding - Prepare for actual X11 data forwarding in handle_channel_data All 182 tests pass.
This commit is contained in:
@@ -1517,6 +1517,11 @@ direct_tcpip: None,
|
|||||||
let display = std::env::var("DISPLAY").unwrap_or_else(|_| ":0".to_string());
|
let display = std::env::var("DISPLAY").unwrap_or_else(|_| ":0".to_string());
|
||||||
let x11_ctx = super::x11_forward::X11ForwardContext::new(&display)?;
|
let x11_ctx = super::x11_forward::X11ForwardContext::new(&display)?;
|
||||||
|
|
||||||
|
// Phase 4: 保存 X11ForwardContext 到 Channel
|
||||||
|
if let Some(ch) = self.channels.get_mut(&channel) {
|
||||||
|
ch.x11_forward_context = Some(x11_ctx.clone());
|
||||||
|
}
|
||||||
|
|
||||||
// 设置 DISPLAY 环境变量(client 会使用)
|
// 设置 DISPLAY 环境变量(client 会使用)
|
||||||
// Server 需要在 exec/shell 环境中设置 DISPLAY
|
// Server 需要在 exec/shell 环境中设置 DISPLAY
|
||||||
// 这里只是记录,实际设置在 exec/shell handler 中
|
// 这里只是记录,实际设置在 exec/shell handler 中
|
||||||
|
|||||||
Reference in New Issue
Block a user