[Pkg-gnupg-commit] [libassuan] 329/437: Add a no_logging flag.

Eric Dorland eric at moszumanska.debian.org
Fri May 22 05:33:59 UTC 2015


This is an automated email from the git hooks/post-receive script.

eric pushed a commit to branch master
in repository libassuan.

commit 8a403a6bd56c58d2ee1d47b959d6adb7096f04d2
Author: Werner Koch <wk at gnupg.org>
Date:   Wed Sep 1 10:10:28 2010 +0000

    Add a no_logging flag.
---
 NEWS                 | 4 ++++
 src/ChangeLog        | 7 +++++++
 src/assuan-defs.h    | 1 +
 src/assuan-logging.c | 4 +++-
 src/assuan.h.in      | 2 ++
 src/context.c        | 8 ++++++++
 6 files changed, 25 insertions(+), 1 deletion(-)

diff --git a/NEWS b/NEWS
index a2fe90b..01cdff2 100644
--- a/NEWS
+++ b/NEWS
@@ -3,9 +3,12 @@ Noteworthy changes in version 2.0.2
 
  * A new flag may now be used to convey comments via assuan_transact.
 
+ * A new flag value may now be used to disable logging.
+
  * Interface changes relative to the 2.0.1 release:
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  ASSUAN_CONVEY_COMMENTS   NEW.
+ ASSUAN_NO_LOGGING        NEW.
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 
@@ -24,6 +27,7 @@ Noteworthy changes in version 2.0.1 (2010-08-09)
  assuan_free               NEW.
  _assuan_w32ce_create_pipe NEW.
  ASSUAN_LOG_CONTROL        NEW.
+ ASSUAN_NO_LOGGING         NEW.
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 
diff --git a/src/ChangeLog b/src/ChangeLog
index c85bbde..db6072a 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,10 @@
+2010-09-01  Werner Koch  <wk at g10code.com>
+
+	* assuan.h.in (ASSUAN_NO_LOGGING): New.
+	* assuan-defs.h (struct assuan_context_s): Add FLAGS.NO_LOGGING.
+	* context.c (assuan_set_flag, assuan_get_flag): Support new flag.
+	* assuan-logging.c (_assuan_log_control_channel): Implement new flag.
+
 2010-08-11  Werner Koch  <wk at g10code.com>
 
 	* assuan.h.in (ASSUAN_CONVEY_COMMENTS): New.
diff --git a/src/assuan-defs.h b/src/assuan-defs.h
index 3cdbc92..9c1e64e 100644
--- a/src/assuan-defs.h
+++ b/src/assuan-defs.h
@@ -88,6 +88,7 @@ struct assuan_context_s
     unsigned int confidential : 1;
     unsigned int no_fixsignals : 1;
     unsigned int convey_comments : 1;
+    unsigned int no_logging : 1;
   } flags;
 
   /* If set, this is called right before logging an I/O line.  */
diff --git a/src/assuan-logging.c b/src/assuan-logging.c
index 14cebe2..dc2427e 100644
--- a/src/assuan-logging.c
+++ b/src/assuan-logging.c
@@ -170,7 +170,9 @@ _assuan_log_control_channel (assuan_context_t ctx, int outbound,
 
   /* Check whether logging is enabled and do a quick check to see
      whether the callback supports our category.  */
-  if (!ctx || !ctx->log_cb 
+  if (!ctx
+      || !ctx->log_cb 
+      || ctx->flags.no_logging
       || !(*ctx->log_cb) (ctx, ctx->log_cb_data, ASSUAN_LOG_CONTROL, NULL))
     return;
 
diff --git a/src/assuan.h.in b/src/assuan.h.in
index 8e1982d..456e184 100644
--- a/src/assuan.h.in
+++ b/src/assuan.h.in
@@ -164,6 +164,8 @@ typedef unsigned int assuan_flag_t;
 /* This flag changes assuan_transact to return comment lines via the
    status callback.  The default is to skip comment lines.  */
 #define ASSUAN_CONVEY_COMMENTS 4
+/* This flags disables logging for one context.  */
+#define ASSUAN_NO_LOGGING 5
 
 /* For context CTX, set the flag FLAG to VALUE.  Values for flags
    are usually 1 or 0 but certain flags might allow for other values;
diff --git a/src/context.c b/src/context.c
index 6b30236..a56a4d2 100644
--- a/src/context.c
+++ b/src/context.c
@@ -84,6 +84,10 @@ assuan_set_flag (assuan_context_t ctx, assuan_flag_t flag, int value)
     case ASSUAN_CONVEY_COMMENTS:
       ctx->flags.convey_comments = value;
       break;
+
+    case ASSUAN_NO_LOGGING:
+      ctx->flags.no_logging = value;
+      break;
     }
 }
 
@@ -116,6 +120,10 @@ assuan_get_flag (assuan_context_t ctx, assuan_flag_t flag)
     case ASSUAN_CONVEY_COMMENTS:
       res = ctx->flags.convey_comments;
       break;
+      
+    case ASSUAN_NO_LOGGING:
+      res = ctx->flags.no_logging;
+      break;
     }
 
   return TRACE_SUC1 ("flag_value=%i", res);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-gnupg/libassuan.git



More information about the Pkg-gnupg-commit mailing list