Abstracted out the rather large port-forwarding setup code into a
authorsimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Tue, 28 Dec 2004 14:04:58 +0000 (14:04 +0000)
committersimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Tue, 28 Dec 2004 14:04:58 +0000 (14:04 +0000)
commit06fadff539456d105c682f5272703e66500c7e86
tree0238c3c5d95e625bbc54539598cde76a15e91a31
parent62ef3d44b5dea02c9d1070c4f7da650d1df0e381
Abstracted out the rather large port-forwarding setup code into a
routine which is common between SSH1 and SSH2. Since this routine is
not part of the coroutine system, this means it can't sit and wait
to get its various success/failure responses back. Hence, I've
introduced a system of queued packet handlers, each of which waits
for exactly one of a pair of messages (SSH1_SMSG_{SUCCESS,FAILURE}
or SSH2_MSG_REQUEST_{SUCCESS,FAILURE}), handles it when it arrives,
and automatically de-registers itself. Hence the port-forwarding
setup code can be called once, and then subsequent packets related
to it will automatically be handled as they arrive.

The real purpose of all this is that the infrastructure is now there
for me to arrange mid-session configurability of port forwarding.
However, a side benefit is that fewer round trips are involved in
session startup. I'd quite like to move more of the connection setup
(X forwarding, agent forwarding, pty allocation etc) to using the
new queued handler mechanism for this reason.

git-svn-id: svn://svn.tartarus.org/sgt/putty@5029 cda61777-01e9-0310-a592-d414129be87e
ssh.c