Implement SSH X11 forwarding Phase 3: Channel structure
Some checks failed
Test / build (push) Has been cancelled
Test / test (push) Has been cancelled

- Add x11_forward_context field to Channel struct
- Initialize x11_forward_context: None in all Channel creations
- Prepare for actual X11 data forwarding

All 182 tests pass.
This commit is contained in:
Warren
2026-06-21 02:29:56 +08:00
parent d3997acfcc
commit df707bee7e

View File

@@ -194,6 +194,7 @@ impl ChannelManager {
direct_tcpip: None,
forwarded_tcpip: None,
auth_agent_socket: None,
x11_forward_context: None, // Phase 2: X11 forwarding
};
self.channels.insert(server_channel, channel);
@@ -275,6 +276,7 @@ impl ChannelManager {
direct_tcpip: Some(direct_tcpip),
forwarded_tcpip: None,
auth_agent_socket: None,
x11_forward_context: None, // Phase 2: X11 forwarding
};
self.channels.insert(server_channel, channel);
@@ -350,9 +352,10 @@ impl ChannelManager {
scp_input_buffer: Vec::new(), // ⭐⭐⭐⭐⭐ Phase 14.4修复
scp_state: ScpState::Idle, // ⭐⭐⭐⭐⭐ Phase 8.3: SCP state machine
scp_output_file: None, // Phase 17: SCP file receive
direct_tcpip: None,
forwarded_tcpip: Some(forwarded_tcpip),
direct_tcpip: None,
forwarded_tcpip: None,
auth_agent_socket: None,
x11_forward_context: None, // Phase 2: X11 forwarding
};
self.channels.insert(server_channel, channel);
@@ -429,6 +432,7 @@ impl ChannelManager {
direct_tcpip: None,
forwarded_tcpip: None,
auth_agent_socket: None,
x11_forward_context: None, // Phase 2: X11 forwarding
};
self.channels.insert(server_channel, channel);
@@ -2291,6 +2295,8 @@ struct Channel {
forwarded_tcpip: Option<ForwardedTcpipChannel>, // forwarded-tcpip channelLocal forwarding
// SSH Agent forwarding
auth_agent_socket: Option<String>, // SSH agent socket path (SSH_AUTH_SOCK)
// Phase 2: X11 forwarding context
x11_forward_context: Option<super::x11_forward::X11ForwardContext>, // X11 forwarding context
}
/// SSH Channel状态参考OpenSSH channel.c