[git] GPGME - branch, master, updated. gpgme-1.12.0-38-g337c108

by Werner Koch cvs at cvs.gnupg.org
Fri Nov 2 09:03:59 CET 2018


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 "GnuPG Made Easy".

The branch, master has been updated
       via  337c10825525d4084f3f437fde5af3806707e6a4 (commit)
       via  acef4f775f273bbef63bc81afbad8feaabc7414e (commit)
      from  63ba09b541dabbe838253926896e721cb9be564a (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 337c10825525d4084f3f437fde5af3806707e6a4
Author: Werner Koch <wk at gnupg.org>
Date:   Fri Nov 2 09:03:43 2018 +0100

    core: Print a dump of the I/O data only at level 8.
    
    * src/debug.h (TRACE_SUC3): New.
    (TRACE_LOGBUFX): New.
    * src/posix-io.c: Use TRACE_LOGBUFX instead of TRACE_LOGBUF.
    * src/w32-glib-io.c: Ditto.
    --
    
    This will also be changed for w32-io as part of another commit.
    
    Signed-off-by: Werner Koch <wk at gnupg.org>

diff --git a/src/debug.h b/src/debug.h
index ca65d9e..ecd230f 100644
--- a/src/debug.h
+++ b/src/debug.h
@@ -34,7 +34,11 @@
 #define XSTRINGIFY(v) STRINGIFY(v)
 
 

-/* The debug levels.  */
+/*
+ * The debug levels.
+ *
+ * Note that TRACE_LOGBUFX uses the current debug level + 1.
+ */
 
 #define DEBUG_INIT	1
 #define DEBUG_GLOBAL    2
@@ -211,6 +215,9 @@ _gpgme_trace_gpgme_error (gpgme_error_t err, const char *file, int line)
 #define TRACE_SUC2(fmt, arg1, arg2)					\
   _gpgme_debug (_gpgme_trace_level, "%s: leave: " fmt "\n",	\
 		_gpgme_trace_func, arg1, arg2), _gpgme_debug_frame_end ()
+#define TRACE_SUC3(fmt, arg1, arg2, arg3)                            \
+  _gpgme_debug (_gpgme_trace_level, "%s: leave: " fmt "\n",	\
+		_gpgme_trace_func, arg1, arg2, arg3), _gpgme_debug_frame_end ()
 #define TRACE_SUC4(fmt, arg1, arg2, arg3, arg4)			\
   _gpgme_debug (_gpgme_trace_level, "%s: leave: " fmt "\n",	\
 		_gpgme_trace_func, arg1, arg2, arg3, arg4), \
@@ -256,6 +263,10 @@ _gpgme_trace_gpgme_error (gpgme_error_t err, const char *file, int line)
   _gpgme_debug_buffer (_gpgme_trace_level, "%s: check: %s",	\
 		       _gpgme_trace_func, buf, len)
 
+#define TRACE_LOGBUFX(buf, len)					\
+  _gpgme_debug_buffer (_gpgme_trace_level+1, "%s: check: %s",	\
+		       _gpgme_trace_func, buf, len)
+
 #define TRACE_SEQ(hlp,fmt)						\
   _gpgme_debug_begin (&(hlp), _gpgme_trace_level,			\
                       "%s: check: %s=%p, " fmt, _gpgme_trace_func,	\
diff --git a/src/posix-io.c b/src/posix-io.c
index 0448d29..322c41a 100644
--- a/src/posix-io.c
+++ b/src/posix-io.c
@@ -117,7 +117,7 @@ _gpgme_io_read (int fd, void *buffer, size_t count)
     }
   while (nread == -1 && errno == EINTR);
 
-  TRACE_LOGBUF (buffer, nread);
+  TRACE_LOGBUFX (buffer, nread);
   return TRACE_SYSRES (nread);
 }
 
@@ -128,7 +128,7 @@ _gpgme_io_write (int fd, const void *buffer, size_t count)
   int nwritten;
   TRACE_BEG2 (DEBUG_SYSIO, "_gpgme_io_write", fd,
 	      "buffer=%p, count=%u", buffer, count);
-  TRACE_LOGBUF (buffer, count);
+  TRACE_LOGBUFX (buffer, count);
 
   do
     {
@@ -785,7 +785,7 @@ _gpgme_io_recvmsg (int fd, struct msghdr *msg, int flags)
       while (nr > 0)
 	{
 	  int len = nr > iov->iov_len ? iov->iov_len : nr;
-	  TRACE_LOGBUF (msg->msg_iov->iov_base, len);
+	  TRACE_LOGBUFX (msg->msg_iov->iov_base, len);
 	  iov++;
 	  nr -= len;
 	}
@@ -816,7 +816,7 @@ _gpgme_io_sendmsg (int fd, const struct msghdr *msg, int flags)
   while (nwritten > 0)
     {
       int len = nwritten > iov->iov_len ? iov->iov_len : nwritten;
-      TRACE_LOGBUF (msg->msg_iov->iov_base, len);
+      TRACE_LOGBUFX (msg->msg_iov->iov_base, len);
       iov++;
       nwritten -= len;
     }
diff --git a/src/w32-glib-io.c b/src/w32-glib-io.c
index 66dc9bf..967c64e 100644
--- a/src/w32-glib-io.c
+++ b/src/w32-glib-io.c
@@ -301,7 +301,7 @@ _gpgme_io_read (int fd, void *buffer, size_t count)
     }
 
   if (nread != 0 && nread != -1)
-    TRACE_LOGBUF (buffer, nread);
+    TRACE_LOGBUFX (buffer, nread);
 
   errno = saved_errno;
   return TRACE_SYSRES (nread);
@@ -319,7 +319,7 @@ _gpgme_io_write (int fd, const void *buffer, size_t count)
 
   TRACE_BEG2 (DEBUG_SYSIO, "_gpgme_io_write", fd,
 	      "buffer=%p, count=%u", buffer, count);
-  TRACE_LOGBUF (buffer, count);
+  TRACE_LOGBUFX (buffer, count);
 
   chan = find_channel (fd);
   if (!chan)

commit acef4f775f273bbef63bc81afbad8feaabc7414e
Author: Werner Koch <wk at gnupg.org>
Date:   Fri Nov 2 08:47:44 2018 +0100

    w32: Fix and improve CancelSynchronousIo use.
    
    * src/w32-util.c (_gpgme_w32_cancel_synchronous_io): Fix name of DLL
    and print trace info only on error.
    --
    
    Fixes-commit: 63ba09b541dabbe838253926896e721cb9be564a
    Signed-off-by: Werner Koch <wk at gnupg.org>

diff --git a/src/w32-util.c b/src/w32-util.c
index 8a04c8c..798f42b 100644
--- a/src/w32-util.c
+++ b/src/w32-util.c
@@ -251,7 +251,7 @@ _gpgme_w32_cancel_synchronous_io (HANDLE thread)
     {
       /* Available since Vista; thus we dynload it.  */
       initialized = 1;
-      handle = dlopen ("kerner32.dll", RTLD_LAZY);
+      handle = dlopen ("kernel32.dll", RTLD_LAZY);
       if (handle)
         {
           func = dlsym (handle, "CancelSynchronousIo");
@@ -265,9 +265,11 @@ _gpgme_w32_cancel_synchronous_io (HANDLE thread)
 
   if (func)
     {
-      int rc = func (thread);
-      TRACE2 (DEBUG_ENGINE, "gpgme:CancelSynchronousIo", 0,
-	      "called for thread %p; result=%d", thread, rc);
+      if (!func (thread) && GetLastError() != ERROR_NOT_FOUND)
+        {
+          TRACE2 (DEBUG_ENGINE, "gpgme:CancelSynchronousIo", 0,
+                  "called for thread %p: ec=%d", thread, GetLastError ());
+        }
     }
   else
     {

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

Summary of changes:
 src/debug.h       | 13 ++++++++++++-
 src/posix-io.c    |  8 ++++----
 src/w32-glib-io.c |  4 ++--
 src/w32-util.c    | 10 ++++++----
 4 files changed, 24 insertions(+), 11 deletions(-)


hooks/post-receive
-- 
GnuPG Made Easy
http://git.gnupg.org




More information about the Gnupg-commits mailing list