simon-git: putty (main): Simon Tatham

Commits to Tartarus hosted VCS tartarus-commits at lists.tartarus.org
Sat Feb 5 13:02:08 GMT 2022


TL;DR:
  dd3d0e93 windows/network.c: reformat some mis-indented code.
  f08879a5 windows/network.c: create a 'superfamily' SockAddr field.
  5b5904b7 windows/network.c: refactor switch in sk_newlistener.
  04cc999b windows/network.c: refactor SOCKADDR_FAMILY.
  3d15342f windows/network.c: refactor addr family in sk_newlistener.
  018236da Support AF_UNIX listening sockets on Windows.
  82971a3e Handle WM_NETEVENT in Windows Pageant.
  6f8db229 Windows Pageant: option to open an AF_UNIX socket.

Repository:     https://git.tartarus.org/simon/putty.git
On the web:     https://git.tartarus.org/?p=simon/putty.git
Branch updated: main
Committer:      Simon Tatham <anakin at pobox.com>
Date:           2022-02-05 13:02:08

commit dd3d0e931fd4433789326915b64d4c1bbf4cce58
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=dd3d0e931fd4433789326915b64d4c1bbf4cce58;hp=72c492926f54126b08e772a06eecc74424a0bd15
Author: Simon Tatham <anakin at pobox.com>
Date:   Sat Jan 8 15:28:40 2022 +0000

    windows/network.c: reformat some mis-indented code.
    
    Not quite sure how this all ended up a whole indent level off where it
    should have been, but before I start modifying it, let's fix that.

 windows/network.c | 126 +++++++++++++++++++++++++++---------------------------
 1 file changed, 63 insertions(+), 63 deletions(-)

commit f08879a55686da5e7d307f0d2f2b172e52d38857
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=f08879a55686da5e7d307f0d2f2b172e52d38857;hp=dd3d0e931fd4433789326915b64d4c1bbf4cce58
Author: Simon Tatham <anakin at pobox.com>
Date:   Sat Jan 8 15:14:30 2022 +0000

    windows/network.c: create a 'superfamily' SockAddr field.
    
    This replaces two previous boolean fields 'resolved' and 'namedpipe',
    converting them into a single three-valued enum which avoids being
    able to represent the meaningless fourth possibility at all. Also, it
    provides an open-ended place to add further possibilities.
    
    The new field is very similar to the one in unix/network.c, except
    that the UNIX entry for AF_UNIX sockets is missing, and in its place
    is the NAMEDPIPE entry for storing the pathnames of Windows named
    pipes.

 windows/network.c | 61 +++++++++++++++++++++++++++++--------------------------
 1 file changed, 32 insertions(+), 29 deletions(-)

commit 5b5904b7cc38a063995912c950abb22ae68c600a
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=5b5904b7cc38a063995912c950abb22ae68c600a;hp=f08879a55686da5e7d307f0d2f2b172e52d38857
Author: Simon Tatham <anakin at pobox.com>
Date:   Sat Jan 8 15:28:34 2022 +0000

    windows/network.c: refactor switch in sk_newlistener.
    
    The code that diverges based on the address family is now in the form
    of a switch statement, rather than an unwieldy series of chained ifs.
    And the final call to bind() has all its arguments worked out in the
    previous switch, rather than computing them at the last minute with an
    equally unwieldy set of ?: operators that repeat the previous test.
    
    This will make it easier to add more cases, and also, to keep each
    case under its own ifdef without losing too much legibility.

 windows/network.c | 29 +++++++++++++++++------------
 1 file changed, 17 insertions(+), 12 deletions(-)

commit 04cc999b50adc11a97a50e91822039531742edcb
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=04cc999b50adc11a97a50e91822039531742edcb;hp=5b5904b7cc38a063995912c950abb22ae68c600a
Author: Simon Tatham <anakin at pobox.com>
Date:   Thu Jan 27 20:32:27 2022 +0000

    windows/network.c: refactor SOCKADDR_FAMILY.
    
    This macro is now an inline function, and as in the previous commit,
    each possible value for the main discriminator is now a case in a
    switch statement instead of tested in an interlocking set of ?:.

 windows/network.c | 29 +++++++++++++++++------------
 1 file changed, 17 insertions(+), 12 deletions(-)

commit 3d15342fe8a1e6f549fd8aaaa100114c942360bb
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=3d15342fe8a1e6f549fd8aaaa100114c942360bb;hp=04cc999b50adc11a97a50e91822039531742edcb
Author: Simon Tatham <anakin at pobox.com>
Date:   Thu Jan 27 20:33:50 2022 +0000

    windows/network.c: refactor addr family in sk_newlistener.
    
    Most of the previous large sk_newlistener function is now an inner
    function whose address-family parameter is a platform AF_FOO constant
    rather than one of our own ADDRTYPE_FOO. sk_newlistener itself is a
    trivial wrapper on that, which just does the initial translation from
    the input ADDRTYPE_FOO into an AF_FOO.
    
    This will make it possible to drop in alternative wrapper functions
    which won't have to make up a pointless ADDRTYPE.

 windows/network.c | 39 +++++++++++++++++++++++----------------
 1 file changed, 23 insertions(+), 16 deletions(-)

commit 018236da290803e94ffd843eb53ed4d695d27a0a
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=018236da290803e94ffd843eb53ed4d695d27a0a;hp=3d15342fe8a1e6f549fd8aaaa100114c942360bb
Author: Simon Tatham <anakin at pobox.com>
Date:   Thu Jan 27 20:37:32 2022 +0000

    Support AF_UNIX listening sockets on Windows.
    
    Not all Windows toolchains have this yet, so we have to put the
    whole lot under #ifdef.

 cmake/cmake.h.in              |  1 +
 cmake/platforms/windows.cmake |  2 ++
 windows/network.c             | 66 +++++++++++++++++++++++++++++++++++++------
 windows/platform.h            |  1 +
 4 files changed, 61 insertions(+), 9 deletions(-)

commit 82971a3ebb4110d7ac9dd6a4f93aec8214085c1e
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=82971a3ebb4110d7ac9dd6a4f93aec8214085c1e;hp=018236da290803e94ffd843eb53ed4d695d27a0a
Author: Simon Tatham <anakin at pobox.com>
Date:   Sat Jan 29 16:49:44 2022 +0000

    Handle WM_NETEVENT in Windows Pageant.
    
    Apparently when I made Windows Pageant use the winselgui system, I
    added the call that gets WSAAsyncSelect response messages sent to
    Pageant's window, but I didn't add the switch case in the window
    procedure that actually handles those responses. I suppose I didn't
    notice at the time because no actual functionality used it - Pageant
    has never yet dealt with any real (i.e. Winsock) sockets, only with
    HANDLE-based named pipes, which are called 'sockets' in PuTTY's
    abstraction, but not by Windows.

 windows/pageant.c    |  3 +++
 windows/platform.h   |  1 +
 windows/select-gui.c | 27 +++++++++++++++++++++++++++
 windows/window.c     | 32 ++------------------------------
 4 files changed, 33 insertions(+), 30 deletions(-)

commit 6f8db22972398b3a5439cbece0c7a7b678bdd7e4
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=6f8db22972398b3a5439cbece0c7a7b678bdd7e4;hp=82971a3ebb4110d7ac9dd6a4f93aec8214085c1e
Author: Simon Tatham <anakin at pobox.com>
Date:   Thu Jan 27 20:37:50 2022 +0000

    Windows Pageant: option to open an AF_UNIX socket.
    
    There's now a command-line option to make Pageant open an AF_UNIX
    socket at a pathname of your choice. This allows it to act as an SSH
    agent for any client program willing to use a WinSock AF_UNIX socket.
    
    In particular, this allows WSL 1 processes to talk directly to Windows
    Pageant without needing any intermediate process, because the AF_UNIX
    sockets in the WSL 1 world interoperate with WinSock's ones.
    
    (However, not WSL 2, which isn't very surprising.)

 doc/pageant.but   |  39 +++++++++++++++++
 windows/pageant.c | 126 +++++++++++++++++++++++++++++++++---------------------
 2 files changed, 117 insertions(+), 48 deletions(-)



More information about the tartarus-commits mailing list