simon-git: putty (master): Simon Tatham
Commits to Tartarus hosted VCS
tartarus-commits at lists.tartarus.org
Sun Nov 26 15:43:48 GMT 2017
TL;DR:
5726940 Remove an outdated comment.
2d289a9 Make the GTK message-box function non-variadic.
46ba9de Introduce a non-modal create_message_box().
9464053 Fix a cleanup issue in dlgparam_destroy.
671267f GTK: system for not leaving stale network prompt dialogs.
624f5b7 Make the GTK host-key verification box non-modal.
199f381 Make GTK askalg() and askhk() non-modal.
f212e2c Change order of cleanup in delete_inst.
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-26 15:43:48
commit 5726940153e07bfffde97bb2c1efc20a9c1d5500
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=5726940153e07bfffde97bb2c1efc20a9c1d5500;hp=7891cb1ac10938c2d6cf8b88b29eae8cdc0c8633
Author: Simon Tatham <anakin at pobox.com>
Date: Sun Nov 26 13:00:38 2017 +0000
Remove an outdated comment.
ssh1_rdpkt claimed to be handling SSH1_MSG_DEBUG and SSH1_MSG_IGNORE
packets, but in fact, the handling of those has long since been moved
into the dispatch table; those particular entries are set up in
ssh1_protocol_setup().
ssh.c | 1 -
1 file changed, 1 deletion(-)
commit 2d289a99703d1c2bf0dcc6927cae79ed87926ebf
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=2d289a99703d1c2bf0dcc6927cae79ed87926ebf;hp=5726940153e07bfffde97bb2c1efc20a9c1d5500
Author: Simon Tatham <anakin at pobox.com>
Date: Sun Nov 26 14:05:02 2017 +0000
Make the GTK message-box function non-variadic.
Now, in place of a variadic argument list with four parameters per
button and a terminating NULL, it takes a pointer to a struct which in
turn contains an (array,length) pair of small per-button structures.
In the process I've renamed the function from messagebox() to
message_box(). Partly that was just because it gave me a convenient
way to search the source for calls I hadn't converted yet, but also
I've thought for a while that that missing underscore didn't really
match the rest of my naming.
NFCI. Partly this minor refactor has the virtue that we can reuse the
more common button layouts without having to type them in at multiple
places in the code (and, indeed, I've provided buttons_yn and
buttons_ok for easy reuse, and could easily provide other things like
yesnocancel any time I need them). But mostly it's because I'm about
to split up message_box into multiple functions, and this saves me the
hassle of deciding which ones to make variadic and which to pass an
actual va_list to - particularly since messagebox() used to go over
its variadic argument list twice, which always makes delegating it to
another function that much more annoying.
unix/gtkdlg.c | 164 +++++++++++++++++++++++++++++-----------------------------
unix/gtkwin.c | 8 +--
unix/unix.h | 16 +++++-
3 files changed, 101 insertions(+), 87 deletions(-)
commit 46ba9de2c2025bd776e23849f093c7d932e9278b
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=46ba9de2c2025bd776e23849f093c7d932e9278b;hp=2d289a99703d1c2bf0dcc6927cae79ed87926ebf
Author: Simon Tatham <anakin at pobox.com>
Date: Sun Nov 26 14:29:31 2017 +0000
Introduce a non-modal create_message_box().
This does the bulk of the work previously done by message_box()
proper, but takes a pointer to a result-reporting callback function
identical to the one we pass to create_config_box().
The modal version of message_box() still exists and is a small wrapper
on this function, running its own subsidiary gtk_main() loop which the
result callback terminates. But now I can start switching over
individual uses of message_box() to the non-modal version, and when
that's done, remove the modal function completely.
unix/gtkdlg.c | 76 ++++++++++++++++++++++++++++++++++++++++-------------------
1 file changed, 52 insertions(+), 24 deletions(-)
commit 946405341ffc12fa6433dab0900da3cff9b1d629
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=946405341ffc12fa6433dab0900da3cff9b1d629;hp=46ba9de2c2025bd776e23849f093c7d932e9278b
Author: Simon Tatham <anakin at pobox.com>
Date: Sun Nov 26 14:37:38 2017 +0000
Fix a cleanup issue in dlgparam_destroy.
If a dialog box is destroyed by the program before the user has
pressed one of the result-delivering buttons - e.g. because the parent
window closes so the dialog is no longer relevant to anything anyway -
then dlgparam_destroy would never call the client code's provided
callback. That makes sense in terms of the callback wanting to _take
action_ based on the result of the dialog box, but it ignores the
possibility that the callback may simply need to free its own context
structure.
So now dlgparam_destroy always calls the client's callback, even if
the result it passes is negative (meaning 'the user never got round to
pressing any of the dialog-ending buttons'), and all the existing
client callbacks handle the negative-result case by doing nothing
except freeing any allocated memory they might have.
unix/gtkapp.c | 4 ++--
unix/gtkdlg.c | 3 +--
unix/gtkmain.c | 4 ++--
unix/gtkwin.c | 7 +++++++
4 files changed, 12 insertions(+), 6 deletions(-)
commit 671267f44bdb0940ce0cd3f92a15c0da7daaf5f6
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=671267f44bdb0940ce0cd3f92a15c0da7daaf5f6;hp=946405341ffc12fa6433dab0900da3cff9b1d629
Author: Simon Tatham <anakin at pobox.com>
Date: Sun Nov 26 14:55:15 2017 +0000
GTK: system for not leaving stale network prompt dialogs.
When I switch verify_ssh_host_key() and friends over to creating
non-modal message boxes and returning to the main loop, there will be
a risk that their parent window will need to close for some other
reason while the user hasn't answered the pending question yet. (E.g.
if the user presses the main session window's close button, which will
no longer be a prohibited UI action once the transient dialog is not
modal.)
At that point we need to get rid of the pending dialog box, both for
UI purposes (it would look silly and be confusing to leave it lying
around) and for memory management (if the user subsequently clicks OK
in such a dialog it would probably try to leave its result somewhere
stale).
So now there's a mechanism for gtkwin.c remembering what the current
'network prompt dialog' is, if any (in which category I intend to
include everything triggered from ssh.c's various reasons for asking
crypto-related questions), and cleaning it up when the struct gui_data
it belongs to goes away.
unix/gtkwin.c | 25 ++++++++++++++++++++++++-
unix/unix.h | 6 +++++-
2 files changed, 29 insertions(+), 2 deletions(-)
commit 624f5b7d47088979dc6d45c994f1988c10653c09
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=624f5b7d47088979dc6d45c994f1988c10653c09;hp=671267f44bdb0940ce0cd3f92a15c0da7daaf5f6
Author: Simon Tatham <anakin at pobox.com>
Date: Sun Nov 26 14:29:42 2017 +0000
Make the GTK host-key verification box non-modal.
I've switched it to using the new non-modal create_message_box, and
provided a callback function which handles the cleanup afterwards.
I had expected this to be a lot more work, because I'd imagined that
I'd have to contort the coroutines in ssh.c to give them the ability
to wait for an asynchronously delivered result from that user prompt.
But in fact that wasn't necessary, because just such a mechanism has
been sitting there unused since commit 8574822b9 in 2005, when I added
it as part of my _previous_ attempt to write an OS X front end! (The
abandoned one written in native ObjC + Cocoa.)
unix/gtkdlg.c | 75 +++++++++++++++++++++++++++++++++++++++++++++++++++--------
1 file changed, 65 insertions(+), 10 deletions(-)
commit 199f381aa9fb81c80929a590a6a4bd4c046148ee
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=199f381aa9fb81c80929a590a6a4bd4c046148ee;hp=624f5b7d47088979dc6d45c994f1988c10653c09
Author: Simon Tatham <anakin at pobox.com>
Date: Sun Nov 26 15:13:08 2017 +0000
Make GTK askalg() and askhk() non-modal.
This follows exactly the same pattern as for verify_ssh_host_key, but
the results of the dialog box are simpler (a plain yes-no response),
so the two dialog types can share a callback.
unix/gtkdlg.c | 79 ++++++++++++++++++++++++++++++++++++++++++-----------------
1 file changed, 57 insertions(+), 22 deletions(-)
commit f212e2cbea8c492f43f998df6b8da08d28ccd4d7
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=f212e2cbea8c492f43f998df6b8da08d28ccd4d7;hp=199f381aa9fb81c80929a590a6a4bd4c046148ee
Author: Simon Tatham <anakin at pobox.com>
Date: Sun Nov 26 15:35:25 2017 +0000
Change order of cleanup in delete_inst.
If you close a session window with an associated SSH back end, the
back end may call back to notify_remote_exit() from ssh_free(), which
queues a new top-level callback citing the inst structure we were
about to delete.
We could fix this by introducing a special 'moribund' flag which
inhibits notify_remote_exit from queueing a callback, but far easier
is to move the delete_callbacks_for_context() call to _after_ all
subsidiary things have been cleaned up, so that any last-minute
callbacks they might schedule will be promptly unscheduled again
before they do any damage.
unix/gtkwin.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
More information about the tartarus-commits
mailing list