[git] GnuPG - branch, master, updated. gnupg-2.1.11-65-g14d27b2

by Neal H. Walfield cvs at cvs.gnupg.org
Tue Feb 23 21:36:10 CET 2016


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 "The GNU Privacy Guard".

The branch, master has been updated
       via  14d27b2cadf9b0bb413f2b8bad2d81c1d370c2e7 (commit)
      from  f57a91afb69c58f9d8d9632801650f28c7dc1e0d (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 14d27b2cadf9b0bb413f2b8bad2d81c1d370c2e7
Author: Neal H. Walfield <neal at g10code.com>
Date:   Tue Feb 23 21:28:24 2016 +0100

    common: Improve a function's documentation and comments.
    
    * common/iobuf.c (iobuf_set_partial_body_length_mode): Fix
    documentation and comment.  Add an assert.
    
    --
    Signed-off-by: Neal H. Walfield <neal at g10code.com>

diff --git a/common/iobuf.c b/common/iobuf.c
index a0d48c6..9816d55 100644
--- a/common/iobuf.c
+++ b/common/iobuf.c
@@ -2515,8 +2515,16 @@ iobuf_get_fname_nonnull (iobuf_t a)
 
 
 /****************
- * enable partial block mode as described in the OpenPGP draft.
- * LEN is the first length byte on read, but ignored on writes.
+ * Enable or disable partial body length mode (RFC 4880 4.2.2.4).
+ *
+ * If LEN is 0, this disables partial block mode by popping the
+ * partial body length filter, which which must be the most recently
+ * added filter.
+ *
+ * If LEN is non-zero, it pushes a partial body length filter.  If
+ * this is a read filter, LEN must be the length byte from the first
+ * chunk and A should be position just after this first partial body
+ * length header.
  */
 void
 iobuf_set_partial_body_length_mode (iobuf_t a, size_t len)
@@ -2525,21 +2533,17 @@ iobuf_set_partial_body_length_mode (iobuf_t a, size_t len)
 
   ctx->use = a->use;
   if (!len)
+    /* Disable partial body length mode.  */
     {
       if (a->use == IOBUF_INPUT)
 	log_debug ("pop_filter called in set_partial_block_mode"
 		   " - please report\n");
-      /* XXX: This pop_filter doesn't make sense.  Since we haven't
-	 actually added the filter to the pipeline yet, why are we
-	 popping anything?  Moreover, since we don't report an error,
-	 the caller won't directly see an error.  I think that it
-	 would be better to push the filter and set a->error to
-	 GPG_ERR_BAD_DATA, but Werner thinks it's impossible for len
-	 to be 0 (but he doesn't want to remove the check just in
-	 case).  */
+
+      log_assert (a->filter == block_filter);
       pop_filter (a, block_filter, NULL);
     }
   else
+    /* Enabled partial body length mode.  */
     {
       ctx->partial = 1;
       ctx->size = 0;

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

Summary of changes:
 common/iobuf.c | 24 ++++++++++++++----------
 1 file changed, 14 insertions(+), 10 deletions(-)


hooks/post-receive
-- 
The GNU Privacy Guard
http://git.gnupg.org




More information about the Gnupg-commits mailing list