simon-git: putty (main): Simon Tatham

Commits to Tartarus hosted VCS tartarus-commits at lists.tartarus.org
Wed Sep 15 14:13:08 BST 2021


TL;DR:
  99b4229a Make all Plugs have a log function, even if no-op.

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:           2021-09-15 14:13:08

commit 99b4229abf01ea9b9ef916985e6139feed0c0bf2
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=99b4229abf01ea9b9ef916985e6139feed0c0bf2;hp=42f3a2f6d572aaa72a9e70f103138f7b192dd432
Author: Simon Tatham <anakin at pobox.com>
Date:   Wed Sep 15 13:48:30 2021 +0100

    Make all Plugs have a log function, even if no-op.
    
    Commit 8f5e9a4f8dc796a introduced a segfault into both Windows Pageant
    and Windows connection sharing upstreams when they receive an incoming
    named-pipe connection. This occurs because the PlugVtables for those
    incoming connections had a null pointer in the 'log' field, because
    hitherto, only sockets involved with an outgoing connection expected
    to receive plug_log() notifications. But I added such a notification
    in make_handle_socket, forgetting that that function is used for both
    outgoing and incoming named-pipe connections (among other things). So
    now a Plug implementation that expects to be set up by the
    plug_accepting() method on a listener may still receive
    PLUGLOG_CONNECT_SUCCESS.
    
    I could fix that by adding a parameter to make_handle_socket telling
    it whether to send a notification, but that seems like more faff than
    is really needed. Simpler to make a rule that says _all_ Socket types
    must implement the log() method, even if only with a no-op function.
    
    We already have a no-op implementation of log(), in nullplug.c. So
    I've exposed that outside its module (in the same style as all the
    nullseat functions and so on), to make it really easy to add log()
    methods to PlugVtables that don't need one.

 network.h     | 21 +++++++++++++++++++++
 nullplug.c    | 15 +++++++--------
 pageant.c     |  2 ++
 ssh/sharing.c |  2 ++
 4 files changed, 32 insertions(+), 8 deletions(-)



More information about the tartarus-commits mailing list