[git] GnuPG - branch, master, updated. gnupg-2.1.17-87-g3d356d1

by Werner Koch cvs at cvs.gnupg.org
Wed Jan 18 10:15:53 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 "The GNU Privacy Guard".

The branch, master has been updated
       via  3d356d165aed7d76a3ea811b1d24ed0a05ac90d4 (commit)
      from  2312248b2e3adffa52d8a3ac4f24fe2c88f0f569 (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 3d356d165aed7d76a3ea811b1d24ed0a05ac90d4
Author: Werner Koch <wk at gnupg.org>
Date:   Wed Jan 18 10:13:04 2017 +0100

    agent: Reduce sleep time in the progress callback.
    
    * agent/gpg-agent.c (agent_libgcrypt_progress_cb): Reduce sleep time
    from 100ms to 1ms or use gpgrt_yield when build against a recent
    libgpg-error.
    --
    
    Debian-bug-id: 851298
    Signed-off-by: Werner Koch <wk at gnupg.org>

diff --git a/agent/gpg-agent.c b/agent/gpg-agent.c
index 724b55a..b203b07 100644
--- a/agent/gpg-agent.c
+++ b/agent/gpg-agent.c
@@ -1763,11 +1763,19 @@ agent_libgcrypt_progress_cb (void *data, const char *what, int printchar,
 
   /* Libgcrypt < 1.8 does not know about nPth and thus when it reads
    * from /dev/random this will block the process.  To mitigate this
-   * problem we take a short nap when Libgcrypt tells us that it needs
+   * problem we yield the thread when Libgcrypt tells us that it needs
    * more entropy.  This way other threads have chance to run.  */
 #if GCRYPT_VERSION_NUMBER < 0x010800 /* 1.8.0 */
   if (what && !strcmp (what, "need_entropy"))
-    npth_usleep (100000); /* 100ms */
+    {
+#if GPGRT_VERSION_NUMBER < 0x011900 /* 1.25 */
+      /* In older gpg-error versions gpgrt_yield is buggy for use with
+       * nPth and thus we need to resort to a sleep call.  */
+      npth_usleep (1000); /* 1ms */
+#else
+      gpgrt_yield ();
+#endif
+    }
 #endif
 }
 

-----------------------------------------------------------------------

Summary of changes:
 agent/gpg-agent.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
The GNU Privacy Guard
http://git.gnupg.org




More information about the Gnupg-commits mailing list