simon-git: putty (master): Simon Tatham

Commits to Tartarus hosted VCS tartarus-commits at lists.tartarus.org
Mon Nov 27 21:00:03 GMT 2017


TL;DR:
  86741a1 Expand the dialog registering/unregistering system.
  b6ed823 Make the askappend() prompt non-modal.
  8b0d460 Replace dlg_error_message() with a non-modal message box.
  71ed04d Make the GTK font setup error box non-modal.
  a8e9fd7 Reimplement 'really close session?' as a non-modal message box.
  d1f62c3 Make the Licence message box non-modal.
  4f3f4ed Get rid of fatalbox() completely.
  813c380 Make nonfatal() nonmodal.
  3e24bb6 Make connection_fatal() nonmodal.
  57ceac8 Fix stale-pointer bugs in connection-fatal network errors.
  ef6e38d Remove the modal message_box function completely.
  71b0009 Remove the post_main() mechanism.
  28145fe Avoid duplicate random_unref on freeing an Ssh.
  61f3e3e GTK: handle synchronous connection-setup failures sensibly.
  c99338b Stop linking cmdline.c into the gtkapp-based programs.
  ba55b22 Move gtkwin.c's cmdline_error() into gtkmain.c.
  4b8baed GTK: fix the exit(1) response to startup-time font errors.
  032a9da Remove one last stray process exit().
  46cf862 Knock off another refactoring from the OS X to-do list.
  cd3093b SSH packet logs: don't rely on locale's isprint().

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:           2017-11-27 21:00:03

commit 86741a1b098ad9d3ad052b2483de96a580c4710a
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=86741a1b098ad9d3ad052b2483de96a580c4710a;hp=f212e2cbea8c492f43f998df6b8da08d28ccd4d7
Author: Simon Tatham <anakin at pobox.com>
Date:   Sun Nov 26 16:51:19 2017 +0000

    Expand the dialog registering/unregistering system.
    
    Now it has several 'slots', each named for a particular class of
    subsidiary dialog box that a session window can have at most one of,
    and register_network_prompt_dialog has a more general name and takes
    an enum-typed argument identifying a slot. This lets me avoid writing
    a zillion annoyingly similar function pairs and corresponding snippets
    of cleanup code in delete_inst.

 unix/gtkdlg.c | 10 +++++-----
 unix/gtkwin.c | 42 ++++++++++++++++++++++--------------------
 unix/unix.h   |  9 +++++++--
 3 files changed, 34 insertions(+), 27 deletions(-)

commit b6ed82321ce917eb2e7c18169e99df63580d01c9
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=b6ed82321ce917eb2e7c18169e99df63580d01c9;hp=86741a1b098ad9d3ad052b2483de96a580c4710a
Author: Simon Tatham <anakin at pobox.com>
Date:   Sun Nov 26 16:56:03 2017 +0000

    Make the askappend() prompt non-modal.
    
    This fits into a new dialog-box slot (because it might have to come up
    at the same time as a network prompt), and makes use of the existing
    callback system in logging.c which buffers the logging data until the
    user says what they want done with it.

 unix/gtkdlg.c | 50 +++++++++++++++++++++++++++++++-------------------
 unix/unix.h   |  1 +
 2 files changed, 32 insertions(+), 19 deletions(-)

commit 8b0d460578db3502d465a4d002aab5e2a9a4c35a
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=8b0d460578db3502d465a4d002aab5e2a9a4c35a;hp=b6ed82321ce917eb2e7c18169e99df63580d01c9
Author: Simon Tatham <anakin at pobox.com>
Date:   Sun Nov 26 17:05:51 2017 +0000

    Replace dlg_error_message() with a non-modal message box.
    
    Apart from the specific benefit of non-modality, this also makes it a
    lot simpler compared to the previous code! I'm not completely sure why
    I wasn't using the standard gtkdlg.c message box system all along.

 unix/gtkdlg.c | 51 ++++++++-------------------------------------------
 unix/unix.h   |  4 ++++
 2 files changed, 12 insertions(+), 43 deletions(-)

commit 71ed04dbc32fb373e62f5162260a244f104ff444
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=71ed04dbc32fb373e62f5162260a244f104ff444;hp=8b0d460578db3502d465a4d002aab5e2a9a4c35a
Author: Simon Tatham <anakin at pobox.com>
Date:   Sun Nov 26 17:07:47 2017 +0000

    Make the GTK font setup error box non-modal.
    
    That was the last (in fact, the only) call to the modal version of
    message_box() outside gtkdlg.c, so I can remove it from the header
    file.

 unix/gtkdlg.c | 2 +-
 unix/gtkwin.c | 8 ++++----
 unix/unix.h   | 6 ++----
 3 files changed, 7 insertions(+), 9 deletions(-)

commit a8e9fd7860a3b7137ef45be294d370e2537dd495
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=a8e9fd7860a3b7137ef45be294d370e2537dd495;hp=71ed04dbc32fb373e62f5162260a244f104ff444
Author: Simon Tatham <anakin at pobox.com>
Date:   Sun Nov 26 17:21:32 2017 +0000

    Reimplement 'really close session?' as a non-modal message box.
    
    I've also moved it out into gtkwin.c, because it seemed easier to do
    the 'find existing instance of this dialog and raise it' dance there
    than to split it across source files pointlessly.

 unix/gtkdlg.c | 11 ----------
 unix/gtkwin.c | 66 ++++++++++++++++++++++++++++++++++++++++++++++++-----------
 unix/unix.h   |  2 +-
 3 files changed, 55 insertions(+), 24 deletions(-)

commit d1f62c3e0f458c686f8bbda69288ccf512245390
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=d1f62c3e0f458c686f8bbda69288ccf512245390;hp=a8e9fd7860a3b7137ef45be294d370e2537dd495
Author: Simon Tatham <anakin at pobox.com>
Date:   Sun Nov 26 17:32:01 2017 +0000

    Make the Licence message box non-modal.

 unix/gtkdlg.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

commit 4f3f4ed691ed88701d542de71d665a03dee22b1c
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=4f3f4ed691ed88701d542de71d665a03dee22b1c;hp=d1f62c3e0f458c686f8bbda69288ccf512245390
Author: Simon Tatham <anakin at pobox.com>
Date:   Sun Nov 26 17:43:02 2017 +0000

    Get rid of fatalbox() completely.
    
    It's an incoherent concept! There should not be any such thing as an
    error box that terminates the entire program but is not modal. If it's
    bad enough to terminate the whole program, i.e. _all_ currently live
    connections, then there's no point in permitting progress to continue
    in windows other than the affected one, because all windows are
    affected anyway.
    
    So all previous uses of fatalbox() have become modalfatalbox(), except
    those which looked to me as if they shouldn't have been fatal in the
    first place, e.g. lingering pieces of error handling in winnet.c which
    ought to have had the severity of 'give up on this particular Socket
    and close it' rather than 'give up on the ENTIRE UNIVERSE'.

 fuzzterm.c         |  1 -
 pscp.c             | 15 ---------------
 psftp.c            | 14 --------------
 putty.h            |  2 --
 terminal.c         | 26 +++++++++++++-------------
 unix/gtkdlg.c      | 12 ------------
 unix/uxpgnt.c      | 10 ----------
 unix/uxplink.c     | 17 -----------------
 windows/window.c   | 17 -----------------
 windows/winnet.c   | 36 +++++++++++++-----------------------
 windows/winplink.c | 14 --------------
 11 files changed, 26 insertions(+), 138 deletions(-)

commit 813c380470ef5f80145332f265ea8a2facdcac28
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=813c380470ef5f80145332f265ea8a2facdcac28;hp=4f3f4ed691ed88701d542de71d665a03dee22b1c
Author: Simon Tatham <anakin at pobox.com>
Date:   Sun Nov 26 17:55:00 2017 +0000

    Make nonfatal() nonmodal.
    
    This one was completely trivial, except that while I was at it, I took
    the opportunity to put the right program name in the window title.

 unix/gtkdlg.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

commit 3e24bb610d970255ffcf99597021f5913d5d7cc6
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=3e24bb610d970255ffcf99597021f5913d5d7cc6;hp=813c380470ef5f80145332f265ea8a2facdcac28
Author: Simon Tatham <anakin at pobox.com>
Date:   Sun Nov 26 19:59:24 2017 +0000

    Make connection_fatal() nonmodal.
    
    This change requires me to break up the general cleanups in
    delete_inst() into two halves: one runs when the error message box is
    created, and cleans up the network connection and all the stuff
    associated with it, and the other runs when the error message is
    dismissed and the window can actually close.

 unix/gtkdlg.c |  7 -----
 unix/gtkwin.c | 83 ++++++++++++++++++++++++++++++++++++++++++-----------------
 unix/unix.h   |  2 +-
 3 files changed, 60 insertions(+), 32 deletions(-)

commit 57ceac8f1d53a38766e993177a736d48d35c6f34
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=57ceac8f1d53a38766e993177a736d48d35c6f34;hp=3e24bb610d970255ffcf99597021f5913d5d7cc6
Author: Simon Tatham <anakin at pobox.com>
Date:   Sun Nov 26 19:59:27 2017 +0000

    Fix stale-pointer bugs in connection-fatal network errors.
    
    I think these began to appear as a consequencce of replacing
    fatalbox() calls with more sensible error reports: the more specific a
    direction I send a report in, the greater the annoying possibility of
    re-entrance when the resulting error handler starts closing stuff.

 ssh.c        | 2 ++
 unix/uxnet.c | 4 +++-
 2 files changed, 5 insertions(+), 1 deletion(-)

commit ef6e38d8ebeab7e98ad82edad81413ae2e833109
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=ef6e38d8ebeab7e98ad82edad81413ae2e833109;hp=57ceac8f1d53a38766e993177a736d48d35c6f34
Author: Simon Tatham <anakin at pobox.com>
Date:   Sun Nov 26 20:01:16 2017 +0000

    Remove the modal message_box function completely.
    
    Now there's nothing left that calls it, it's obsolete.

 unix/gtkdlg.c | 27 ++-------------------------
 1 file changed, 2 insertions(+), 25 deletions(-)

commit 71b00097dd8a755c600dd4da9fab65c0f0d0b29b
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=71b00097dd8a755c600dd4da9fab65c0f0d0b29b;hp=ef6e38d8ebeab7e98ad82edad81413ae2e833109
Author: Simon Tatham <anakin at pobox.com>
Date:   Sun Nov 26 20:03:12 2017 +0000

    Remove the post_main() mechanism.
    
    This existed in order to avoid the various confusions that could
    happen if a toplevel callback ran in the context of a subsidiary
    instance of gtk_main(). Now there aren't any subsidiary gtk_main
    instances any more, this mechanism is no longer needed, and I can
    throw it out. It was horrible anyway.

 unix/gtkcomm.c | 33 +--------------------------------
 unix/unix.h    |  1 -
 2 files changed, 1 insertion(+), 33 deletions(-)

commit 28145fe21a4335e34dfc6cfbc5f97068b9d3af24
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=28145fe21a4335e34dfc6cfbc5f97068b9d3af24;hp=71b00097dd8a755c600dd4da9fab65c0f0d0b29b
Author: Simon Tatham <anakin at pobox.com>
Date:   Mon Nov 27 19:29:47 2017 +0000

    Avoid duplicate random_unref on freeing an Ssh.
    
    If ssh_init encounters a synchronous error, it will call random_unref
    before returning. But the Ssh structure it created will still exist,
    and if the caller (sensibly) responds by freeing it, then that will
    cause a second random_unref, leading to the RNG's refcount going below
    zero and failing an assertion.
    
    We never noticed this before because with only one PuTTY connection
    per process it was easier to just exit(1) without bothering to clean
    things up. Now, with all the multi-sessions-per-process fixes I'm
    doing, this has shown up as a problem. But other front ends may
    legitimately still just exit - I don't think I can sensibly enforce
    _not_ doing so at this late stage - so I've had to arrange to set a
    flag in the Ssh saying whether a random_unref is still pending or not.

 ssh.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

commit 61f3e3e299ed24aa58736bd8d2214bd5c8abb2f1
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=61f3e3e299ed24aa58736bd8d2214bd5c8abb2f1;hp=28145fe21a4335e34dfc6cfbc5f97068b9d3af24
Author: Simon Tatham <anakin at pobox.com>
Date:   Mon Nov 27 19:32:39 2017 +0000

    GTK: handle synchronous connection-setup failures sensibly.
    
    This was one of a handful of remaining places in gtkwin.c where exit()
    is called incautiously. Of course, a failure to set up one SSH
    connection should only be fatal to that connection, not the whole
    process, so really we should be feeding into the connection_fatal
    system.

 unix/gtkwin.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

commit c99338b750aed3714d56faa39bd0074db58a0d4a
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=c99338b750aed3714d56faa39bd0074db58a0d4a;hp=61f3e3e299ed24aa58736bd8d2214bd5c8abb2f1
Author: Simon Tatham <anakin at pobox.com>
Date:   Mon Nov 27 19:38:02 2017 +0000

    Stop linking cmdline.c into the gtkapp-based programs.
    
    They don't do normal command-line processing, so they don't need it. A
    few stray references to machinery provided in there are now satisfied
    instead by a new stub module nocmdline.c.

 Recipe      | 19 ++++++++++---------
 nocmdline.c | 42 ++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 52 insertions(+), 9 deletions(-)

commit ba55b228a38071cd6d4be39f0c409fc5c08f3d19
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=ba55b228a38071cd6d4be39f0c409fc5c08f3d19;hp=c99338b750aed3714d56faa39bd0074db58a0d4a
Author: Simon Tatham <anakin at pobox.com>
Date:   Mon Nov 27 19:40:13 2017 +0000

    Move gtkwin.c's cmdline_error() into gtkmain.c.
    
    Not all gtkwin-based tools use it. Only the ones with one session per
    process, which parse a command line describing that session and might
    reasonably want to report errors in that command line by writing to
    standard error and exiting the program.
    
    In other words, precisely the ones that link in gtkmain.c and not
    gtkapp.c. So gtkmain.c is a more sensible place to put that
    error-reporting function.

 unix/gtkmain.c | 11 +++++++++++
 unix/gtkwin.c  | 11 -----------
 2 files changed, 11 insertions(+), 11 deletions(-)

commit 4b8baed84af04cb9f2d5c3318bb057567e3eaadc
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=4b8baed84af04cb9f2d5c3318bb057567e3eaadc;hp=ba55b228a38071cd6d4be39f0c409fc5c08f3d19
Author: Simon Tatham <anakin at pobox.com>
Date:   Mon Nov 27 20:09:54 2017 +0000

    GTK: fix the exit(1) response to startup-time font errors.
    
    For gtkapp-based tools that will have to stop being a program-fatal
    error, so I've turned it into a function called window_setup_error
    (which I could in principle reuse for other problems in the long and
    tortuous progress of new_session_window), and kept the original
    handling in gtkmain.c's implementation of that function while gtkapp.c
    does something more sensible with a message box.

 unix/gtkapp.c  | 14 ++++++++++++++
 unix/gtkmain.c |  6 ++++++
 unix/gtkwin.c  | 16 ++++++++++------
 unix/unix.h    |  1 +
 4 files changed, 31 insertions(+), 6 deletions(-)

commit 032a9da179082bafa4c16eb6b0c06b02b20cd275
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=032a9da179082bafa4c16eb6b0c06b02b20cd275;hp=4b8baed84af04cb9f2d5c3318bb057567e3eaadc
Author: Simon Tatham <anakin at pobox.com>
Date:   Mon Nov 27 20:18:23 2017 +0000

    Remove one last stray process exit().
    
    This one's in frontend_keypress(), which is supposed to close the
    window on the first keypress after the session inside it terminates
    (that is, if your close-on-exit settings haven't made it close already
    at that point).
    
    It looks to me as if that behaviour doesn't currently _work_, and
    hasn't worked for quite a while (certainly it was broken as of 0.70,
    well before I started on this weekend's refactoring), because when the
    session terminates we delete inst->ldisc and that's what would
    otherwise be calling frontend_keypress. I should probably decide what
    to do about that at some point. But for the moment, I'm satisfied to
    simply not break this functionality any worse by making it not a
    process-global exit :-)

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

commit 46cf862c31a0a5b3b6332c0ed713b11f447afb87
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=46cf862c31a0a5b3b6332c0ed713b11f447afb87;hp=032a9da179082bafa4c16eb6b0c06b02b20cd275
Author: Simon Tatham <anakin at pobox.com>
Date:   Mon Nov 27 20:22:10 2017 +0000

    Knock off another refactoring from the OS X to-do list.
    
    Stopping dialog boxes from being modal is now done; post_main() is
    defunct; nothing left in gtkwin.c does an inappropriate whole-process
    termination in response to a window-level error or closure condition.
    
    (There is still modalfatalbox(), but that's not an _inappropriate_
    process termination.)

 unix/gtkapp.c | 12 ------------
 1 file changed, 12 deletions(-)

commit cd3093bcfedcfd0742d9eccfbe484eeeb1b06f19
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=cd3093bcfedcfd0742d9eccfbe484eeeb1b06f19;hp=46cf862c31a0a5b3b6332c0ed713b11f447afb87
Author: Simon Tatham <anakin at pobox.com>
Date:   Mon Nov 27 20:39:17 2017 +0000

    SSH packet logs: don't rely on locale's isprint().
    
    I've just noticed that on OS X I get high-bit-set junk in the text
    side of my hex/ASCII dumps. That's going to confuse all sorts of
    things that will interpret them in the wrong character set (indeed, in
    many cases there won't even be a _right_ character set). Coerce to
    ordinary ASCII.

 logging.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)



More information about the tartarus-commits mailing list