[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-anastasis] branch master updated: implement redux recovery initia
From: |
gnunet |
Subject: |
[taler-anastasis] branch master updated: implement redux recovery initialization logic |
Date: |
Sat, 20 Feb 2021 21:37:16 +0100 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository anastasis.
The following commit(s) were added to refs/heads/master by this push:
new deb6678 implement redux recovery initialization logic
deb6678 is described below
commit deb667808ba566fc008f9b90cc6290f590326b4d
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Sat Feb 20 21:37:14 2021 +0100
implement redux recovery initialization logic
---
src/reducer/anastasis_api_recovery_redux.c | 30 ++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)
diff --git a/src/reducer/anastasis_api_recovery_redux.c
b/src/reducer/anastasis_api_recovery_redux.c
index f960f40..c31f417 100644
--- a/src/reducer/anastasis_api_recovery_redux.c
+++ b/src/reducer/anastasis_api_recovery_redux.c
@@ -798,6 +798,18 @@ free_rss (void *cls)
}
+/**
+ * Callback which passes back the recovery document and its possible
+ * policies. Also passes back the version of the document for the user
+ * to check.
+ *
+ * Once the first policy lookup succeeds, we update our state and
+ * cancel all of the others, passing the obtained recovery information
+ * back to the user.
+ *
+ * @param cls closure for the callback
+ * @param ri recovery information struct which contains the policies
+ */
static void
policy_lookup_cb (void *cls,
const struct ANASTASIS_RecoveryInformation *ri)
@@ -809,6 +821,24 @@ policy_lookup_cb (void *cls,
json_t *recovery_information;
pd->recovery = NULL;
+ if (NULL == ri)
+ {
+ /* Woopsie, failed hard. */
+ GNUNET_CONTAINER_DLL_remove (rss->pd_head,
+ rss->pd_tail,
+ pd);
+ GNUNET_free (pd->backend_url);
+ GNUNET_free (pd);
+ if (NULL != rss->pd_head)
+ return; /* wait for another one */
+ /* all failed! report failure! */
+ set_state (rss->state,
+ ANASTASIS_GENERIC_STATE_ERROR);
+ rss->cb (rss->cb_cls,
+ TALER_EC_INVALID, // FIXME: use better code!
+ rss->state);
+ free_rss (rss);
+ }
policies = json_array ();
GNUNET_assert (NULL != policies);
for (unsigned int i = 0; i<ri->dps_len; i++)
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.