mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-07-17 11:00:59 -05:00
Rewrite the SSH-1 main shell session using mainchan.
In SSH-1, the channel system isn't rich enough to represent the complicated main shell session, so it's all done with a separate set of custom message types. But PuTTY now abstracts away that difference, by representing both as different implementations of the SshChannel class: ssh1channel is for things that the protocol thinks are 'really' channels, and ssh1mainchan is for the shell session. All the same methods are implemented, but generate different wire messages. This means that the logic to decide _when_ to enable X forwarding, agent forwarding etc is all centralised into mainchan.c, where it doesn't have to be repeated for both protocol versions. It also simplifies the final loop in the connection protocol, which no longer has to contain the code to move data from the user input bufchain to the channel's output; that's now done by the mainchan write method, the same as it is in SSH-2 where mainchan is just like other channels.
This commit is contained in:
@ -95,7 +95,7 @@ mainchan *mainchan_new(
|
||||
mc->type = MAINCHAN_SESSION;
|
||||
}
|
||||
|
||||
*sc_out = mc->sc;
|
||||
if (sc_out) *sc_out = mc->sc;
|
||||
return mc;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user