2009-11-26 Marcus Brinkmann <marcus@g10code.de>
authorMarcus Brinkmann <mb@g10code.com>
Thu, 26 Nov 2009 17:53:06 +0000 (17:53 +0000)
committerMarcus Brinkmann <mb@g10code.com>
Thu, 26 Nov 2009 17:53:06 +0000 (17:53 +0000)
* opassuan.c (opassuan_start): Allocate result structure before
beginning operation.

src/ChangeLog
src/opassuan.c

index 48566fadb2cc7f810b3bdcb3e7f61e614821a4db..6c2ba2006a5ac3ab509bf04e150c553424dc367b 100644 (file)
@@ -1,3 +1,8 @@
+2009-11-26  Marcus Brinkmann  <marcus@g10code.de>
+
+       * opassuan.c (opassuan_start): Allocate result structure before
+       beginning operation.
+
 2009-11-25  Marcus Brinkmann  <marcus@g10code.de>
 
        * gpgme-tool.c (gpgme_server): Use assuan_fd_t and assuan_fdopen
index 0c535dc1faf0a2cc979e216645882b3142b00403..639a3661fe663f562444ed23d26fd56aec9ed309 100644 (file)
 #include "util.h"
 #include "debug.h"
 
+/* LEGACY: Remove this when removing the deprecated result
+   structure.  */
+typedef struct
+{
+  struct _gpgme_op_assuan_result result;
+} *op_data_t;
+
+
 static gpgme_error_t
 opassuan_start (gpgme_ctx_t ctx, int synchronous,
                 const char *command,
@@ -50,6 +58,17 @@ opassuan_start (gpgme_ctx_t ctx, int synchronous,
   if (err)
     return err;
 
+  {
+    /* LEGACY: Remove this when removing the deprecated result
+       structure.  */
+    void *hook;
+    op_data_t opd;
+    err = _gpgme_op_data_lookup (ctx, OPDATA_ASSUAN, &hook,
+                                sizeof (*opd), NULL);
+    if (err)
+      return err;
+  }
+
   return _gpgme_engine_op_assuan_transact (ctx->engine, command,
                                            data_cb, data_cb_value,
                                            inq_cb, inq_cb_value,
@@ -138,11 +157,6 @@ struct engine
   void *engine;
 };
 
-typedef struct
-{
-  struct _gpgme_op_assuan_result result;
-} *op_data_t;
-
 gpg_error_t _gpgme_engine_assuan_last_op_err (void *engine);
 
 gpgme_assuan_result_t