simon-git: putty (main): Simon Tatham

Commits to Tartarus hosted VCS tartarus-commits at lists.tartarus.org
Wed May 28 08:54:51 BST 2025


TL;DR:
  91ad3af0 Use MSG_NOSIGNAL when sending on network sockets.

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:           2025-05-28 08:54:51

commit 91ad3af01c45cc43e2705569dc1555789f2fd3f6
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=91ad3af01c45cc43e2705569dc1555789f2fd3f6;hp=b66ec0c25751f432745448333d95727391092f2a
Author: Simon Tatham <anakin at pobox.com>
Date:   Wed May 28 08:40:40 2025 +0100

    Use MSG_NOSIGNAL when sending on network sockets.
    
    This prevents send(2) from terminating the whole process with SIGPIPE
    if the socket has gone away. Since PuTTY manages multiple network
    connections (due to port forwarding and X11 forwarding), and some of
    the outlying tools like psusan can manage even more (multiple entire
    sessions running at once), you never want the whole application to die
    of SIGPIPE in this situation: you just want that one
    connection (perhaps a forwarding) to be cleanly aborted, and a failure
    indication sent back over another connection. Even if the main
    connection really does get EPIPE, you'd still prefer a sensible error
    message.
    
    I tried using psusan this week to forward X11 into a Podman container,
    by means of sharing a host directory into the container, making psusan
    bind to a Unix socket in that directory, and telling host PuTTY to
    connect to that Unix socket and speak bare ssh-connection. The X
    application locked up mysteriously, and when I tried to ^C it from the
    main host PuTTY window, psusan in the container died of SIGPIPE at
    this call site.
    
    (The locked-up X app was pterm, which would also be worrying if it
    weren't for the fact that I can't reproduce it on current main, only
    on 0.83. I suspect Ben's many recent GTK improvements have fixed
    something in this area in passing.)

 unix/network.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)



More information about the tartarus-commits mailing list