[git] Assuan - branch, master, updated. libassuan-2.4.1-3-g18ca159

by Werner Koch cvs at cvs.gnupg.org
Thu Nov 26 18:20:23 CET 2015


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  18ca1593c62d62bb72b4e7e14347cd221c187138 (commit)
       via  9f24377f9f19983926233af8b475328bb7fe9e65 (commit)
      from  7d836d5126b5399f3d76f5fa2d7ede7905b39304 (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 18ca1593c62d62bb72b4e7e14347cd221c187138
Author: Werner Koch <wk at gnupg.org>
Date:   Thu Nov 26 18:16:13 2015 +0100

    Protect connect system hook against blocking (nPth).
    
    * src/assuan.h.in (ASSUAN_SYSTEM_NPTH_IMPL): Add wrapper for connect.
    
    Signed-off-by: Werner Koch <wk at gnupg.org>

diff --git a/NEWS b/NEWS
index 786297b..7168207 100644
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,9 @@
 Noteworthy changes in version 2.4.2 (unreleased) [C7/A7/R_]
 ------------------------------------------------
 
+ * The nPth version of the connect system hook does now wrap the call
+   with npth_unprotec/npth_protect to avoid blocking during a connect.
+
 
 Noteworthy changes in version 2.4.1 (2015-11-23) [C7/A7/R1]
 ------------------------------------------------
diff --git a/src/assuan.h.in b/src/assuan.h.in
index 67a1c20..da1af25 100644
--- a/src/assuan.h.in
+++ b/src/assuan.h.in
@@ -571,13 +571,18 @@ extern struct assuan_system_hooks _assuan_system_pth;
   { pid_t res; (void) ctx; npth_unprotect();				\
     res = __assuan_waitpid (ctx, pid, nowait, status, options);		\
     npth_protect(); return res; }					\
+  static int _assuan_npth_connect (assuan_context_t ctx, int sock,      \
+                                   struct sockaddr *addr, socklen_t len)\
+  { int res; npth_unprotect();                                          \
+    res = __assuan_connect (ctx, sock, addr, len);                      \
+    npth_protect(); return res; }                                       \
 									\
   struct assuan_system_hooks _assuan_system_npth =			\
     { ASSUAN_SYSTEM_HOOKS_VERSION, _assuan_npth_usleep, __assuan_pipe,	\
       __assuan_close, _assuan_npth_read, _assuan_npth_write,		\
       _assuan_npth_recvmsg, _assuan_npth_sendmsg,			\
       __assuan_spawn, _assuan_npth_waitpid, __assuan_socketpair,	\
-      __assuan_socket, __assuan_connect }
+      __assuan_socket, _assuan_npth_connect }
 
 extern struct assuan_system_hooks _assuan_system_npth;
 #define ASSUAN_SYSTEM_NPTH &_assuan_system_npth

commit 9f24377f9f19983926233af8b475328bb7fe9e65
Author: Werner Koch <wk at gnupg.org>
Date:   Thu Nov 26 16:33:42 2015 +0100

    Do not use size_t with _assuan_read.
    
    * src/assuan-socket.c (do_readn): Use ssize_t for N.

diff --git a/src/assuan-socket.c b/src/assuan-socket.c
index 9f9f155..bb0e610 100644
--- a/src/assuan-socket.c
+++ b/src/assuan-socket.c
@@ -637,7 +637,7 @@ do_readn (assuan_context_t ctx, assuan_fd_t sockfd,
           void *buffer, size_t nbytes)
 {
   char *p = buffer;
-  size_t n;
+  ssize_t n;
 
   while (nbytes)
     {

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

Summary of changes:
 NEWS                | 3 +++
 src/assuan-socket.c | 2 +-
 src/assuan.h.in     | 7 ++++++-
 3 files changed, 10 insertions(+), 2 deletions(-)


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




More information about the Gnupg-commits mailing list