2002-08-20 Marcus Brinkmann <marcus@g10code.de>
authorMarcus Brinkmann <mb@g10code.com>
Tue, 20 Aug 2002 11:01:43 +0000 (11:01 +0000)
committerMarcus Brinkmann <mb@g10code.com>
Tue, 20 Aug 2002 11:01:43 +0000 (11:01 +0000)
* gpgme.c (_gpgme_set_op_info): Append data on subsequent calls.
* encrypt-sign.c (encrypt_sign_status_handler): Remove op_info
handling.

trunk/gpgme/ChangeLog
trunk/gpgme/encrypt-sign.c
trunk/gpgme/gpgme.c

index 37e90d2adf008422328464048f131060360a5eeb..0a31b5c2a016455e613ac5ce581f40ad887b223f 100644 (file)
@@ -1,3 +1,9 @@
+2002-08-20  Marcus Brinkmann  <marcus@g10code.de>
+
+       * gpgme.c (_gpgme_set_op_info): Append data on subsequent calls.
+       * encrypt-sign.c (encrypt_sign_status_handler): Remove op_info
+       handling.
+
 2002-08-19  Werner Koch  <wk@gnupg.org>
 
        * decrypt.c (is_token,skip_token): Duplicated from verify.c
index 3ea6f28565263baa502ee6f0990cab81f50e6210..9e49e584c7dd42208a53b4094db70ac3bfd3f261 100644 (file)
@@ -40,16 +40,7 @@ encrypt_sign_status_handler (GpgmeCtx ctx, GpgmeStatusCode code, char *args)
   size_t encrypt_info_len;
 
   _gpgme_encrypt_status_handler (ctx, code, args);
-
-  if (code == GPGME_STATUS_EOF)
-    {
-      encrypt_info = gpgme_data_release_and_get_mem (ctx->op_info,
-                                                    &encrypt_info_len);
-      ctx->op_info = NULL;
-    }
   _gpgme_sign_status_handler (ctx, code, args);
-  if (code == GPGME_STATUS_EOF && encrypt_info)
-    _gpgme_data_append (ctx->op_info, encrypt_info, encrypt_info_len);
 }
 
 
index f96bf5ae84cffb025bc83127fc4efe0a92f5b5cd..6ee2bb1893cd8c972bf932c32dd72c7f615690bd 100644 (file)
@@ -175,20 +175,23 @@ gpgme_get_op_info (GpgmeCtx ctx, int reserved)
 }
 
 
-/*
- * Store the data object with the operation info in the
- * context. Caller should not use that object anymore.
- */
+/* Store the data object INFO with the operation info in the context
+   CTX.  INFO is consumed.  Subsequent calls append the data.  */
 void
 _gpgme_set_op_info (GpgmeCtx ctx, GpgmeData info)
 {
   assert (ctx);
 
-  gpgme_data_release (ctx->op_info);
-  ctx->op_info = NULL;
-
-  if (info)
+  if (!ctx->op_info)
     ctx->op_info = info;
+  else
+    {
+      char *info_mem = 0;
+      size_t info_len;
+
+      info_mem = gpgme_data_release_and_get_mem (info, &info_len);
+      _gpgme_data_append (ctx->op_info, info_mem, info_len);
+    }
 }