aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2001-01-30 18:03:21 +0000
committerWerner Koch <[email protected]>2001-01-30 18:03:21 +0000
commit1316aed172b1b4e2921533b64cfa74eafd663c12 (patch)
tree8399a2f28e15d6973366d126fcc12927af28a72e
parentFixed version string and W32 spawn function (diff)
downloadgpgme-1316aed172b1b4e2921533b64cfa74eafd663c12.tar.gz
gpgme-1316aed172b1b4e2921533b64cfa74eafd663c12.zip
Made gpgme_cancel work - at least a little bit.
Diffstat (limited to '')
-rw-r--r--gpgme/gpgme.c2
-rw-r--r--gpgme/w32-io.c2
-rw-r--r--gpgme/wait.c3
3 files changed, 5 insertions, 2 deletions
diff --git a/gpgme/gpgme.c b/gpgme/gpgme.c
index 935e8e80..43e89ad2 100644
--- a/gpgme/gpgme.c
+++ b/gpgme/gpgme.c
@@ -113,6 +113,8 @@ _gpgme_release_result ( GpgmeCtx c )
void
gpgme_cancel (GpgmeCtx c)
{
+ return_if_fail (c);
+
c->cancel = 1;
}
diff --git a/gpgme/w32-io.c b/gpgme/w32-io.c
index 8c19d818..2ee10bbb 100644
--- a/gpgme/w32-io.c
+++ b/gpgme/w32-io.c
@@ -638,7 +638,7 @@ _gpgme_io_select ( struct io_select_fd_s *fds, size_t nfds )
count++;
}
}
- code = WaitForMultipleObjects ( nwait, waitbuf, 0, any_write? 0:1000);
+ code = WaitForMultipleObjects ( nwait, waitbuf, 0, any_write? 200:1000);
if ( code >= WAIT_OBJECT_0 && code < WAIT_OBJECT_0 + nwait ) {
/* This WFMO is a really silly function: It does return either
* the index of the signaled object or if 2 objects have been
diff --git a/gpgme/wait.c b/gpgme/wait.c
index ba7a22f1..71038fb3 100644
--- a/gpgme/wait.c
+++ b/gpgme/wait.c
@@ -213,7 +213,8 @@ _gpgme_wait_on_condition ( GpgmeCtx c, int hang, volatile int *cond )
}
if (hang)
run_idle ();
- } while (hang);
+ } while (hang && !c->cancel );
+ c->cancel = 0; /* fixme: fix all functions, to return a cancel error */
return c;
}