simon-git: putty (master): Simon Tatham

Commits to Tartarus hosted VCS tartarus-commits at lists.tartarus.org
Fri May 18 11:53:17 BST 2018


TL;DR:
  d294d1d Restructure some loops with crReturn in them.
  9c5e494 Call every new user input consumer when it's set up.
  7e984e5 Null out a couple of pointers when they're empty.
  18ab91a ssh1_rdpkt: remove a spurious crReturn.

Repository:     https://git.tartarus.org/simon/putty.git
On the web:     https://git.tartarus.org/?p=simon/putty.git
Branch updated: master
Committer:      Simon Tatham <anakin at pobox.com>
Date:           2018-05-18 11:53:17

commit d294d1d0dce7e827fed9a3f85975a766d13702ea
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=d294d1d0dce7e827fed9a3f85975a766d13702ea;hp=ea7f3c2abc9a83b2ff779dccafa4f3004283befe
Author: Simon Tatham <anakin at pobox.com>
Date:   Fri May 18 11:01:12 2018 +0100

    Restructure some loops with crReturn in them.
    
    A large part of the purpose of the 20-patch series just past is to
    arrange that user input is never dropped on the floor: if you type it
    at a moment where the active protocol coroutine has nothing it can
    usefully do with it, the default action will now be to leave it on the
    user_input queue where it will eventually be picked up by some later
    coroutine, or later phase of this one, that does.
    
    And did I _test_ this feature, end to end, just once, before pushing
    the giant patch series?
    
    I did not.
    
    It doesn't work, and the reason why it doesn't work is because various
    loops that spin round alternating a crReturn with a check of the input
    queue do the first crReturn _before_ the first queue check. So if
    there's already data in the queue, well, it won't be _dropped_, but it
    also won't be passed on immediately to where it needs to be - instead,
    it will sit in the queue until you press _another_ key, at which point
    a queue check will happen and all your backed-up typeahead data will
    come out.
    
    Fixed by restructuring those loops to do a queue check first. This
    applies to the final loop in do_ssh2_connection, and all the little
    loops during userauth that prompt for usernames, passwords,
    passphrases etc via get_userpass_input.

 ssh.c | 96 ++++++++++++++++++++++++++++++++++++++++++-------------------------
 1 file changed, 61 insertions(+), 35 deletions(-)

commit 9c5e4947f50742d2452e0ba310309c60453041e9
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=9c5e4947f50742d2452e0ba310309c60453041e9;hp=d294d1d0dce7e827fed9a3f85975a766d13702ea
Author: Simon Tatham <anakin at pobox.com>
Date:   Fri May 18 11:40:21 2018 +0100

    Call every new user input consumer when it's set up.
    
    This fixes further embarrassing hangs in the wake of the big
    restructuring, in which we'd assign a new function pointer into
    ssh->current_user_input_fn but not immediately call it to let it
    process whatever might already be waiting for it in the user input
    queue.

 ssh.c | 4 ++++
 1 file changed, 4 insertions(+)

commit 7e984e5f9d6264ea8b12b6b178ba8cc827bdd9d0
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=7e984e5f9d6264ea8b12b6b178ba8cc827bdd9d0;hp=9c5e4947f50742d2452e0ba310309c60453041e9
Author: Simon Tatham <anakin at pobox.com>
Date:   Fri May 18 11:41:17 2018 +0100

    Null out a couple of pointers when they're empty.
    
    ssh->current_user_input_fn was not set to NULL when the ssh structure
    was initially set up, which meant that with sufficiently eager
    typeahead it could accidentally be called while still full of garbage.
    And ssh->connshare is freed in more than one place (by ssh_free and
    also by do_ssh_close), but only one of those places nulls it out to
    stop the other one trying to free it a second time.

 ssh.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

commit 18ab91a199b585a7f53612fd068b93e607e2b2f0
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=18ab91a199b585a7f53612fd068b93e607e2b2f0;hp=7e984e5f9d6264ea8b12b6b178ba8cc827bdd9d0
Author: Simon Tatham <anakin at pobox.com>
Date:   Fri May 18 11:49:00 2018 +0100

    ssh1_rdpkt: remove a spurious crReturn.
    
    Returning from the coroutine every time we finish putting together a
    packet is wrong, because it means that any further data in the
    incoming queue won't get processed until something triggers another
    call to the coroutine. In ssh2_rdpkt I got this right - the only
    crReturn that _isn't_ due to running out of data is the special one
    immediately after a NEWKEYS - but I forgot to fix it the same way in
    ssh1_rdpkt.

 ssh.c | 1 -
 1 file changed, 1 deletion(-)



More information about the tartarus-commits mailing list