[git] GpgOL - branch, master, updated. gpgol-2.0.3-2-g13950a9
by Andre Heinecke
cvs at cvs.gnupg.org
Mon Nov 20 11:56:08 CET 2017
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GnuPG extension for MS Outlook".
The branch, master has been updated
via 13950a98522818b27b3048617acb0282b65b54b3 (commit)
from 84494299549f3bcb44322e6d93aedb88d8b6dbe0 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 13950a98522818b27b3048617acb0282b65b54b3
Author: Andre Heinecke <aheinecke at intevation.de>
Date: Mon Nov 20 11:54:08 2017 +0100
Launch Kleo/GPA in the background on start
* src/engine-assuan.c (spawn_background): New.
(op_assuan_init): Create background thread to launch kleo.
--
This does not slowdown the startup as it happens in a different
thread but is intended to speed up the opening of the key
resolution dialog when kleopatra is not running and help to
avoid startup problems mentioned in T3401
GnuPG-Bug-Id: T3401
diff --git a/src/engine-assuan.c b/src/engine-assuan.c
index 8907c18..95eee5f 100644
--- a/src/engine-assuan.c
+++ b/src/engine-assuan.c
@@ -559,16 +559,53 @@ op_assuan_deinit (void)
cleanup ();
}
+/* Code for a thread in the background */
+static DWORD WINAPI
+spawn_background (LPVOID arg)
+{
+ gpgme_error_t err;
+ assuan_context_t ctx;
+ pid_t pid;
+ ULONG cmdid;
+
+ (void) arg;
+
+ /* Run a test connection to see whether the UI server is available. */
+ log_debug ("%s:%s: Initial uiserver connect", SRCNAME, __func__);
+ err = connect_uiserver (&ctx, &pid, &cmdid, NULL);
+ if (!err)
+ {
+ log_debug ("%s:%s: Sending noop", SRCNAME, __func__);
+ err = assuan_transact (ctx, "NOP", NULL, NULL, NULL, NULL, NULL, NULL);
+ assuan_release (ctx);
+ }
+ if (err)
+ log_debug ("%s:%s: Failed code: %i", SRCNAME, __func__, err);
+
+ return 0;
+}
/* Initialize this system. */
int
op_assuan_init (void)
{
static int init_done;
+ HANDLE thread;
if (init_done)
return 0;
+ /* Connect to UiServer in the background */
+
+ /* XXX This should not really be necessary but
+ it was often reported that the spawn and connect
+ did not work. Also it is much faster to access
+ Kleopatra when it's already running so spawning
+ it as lookahead probably makes sense. */
+ thread = CreateThread (NULL, 0, spawn_background,
+ NULL, 0, NULL);
+ CloseHandle(thread);
+
/* Fire up the pipe worker thread. */
{
HANDLE th;
-----------------------------------------------------------------------
Summary of changes:
src/engine-assuan.c | 37 +++++++++++++++++++++++++++++++++++++
1 file changed, 37 insertions(+)
hooks/post-receive
--
GnuPG extension for MS Outlook
http://git.gnupg.org
More information about the Gnupg-commits
mailing list