[git] Assuan - branch, master, updated. libassuan-2.4.3-8-g7b408d3

by Werner Koch cvs at cvs.gnupg.org
Wed Nov 15 15:48:01 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 "IPC library used by GnuPG".

The branch, master has been updated
       via  7b408d356094ab0ef0a07904a3ddf3832a8aa197 (commit)
      from  87c2bb5708ff202651fca81d91d5f1e0c898cb07 (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 7b408d356094ab0ef0a07904a3ddf3832a8aa197
Author: Werner Koch <wk at gnupg.org>
Date:   Wed Nov 15 15:43:24 2017 +0100

    Fix the nanosleep case of __assuan_usleep.
    
    * src/system-posix.c (__assuan_usleep): Handle full seconds.
    --
    
    This function would have failed for any value >= 1000000 because the
    nsec field is limited to 999999999 and the function fails for larger
    values.
    
    Signed-off-by: Werner Koch <wk at gnupg.org>

diff --git a/src/assuan-socket.c b/src/assuan-socket.c
index 6131e5b..147ec2a 100644
--- a/src/assuan-socket.c
+++ b/src/assuan-socket.c
@@ -745,6 +745,11 @@ socks5_connect (assuan_context_t ctx, assuan_fd_t sock,
       ret = _assuan_connect (ctx, HANDLE2SOCKET (sock),
                              proxyaddr, proxyaddrlen);
     }
+  /* If we get an EINPROGRESS here the caller is trying to do a
+   * non-blocking connect (e.g. for custom time out handling) which
+   * fails here.  The easiest fix would be to allow the client to tell
+   * us the timeout value and we do the timeout handling later on in the
+   * Socks protocol.  */
   if (ret)
     return ret;
   buffer[0] = 5; /* RFC-1928 VER field.  */
diff --git a/src/system-posix.c b/src/system-posix.c
index 52376da..65d2c8c 100644
--- a/src/system-posix.c
+++ b/src/system-posix.c
@@ -68,9 +68,8 @@ __assuan_usleep (assuan_context_t ctx, unsigned int usec)
     struct timespec req;
     struct timespec rem;
 
-    req.tv_sec = 0;
-    req.tv_nsec = usec * 1000;
-
+    req.tv_sec  = usecs / 1000000;
+    req.tv_nsec = (usecs % 1000000) * 1000;
     while (nanosleep (&req, &rem) < 0 && errno == EINTR)
       req = rem;
   }

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

Summary of changes:
 src/assuan-socket.c | 5 +++++
 src/system-posix.c  | 5 ++---
 2 files changed, 7 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
IPC library used by GnuPG
http://git.gnupg.org




More information about the Gnupg-commits mailing list