diff options
author | Werner Koch <[email protected]> | 2002-08-01 10:16:21 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2002-08-01 10:16:21 +0000 |
commit | b94497bf1f9e5b28767b992dd14a624809421801 (patch) | |
tree | 2d99caf8b724ccce9e99ecc12b1220dd97ee3bfd /gpgme/encrypt.c | |
parent | new cryptplug function importCertificateFromMem() (diff) | |
download | gpgme-b94497bf1f9e5b28767b992dd14a624809421801.tar.gz gpgme-b94497bf1f9e5b28767b992dd14a624809421801.zip |
Fixed an update conflict.
Diffstat (limited to '')
-rw-r--r-- | gpgme/encrypt.c | 36 |
1 files changed, 24 insertions, 12 deletions
diff --git a/gpgme/encrypt.c b/gpgme/encrypt.c index 57ec9786..df7ef90e 100644 --- a/gpgme/encrypt.c +++ b/gpgme/encrypt.c @@ -99,26 +99,38 @@ append_xml_encinfo (GpgmeData *rdh, char *args) } +static void +status_handler_finish (GpgmeCtx ctx) +{ + if (ctx->result.encrypt->xmlinfo) + { + append_xml_encinfo (&ctx->result.encrypt->xmlinfo, NULL); + _gpgme_set_op_info (ctx, ctx->result.encrypt->xmlinfo); + ctx->result.encrypt->xmlinfo = NULL; + } + if (ctx->error) + ; /* already set by kludge in engine-gpgsm */ + else if (ctx->result.encrypt->no_valid_recipients) + ctx->error = mk_error (No_Recipients); + else if (ctx->result.encrypt->invalid_recipients) + ctx->error = mk_error (Invalid_Recipients); +} + void _gpgme_encrypt_status_handler (GpgmeCtx ctx, GpgmeStatusCode code, char *args) { if (ctx->error) - return; + { + if (ctx->result.encrypt) /* check that we have allocated it. */ + status_handler_finish (ctx); + return; + } test_and_allocate_result (ctx, encrypt); switch (code) { - case GPGME_STATUS_EOF: - if (ctx->result.encrypt->xmlinfo) - { - append_xml_encinfo (&ctx->result.encrypt->xmlinfo, NULL); - _gpgme_set_op_info (ctx, ctx->result.encrypt->xmlinfo); - ctx->result.encrypt->xmlinfo = NULL; - } - if (ctx->result.encrypt->no_valid_recipients) - ctx->error = mk_error (No_Recipients); - else if (ctx->result.encrypt->invalid_recipients) - ctx->error = mk_error (Invalid_Recipients); + case STATUS_EOF: + status_handler_finish (ctx); break; case GPGME_STATUS_INV_RECP: |