[git] Assuan - branch, master, updated. libassuan-2.1.2-4-g2f040c0

by Werner Koch cvs at cvs.gnupg.org
Fri Nov 7 18:10:32 CET 2014


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  2f040c0b7bcfdddf5e3597fbcdae9cc04fafe653 (commit)
       via  3003c5d70febc8d4b6be9c95ca6deda7b033cabc (commit)
       via  1023508f210cd136992661c01b55b428de86a182 (commit)
      from  416d045b196464c408bed587d1ecf5496924bddf (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 2f040c0b7bcfdddf5e3597fbcdae9cc04fafe653
Author: Werner Koch <wk at gnupg.org>
Date:   Fri Nov 7 18:11:00 2014 +0100

    Post release updates.
    
    --

diff --git a/NEWS b/NEWS
index a1f1609..326196d 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,6 @@
+Noteworthy changes in version 2.1.4 (unreleased) [C4/A4/R_]
+------------------------------------------------
+
 Noteworthy changes in version 2.1.3 (2014-11-07) [C4/A4/R3]
 ------------------------------------------------
 
diff --git a/configure.ac b/configure.ac
index 793b451..d03fd58 100644
--- a/configure.ac
+++ b/configure.ac
@@ -31,7 +31,7 @@ min_automake_version="1.10"
 m4_define([mym4_package],[libassuan])
 m4_define([mym4_major], [2])
 m4_define([mym4_minor], [1])
-m4_define([mym4_micro], [3])
+m4_define([mym4_micro], [4])
 
 # To start a new development series, i.e a new major or minor number
 # you need to mark an arbitrary commit before the first beta release

commit 3003c5d70febc8d4b6be9c95ca6deda7b033cabc
Author: Werner Koch <wk at gnupg.org>
Date:   Fri Nov 7 18:02:49 2014 +0100

    Release 2.1.3.
    
    * configure.ac: Set LT version to C4/A4/R3.

diff --git a/NEWS b/NEWS
index 0b3bdcf..a1f1609 100644
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,8 @@
-Noteworthy changes in version 2.1.3 (unreleased) [C4/A4/R_]
+Noteworthy changes in version 2.1.3 (2014-11-07) [C4/A4/R3]
 ------------------------------------------------
 
+ * Performance fix for Windows.
+
 
 Noteworthy changes in version 2.1.2 (2014-08-17) [C4/A4/R2]
 ------------------------------------------------
diff --git a/configure.ac b/configure.ac
index baa01dc..793b451 100644
--- a/configure.ac
+++ b/configure.ac
@@ -60,7 +60,7 @@ AC_INIT([mym4_package],[mym4_version], [http://bugs.gnupg.org])
 #
 LIBASSUAN_LT_CURRENT=4
 LIBASSUAN_LT_AGE=4
-LIBASSUAN_LT_REVISION=2
+LIBASSUAN_LT_REVISION=3
 
 # If the API is changed in an incompatible way: increment the next counter.
 LIBASSUAN_CONFIG_API_VERSION=2

commit 1023508f210cd136992661c01b55b428de86a182
Author: Werner Koch <wk at gnupg.org>
Date:   Fri Nov 7 17:20:19 2014 +0100

    w32: Remove I/O delays due to our 100ms delay after an EAGAIN.
    
    * src/system-w32.c (__assuan_read): Retry using select.  Map
    WSAECONNRESET to EPIPE.
    (__assuan_write): Retry using select.
    * src/assuan-buffer.c (readline) [W32]:  Return EOF instead of EPIPE.

diff --git a/src/assuan-buffer.c b/src/assuan-buffer.c
index f2238e7..04aff5a 100644
--- a/src/assuan-buffer.c
+++ b/src/assuan-buffer.c
@@ -80,6 +80,15 @@ readline (assuan_context_t ctx, char *buf, size_t buflen,
         {
           if (errno == EINTR)
             continue;
+#ifdef HAVE_W32_SYSTEM
+          if (errno == EPIPE)
+            {
+              /* Under Windows we get EPIPE (actually ECONNRESET)
+                 after termination of the client.  Assume an EOF.  */
+              *r_eof = 1;
+              break; /* allow incomplete lines */
+            }
+#endif /*HAVE_W32_SYSTEM*/
           return -1; /* read error */
         }
       else if (!n)
diff --git a/src/system-w32.c b/src/system-w32.c
index 3ee5359..85b8fa8 100644
--- a/src/system-w32.c
+++ b/src/system-w32.c
@@ -197,9 +197,27 @@ __assuan_read (assuan_context_t ctx, assuan_fd_t fd, void *buffer, size_t size)
 
   if (is_socket (fd))
     {
+      int tries = 3;
+
+    again:
+      ec = 0;
       res = recv (HANDLE2SOCKET (fd), buffer, size, 0);
       if (res == -1)
         ec = WSAGetLastError ();
+      if (ec == WSAEWOULDBLOCK && tries--)
+        {
+          /* EAGAIN: Use select to wait for resources and try again.
+             We do this 3 times and then give up.  The higher level
+             layer then needs to take care of EAGAIN.  No need to
+             specify a timeout - the socket is not expected to be in
+             blocking mode.  */
+          fd_set fds;
+
+          FD_ZERO (&fds);
+          FD_SET (HANDLE2SOCKET (fd), &fds);
+          select (0, &fds, NULL, NULL, NULL);
+          goto again;
+        }
     }
   else
     {
@@ -224,6 +242,7 @@ __assuan_read (assuan_context_t ctx, assuan_fd_t fd, void *buffer, size_t size)
 	  gpg_err_set_errno (EAGAIN);
 	  break;
 
+        case WSAECONNRESET: /* Due to the use of recv.  */
         case ERROR_BROKEN_PIPE:
 	  gpg_err_set_errno (EPIPE);
 	  break;
@@ -247,9 +266,27 @@ __assuan_write (assuan_context_t ctx, assuan_fd_t fd, const void *buffer,
 
   if (is_socket (fd))
     {
+      int tries = 3;
+
+    again:
+      ec = 0;
       res = send (HANDLE2SOCKET (fd), buffer, size, 0);
       if (res == -1)
         ec = WSAGetLastError ();
+      if (ec == WSAEWOULDBLOCK && tries--)
+        {
+          /* EAGAIN: Use select to wait for resources and try again.
+             We do this 3 times and then give up.  The higher level
+             layer then needs to take care of EAGAIN.  No need to
+             specify a timeout - the socket is not expected to be in
+             blocking mode.  */
+          fd_set fds;
+
+          FD_ZERO (&fds);
+          FD_SET (HANDLE2SOCKET (fd), &fds);
+          select (0, NULL, &fds, NULL, NULL);
+          goto again;
+        }
     }
   else
     {

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

Summary of changes:
 NEWS                |    7 ++++++-
 configure.ac        |    4 ++--
 src/assuan-buffer.c |    9 +++++++++
 src/system-w32.c    |   37 +++++++++++++++++++++++++++++++++++++
 4 files changed, 54 insertions(+), 3 deletions(-)


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




More information about the Gnupg-commits mailing list