Hiroshi Oota points out that PuTTY's agent forwarding sockets can get
authorsimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Sat, 8 Sep 2012 10:40:36 +0000 (10:40 +0000)
committersimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Sat, 8 Sep 2012 10:40:36 +0000 (10:40 +0000)
commitbe3f980d12c9d1f406012ebb15b0098058c28bf6
tree82b6a303f2b42c9e9922ffbd7ca1c38a9a21ae16
parent4a62c66db92c9692b5e45566f3dd85455825317c
Hiroshi Oota points out that PuTTY's agent forwarding sockets can get
confused if they receive a request followed by immediate EOF, since we
currently send outgoing EOF as soon as we see the incoming one - and
then, when the response comes back from the real SSH agent, we send it
along anyway as channel data in spite of having sent EOF.

To fix this, I introduce a new field for each agent channel which
counts the number of calls to ssh_agentf_callback that are currently
expected, and we don't send EOF on an agent channel until we've both
received EOF and that value drops to zero.

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