simon-git: putty (master): Simon Tatham

Commits to Tartarus hosted VCS tartarus-commits at lists.tartarus.org
Thu Oct 11 20:02:46 BST 2018


TL;DR:
  109df9f4 Remove frontend_keypress().
  b4c8fd9d New abstraction 'Seat', to pass to backends.

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-10-11 20:02:46

commit 109df9f46b6a0ff19190839d8d62f72f8dedce87
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=109df9f46b6a0ff19190839d8d62f72f8dedce87;hp=e053ea9a2ef828725dac992c80c3b112a9970a96
Author: Simon Tatham <anakin at pobox.com>
Date:   Thu Oct 11 18:14:05 2018 +0100

    Remove frontend_keypress().
    
    This was used by ldisc to communicate back to the front end that a key
    had been pressed (or rather, that a keypress had caused a nonzero
    amount of session input data). Its only nontrivial implementation was
    in gtkwin.c, which used that notification to implement the Unix GUI's
    "close window on keypress, if the session was already over" policy.
    
    (Which in turn is Unix-specific, because the rationale is that
    sometimes X servers don't have a functioning window manager, so it's
    useful to have a way of telling any application to close without using
    WM-provided facilities like a close button.)
    
    But gtkwin.c doesn't need to be told by the ldisc that a keypress
    happened - it's the one _sending_ those keypresses to ldisc in the
    first place! So I've thrown away the three stub implementations of
    frontend_keypress, removed the call to it in ldisc.c, and replaced it
    with calls in gtkwin.c at all the points during keypress handling
    that call ldisc_send.
    
    A visible effect is that pterm's close-on-keypress behaviour will now
    only trigger on an actual (input-generating) _keypress_, and not on
    other input generation such as a paste action. I think that's an
    improvement.

 ldisc.c           |  7 -------
 putty.h           |  1 -
 unix/gtkwin.c     | 20 +++++++++++++++++++-
 unix/uxcons.c     |  8 --------
 windows/wincons.c |  8 --------
 windows/window.c  | 11 -----------
 6 files changed, 19 insertions(+), 36 deletions(-)

commit b4c8fd9d86fdebac075967aa233128449da7ed57
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=b4c8fd9d86fdebac075967aa233128449da7ed57;hp=109df9f46b6a0ff19190839d8d62f72f8dedce87
Author: Simon Tatham <anakin at pobox.com>
Date:   Thu Oct 11 19:58:42 2018 +0100

    New abstraction 'Seat', to pass to backends.
    
    This is a new vtable-based abstraction which is passed to a backend in
    place of Frontend, and it implements only the subset of the Frontend
    functions needed by a backend. (Many other Frontend functions still
    exist, notably the wide range of things called by terminal.c providing
    platform-independent operations on the GUI terminal window.)
    
    The purpose of making it a vtable is that this opens up the
    possibility of creating a backend as an internal implementation detail
    of some other activity, by providing just that one backend with a
    custom Seat that implements the methods differently.
    
    For example, this refactoring should make it feasible to directly
    implement an SSH proxy type, aka the 'jump host' feature supported by
    OpenSSH, aka 'open a secondary SSH session in MAINCHAN_DIRECT_TCP
    mode, and then expose the main channel of that as the Socket for the
    primary connection'. (Which of course you can already do by spawning
    'plink -nc' as a separate proxy process, but this would permit it in
    the _same_ process without anything getting confused.)
    
    I've centralised a full set of stub methods in misc.c for the new
    abstraction, which allows me to get rid of several annoying stubs in
    the previous code. Also, while I'm here, I've moved a lot of
    duplicated modalfatalbox() type functions from application main
    program files into wincons.c / uxcons.c, which I think saves
    duplication overall. (A minor visible effect is that the prefixes on
    those console-based fatal error messages will now be more consistent
    between applications.)

 be_misc.c          |   4 +-
 cmdgen.c           |  23 +---
 cmdline.c          |   4 +-
 defs.h             |   3 +
 fuzzterm.c         |   3 -
 ldisc.c            |   9 +-
 ldisc.h            |   2 +-
 misc.c             |  44 ++++++-
 network.h          |   2 +-
 pscp.c             | 107 ++++++---------
 psftp.c            | 103 +++++++--------
 putty.h            | 377 +++++++++++++++++++++++++++++++++++++++++++----------
 raw.c              |  18 +--
 rlogin.c           |  20 +--
 ssh.c              |  32 ++---
 ssh.h              |   2 +-
 ssh1connection.c   |   6 +-
 ssh1login.c        |  36 ++---
 ssh2connection.c   |  19 ++-
 ssh2transport.c    |  63 ++++-----
 ssh2userauth.c     |  55 ++++----
 sshcommon.c        |   8 +-
 sshppl.h           |   2 +-
 telnet.c           |  16 +--
 terminal.h         |  12 +-
 testback.c         |  32 +++--
 unix/gtkdlg.c      |  51 ++++----
 unix/gtkwin.c      | 145 +++++++++++++--------
 unix/unix.h        |  23 ++--
 unix/uxcons.c      |  69 ++++++++--
 unix/uxpgnt.c      |  41 +-----
 unix/uxplink.c     |  96 +++++---------
 unix/uxpty.c       |  29 +++--
 unix/uxser.c       |  12 +-
 unix/uxsftp.c      |   4 +-
 windows/wincons.c  |  72 +++++++---
 windows/windlg.c   |  22 ++--
 windows/window.c   |  81 ++++++++----
 windows/winplink.c |  78 ++++-------
 windows/winser.c   |  18 +--
 windows/winsftp.c  |   4 +-
 windows/winstuff.h |  16 ++-
 42 files changed, 1045 insertions(+), 718 deletions(-)



More information about the tartarus-commits mailing list