aboutsummaryrefslogtreecommitdiff
path: root/src/util/taler-helper-crypto-eddsa.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-12-12 22:40:40 +0100
committerChristian Grothoff <christian@grothoff.org>2020-12-12 22:40:40 +0100
commitb81a5fb3aacb14b95be66771ebad2b3f047cbf2b (patch)
treea6cd248372fb6a754d512b30d9299b72448b912e /src/util/taler-helper-crypto-eddsa.c
parent09abf5e7e08c749c0a8904ba651e0357404e8aa9 (diff)
add sync and timeout functionality to helpers
Diffstat (limited to 'src/util/taler-helper-crypto-eddsa.c')
-rw-r--r--src/util/taler-helper-crypto-eddsa.c29
1 files changed, 25 insertions, 4 deletions
diff --git a/src/util/taler-helper-crypto-eddsa.c b/src/util/taler-helper-crypto-eddsa.c
index af1cc24d6..71a34fa2f 100644
--- a/src/util/taler-helper-crypto-eddsa.c
+++ b/src/util/taler-helper-crypto-eddsa.c
@@ -879,9 +879,28 @@ read_job (void *cls)
key))
{
/* client died, skip the rest */
+ client = NULL;
break;
}
}
+ if (NULL != client)
+ {
+ struct GNUNET_MessageHeader synced = {
+ .type = htons (TALER_HELPER_EDDSA_SYNCED),
+ .size = htons (sizeof (synced))
+ };
+
+ if (GNUNET_OK !=
+ transmit (&client->addr,
+ client->addr_size,
+ &synced))
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+ "Client %s must have disconnected\n",
+ client->addr.sun_path);
+ free_client (client);
+ }
+ }
}
break;
case TALER_HELPER_EDDSA_MT_REQ_SIGN:
@@ -1532,10 +1551,12 @@ run (void *cls,
unix_sock,
&read_job,
NULL);
-
- /* start job to keep keys up-to-date */
- keygen_task = GNUNET_SCHEDULER_add_now (&update_keys,
- NULL);
+ /* start job to keep keys up-to-date; MUST be run before the #read_task,
+ hence with priority. */
+ keygen_task = GNUNET_SCHEDULER_add_with_priority (
+ GNUNET_SCHEDULER_PRIORITY_URGENT,
+ &update_keys,
+ NULL);
/* start job to handle completed work */
{