[git] GnuPG - branch, T3490-proposal1, updated. gnupg-2.2.1-75-g149041b

by Daniel Kahn Gillmor cvs at cvs.gnupg.org
Wed Nov 8 17:56:04 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, T3490-proposal1 has been updated
  discards  ceac6e9e6c088767964b53d59cef003bbe828376 (commit)
  discards  1fe8fc56f2468d41b575a183721f96fbe4108012 (commit)
       via  149041b0b917f4298239fe18b5ebd5ead71584a6 (commit)
       via  0471ff9d3bf8d6b9a359f3c426d70d0935066907 (commit)
       via  68284e1509490a68adcc6019a5bf8fb3674d3807 (commit)
       via  ab7ac827041b5cd97bbca7a75b0930072dd6611f (commit)
       via  f9f72ffbfa9fd7d1a7a1823697d116d76155b407 (commit)
       via  380bce13d94ff03c96e39ac1d834f382c5c730a1 (commit)
       via  42308224d1fce64c666aed2be5eb4ef42e8aced4 (commit)
       via  52d41c8b0f4af6278d18d8935399ddad16a26856 (commit)
       via  f7212f1d11aad5d910d2c77b2e5c6ab31a0e786e (commit)
       via  922bae8082f2f8d696ea0e7d7e9e4d986789bdfc (commit)
       via  ea09b6cded9d31a8ebd91878553c3eaa2b76e817 (commit)
       via  16513102036a91aa46741260b3af0d42a25941e0 (commit)
       via  5e96fe72e477d09e35ccee48af0fd9ab2b3ae409 (commit)
       via  fd3f5ca151b9440ade2fa4991b7cfb190e357893 (commit)
       via  87b94e08d7811af94403384c45ae5d2bb88f6ed9 (commit)
       via  f795f4529d8ab5a05db1cc1960abd34390bfae1b (commit)
       via  6c63a04569c07c9c2817c7c530a92ccfa58155cc (commit)
       via  d63b7966cdd72548c60466c620de5cd6104a779e (commit)

This update added new revisions after undoing existing revisions.  That is
to say, the old revision is not a strict subset of the new revision.  This
situation occurs when you --force push a change and generate a repository
containing something like this:

 * -- * -- B -- O -- O -- O (ceac6e9e6c088767964b53d59cef003bbe828376)
            \
             N -- N -- N (149041b0b917f4298239fe18b5ebd5ead71584a6)

When this happens we assume that you've already had alert emails for all
of the O revisions, and so we here report only the revisions in the N
branch from the common base, B.

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 149041b0b917f4298239fe18b5ebd5ead71584a6
Author: Daniel Kahn Gillmor <dkg at fifthhorseman.net>
Date:   Wed Nov 8 16:26:40 2017 +0100

    assuan: Use exponential decay for first 1s of spinlock.
    
    * common/asshelp.c (wait_for_sock): instead of checking the socket
    every second, we check 10 times in the first second (with exponential
    decay).
    --
    
    This cuts the wall clock time for the standard test suite roughly by
    half.
    
    GnuPG-bug-id: 3490
    Signed-off-by: Daniel Kahn Gillmor <dkg at fifthhorseman.net>

diff --git a/common/asshelp.c b/common/asshelp.c
index 68a41be..76f812d 100644
--- a/common/asshelp.c
+++ b/common/asshelp.c
@@ -310,14 +310,32 @@ unlock_spawning (lock_spawn_t *lock, const char *name)
 static gpg_error_t
 wait_for_sock (int secs, const char *name, const char *sockname, int verbose, assuan_context_t ctx, int *did_success_msg)
 {
-  int i;
   gpg_error_t err = 0;
-  for (i=0; i < secs; i++)
+  int target_us = secs * 1000000;
+  int elapsed_us = 0;
+  /*
+   * 977us * 1024 = just a little more than 1s.
+   * so we will double this timeout 10 times in the first
+   * second, and then switch over to 1s checkins.
+   */
+  int next_sleep_us = 977;
+  int lastalert = secs+1;
+  int secsleft;
+
+  while (elapsed_us < target_us)
     {
       if (verbose)
-        log_info (_("waiting for the %s to come up ... (%ds)\n"),
-                  name, secs - i);
-      gnupg_sleep (1);
+        {
+          secsleft = (target_us - elapsed_us)/1000000;
+          if (secsleft < lastalert)
+            {
+              log_info (_("waiting for the %s to come up ... (%ds)\n"),
+                        name, secsleft);
+              lastalert = secsleft;
+            }
+        }
+      gnupg_usleep (next_sleep_us);
+      elapsed_us += next_sleep_us;
       err = assuan_socket_connect (ctx, sockname, 0, 0);
       if (!err)
         {
@@ -329,6 +347,9 @@ wait_for_sock (int secs, const char *name, const char *sockname, int verbose, as
             }
           break;
         }
+      next_sleep_us *= 2;
+      if (next_sleep_us > 1000000)
+        next_sleep_us = 1000000;
     }
   return err;
 }

commit 0471ff9d3bf8d6b9a359f3c426d70d0935066907
Author: Daniel Kahn Gillmor <dkg at fifthhorseman.net>
Date:   Wed Nov 8 16:15:30 2017 +0100

    assuan: Reorganize waiting for socket.
    
    * common/asshelp.c (wait_for_sock): New function, collecting
    codepaths from...
    (start_new_gpg_agent) here and...
    (start_new_dirmngr) here.
    --
    
    This has no functional change, but makes it easier to make this
    function more efficient.
    
    GnuPG-bug-id: 3490
    Signed-off-by: Daniel Kahn Gillmor <dkg at fifthhorseman.net>

diff --git a/common/asshelp.c b/common/asshelp.c
index f3a92f9..68a41be 100644
--- a/common/asshelp.c
+++ b/common/asshelp.c
@@ -307,6 +307,32 @@ unlock_spawning (lock_spawn_t *lock, const char *name)
     }
 }
 
+static gpg_error_t
+wait_for_sock (int secs, const char *name, const char *sockname, int verbose, assuan_context_t ctx, int *did_success_msg)
+{
+  int i;
+  gpg_error_t err = 0;
+  for (i=0; i < secs; i++)
+    {
+      if (verbose)
+        log_info (_("waiting for the %s to come up ... (%ds)\n"),
+                  name, secs - i);
+      gnupg_sleep (1);
+      err = assuan_socket_connect (ctx, sockname, 0, 0);
+      if (!err)
+        {
+          if (verbose)
+            {
+              log_info (_("connection to %s established\n"),
+                        name);
+              *did_success_msg = 1;
+            }
+          break;
+        }
+    }
+  return err;
+}
+
 /* Try to connect to the agent via socket or start it if it is not
    running and AUTOSTART is set.  Handle the server's initial
    greeting.  Returns a new assuan context at R_CTX or an error
@@ -433,25 +459,8 @@ start_new_gpg_agent (assuan_context_t *r_ctx,
             log_error ("failed to start agent '%s': %s\n",
                        agent_program, gpg_strerror (err));
           else
-            {
-              for (i=0; i < SECS_TO_WAIT_FOR_AGENT; i++)
-                {
-                  if (verbose)
-                    log_info (_("waiting for the agent to come up ... (%ds)\n"),
-                              SECS_TO_WAIT_FOR_AGENT - i);
-                  gnupg_sleep (1);
-                  err = assuan_socket_connect (ctx, sockname, 0, 0);
-                  if (!err)
-                    {
-                      if (verbose)
-                        {
-                          log_info (_("connection to agent established\n"));
-                          did_success_msg = 1;
-                        }
-                      break;
-                    }
-                }
-            }
+            err = wait_for_sock (SECS_TO_WAIT_FOR_AGENT, "agent",
+                                 sockname, verbose, ctx, &did_success_msg);
         }
 
       unlock_spawning (&lock, "agent");
@@ -584,29 +593,8 @@ start_new_dirmngr (assuan_context_t *r_ctx,
             log_error ("failed to start the dirmngr '%s': %s\n",
                        dirmngr_program, gpg_strerror (err));
           else
-            {
-              int i;
-
-              for (i=0; i < SECS_TO_WAIT_FOR_DIRMNGR; i++)
-                {
-                  if (verbose)
-                    log_info (_("waiting for the dirmngr "
-                                "to come up ... (%ds)\n"),
-                              SECS_TO_WAIT_FOR_DIRMNGR - i);
-                  gnupg_sleep (1);
-                  err = assuan_socket_connect (ctx, sockname, 0, 0);
-                  if (!err)
-                    {
-                      if (verbose)
-                        {
-                          log_info (_("connection to the dirmngr"
-                                      " established\n"));
-                          did_success_msg = 1;
-                        }
-                      break;
-                    }
-                }
-            }
+            err = wait_for_sock (SECS_TO_WAIT_FOR_DIRMNGR, "dirmngr",
+                                 sockname, verbose, ctx, &did_success_msg);
         }
 
       unlock_spawning (&lock, "dirmngr");

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

Summary of changes:
 NEWS                                   |  42 +++++
 agent/agent.h                          |   6 +
 agent/command.c                        |  36 ++--
 agent/gpg-agent.c                      |   9 +
 agent/learncard.c                      |  12 +-
 agent/protect.c                        |  40 ++++-
 agent/t-protect.c                      |   2 +-
 build-aux/speedo.mk                    |  20 ++-
 build-aux/speedo/w32/README.txt        |  25 ++-
 build-aux/speedo/w32/pkg-copyright.txt | 289 +++++++++++++++++++++++++++++----
 configure.ac                           |   3 +-
 dirmngr/dirmngr.c                      |   2 +-
 dirmngr/dirmngr_ldap.c                 |   2 +-
 doc/dirmngr.texi                       |   2 +-
 doc/gpg-agent.texi                     |  34 +++-
 g10/card-util.c                        | 113 ++++++++-----
 g10/keygen.c                           |  25 ++-
 tests/openpgp/defs.scm                 |   1 +
 18 files changed, 535 insertions(+), 128 deletions(-)


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




More information about the Gnupg-commits mailing list