aboutsummaryrefslogtreecommitdiffstats
path: root/src/op-support.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/op-support.c')
-rw-r--r--src/op-support.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/op-support.c b/src/op-support.c
index 2bcb3a35..87a9b8d2 100644
--- a/src/op-support.c
+++ b/src/op-support.c
@@ -83,9 +83,19 @@ _gpgme_op_reset (gpgme_ctx_t ctx, int type)
struct gpgme_io_cbs io_cbs;
int no_reset = (type & 256);
int reuse_engine = 0;
+ char *options = NULL;
+ const char *tmp = NULL;
type &= 255;
+ err = gpgme_ctx_get_engine_options (ctx, &tmp);
+ if (tmp)
+ {
+ options = strdup (tmp);
+ if (!options)
+ return GPG_ERR_ENOMEM;
+ }
+
_gpgme_release_result (ctx);
LOCK (ctx->lock);
ctx->canceled = 0;
@@ -119,8 +129,22 @@ _gpgme_op_reset (gpgme_ctx_t ctx, int type)
err = _gpgme_engine_new (info, &ctx->engine);
if (err)
return err;
+
+ if (options)
+ {
+ err = gpgme_ctx_set_engine_options (ctx, options);
+ if (err && gpg_err_code (err) != GPG_ERR_NOT_IMPLEMENTED)
+ {
+ free (options);
+ _gpgme_engine_release (ctx->engine);
+ ctx->engine = NULL;
+ return err;
+ }
+ }
}
+ free (options);
+
if (!reuse_engine)
{
err = 0;