2005-04-14 Marcus Brinkmann <marcus@g10code.de>

* wait-global.c (gpgme_wait): Use LI->ctx when checking a context
	in the list, not the user-provided CTX.
This commit is contained in:
Marcus Brinkmann 2005-04-14 08:49:20 +00:00
parent cbddc8e134
commit 34f9799839
2 changed files with 10 additions and 4 deletions

View File

@ -1,5 +1,9 @@
2005-04-14 Marcus Brinkmann <marcus@g10code.de> 2005-04-14 Marcus Brinkmann <marcus@g10code.de>
* wait-global.c (gpgme_wait): Use LI->ctx when checking a context
in the list, not the user-provided CTX.
Reported by Igor Belyi <gpgme@katehok.ac93.org>.
* wait-global.c (gpgme_wait): If no context is found, and we * wait-global.c (gpgme_wait): If no context is found, and we
should not hang, set *status to 0 and return NULL. should not hang, set *status to 0 and return NULL.
Reported by Igor Belyi <gpgme@katehok.ac93.org>. Reported by Igor Belyi <gpgme@katehok.ac93.org>.

View File

@ -331,13 +331,15 @@ gpgme_wait (gpgme_ctx_t ctx, gpgme_error_t *status, int hang)
LOCK (ctx_list_lock); LOCK (ctx_list_lock);
for (li = ctx_active_list; li; li = li->next) for (li = ctx_active_list; li; li = li->next)
{ {
for (i = 0; i < ctx->fdt.size; i++) gpgme_ctx_t actx = li->ctx;
if (ctx->fdt.fds[i].fd != -1)
for (i = 0; i < actx->fdt.size; i++)
if (actx->fdt.fds[i].fd != -1)
break; break;
if (i == ctx->fdt.size) if (i == actx->fdt.size)
{ {
gpgme_error_t err = 0; gpgme_error_t err = 0;
_gpgme_engine_io_event (ctx->engine, GPGME_EVENT_DONE, &err); _gpgme_engine_io_event (actx->engine, GPGME_EVENT_DONE, &err);
} }
} }
UNLOCK (ctx_list_lock); UNLOCK (ctx_list_lock);