+2004-02-25 Marcus Brinkmann <marcus@g10code.de>
+
+ * rungpg.c (gpg_cancel): New function.
+ (gpg_release): Call it here.
+ (_gpgme_engine_ops_gpg): Add it here.
+ * engine-gpgsm.c (gpgsm_cancel): Fix last change.
+
2004-02-24 Marcus Brinkmann <marcus@g10code.de>
* gpgme.c (gpgme_cancel): New function.
* engine-backend.h (struct engine_ops): New member cancel.
* engine.h (_gpgme_engine_cancel): New prototype.
* engine.c (_gpgme_engine_cancel): New function.
- * engine-gpgsm.c: Add new member cancel.
+ * engine-gpgsm.c (_gpgme_engine_ops_gpgsm): Add new member cancel.
(gpgsm_cancel): New function.
(gpgsm_release): Use it.
- * rungpg.c: Add new member cancel.
+ * rungpg.c (_gpgme_engine_ops_gpg): Add new member cancel.
2004-02-17 Werner Koch <wk@gnupg.org>
engine_gpgsm_t gpgsm = engine;
if (!gpgsm)
- return;
+ return gpg_error (GPG_ERR_INV_VALUE);
if (gpgsm->status_cb.fd != -1)
_gpgme_io_close (gpgsm->status_cb.fd);
_gpgme_io_close (gpgsm->message_cb.fd);
assuan_disconnect (gpgsm->assuan_ctx);
+
+ return 0;
}
}
+static gpgme_error_t
+gpg_cancel (void *engine)
+{
+ engine_gpg_t gpg = engine;
+
+ if (!gpg)
+ return gpg_error (GPG_ERR_INV_VALUE);
+
+ if (gpg->status.fd[0] != -1)
+ _gpgme_io_close (gpg->status.fd[0]);
+ if (gpg->status.fd[1] != -1)
+ _gpgme_io_close (gpg->status.fd[1]);
+ if (gpg->colon.fd[0] != -1)
+ _gpgme_io_close (gpg->colon.fd[0]);
+ if (gpg->colon.fd[1] != -1)
+ _gpgme_io_close (gpg->colon.fd[1]);
+ if (gpg->fd_data_map)
+ free_fd_data_map (gpg->fd_data_map);
+ if (gpg->cmd.fd != -1)
+ _gpgme_io_close (gpg->cmd.fd);
+
+ return 0;
+}
+
static void
gpg_release (void *engine)
{
if (!gpg)
return;
+ gpg_cancel (engine);
+
while (gpg->arglist)
{
struct arg_and_data_s *next = gpg->arglist->next;
if (gpg->cmd.keyword)
free (gpg->cmd.keyword);
- if (gpg->status.fd[0] != -1)
- _gpgme_io_close (gpg->status.fd[0]);
- if (gpg->status.fd[1] != -1)
- _gpgme_io_close (gpg->status.fd[1]);
- if (gpg->colon.fd[0] != -1)
- _gpgme_io_close (gpg->colon.fd[0]);
- if (gpg->colon.fd[1] != -1)
- _gpgme_io_close (gpg->colon.fd[1]);
- if (gpg->fd_data_map)
- free_fd_data_map (gpg->fd_data_map);
- if (gpg->cmd.fd != -1)
- _gpgme_io_close (gpg->cmd.fd);
free (gpg);
}
gpg_verify,
gpg_set_io_cbs,
gpg_io_event,
- NULL
+ gpg_cancel
};