aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/escrow/escrow.h5
-rw-r--r--src/escrow/escrow_plugin_helper.c10
-rw-r--r--src/escrow/plugin_escrow_anastasis.c2
-rw-r--r--src/escrow/plugin_escrow_gns.c2
-rw-r--r--src/escrow/plugin_escrow_plaintext.c2
5 files changed, 18 insertions, 3 deletions
diff --git a/src/escrow/escrow.h b/src/escrow/escrow.h
index 1f5257970..a9e6e99e1 100644
--- a/src/escrow/escrow.h
+++ b/src/escrow/escrow.h
@@ -41,6 +41,11 @@
41 */ 41 */
42#define ESCROW_PLUGIN_STATE_POST_INIT 1 42#define ESCROW_PLUGIN_STATE_POST_INIT 1
43 43
44/**
45 * State while cleaning up
46 */
47#define ESCROW_PLUGIN_STATE_CLEANUP 2
48
44 49
45/** 50/**
46 * The ego list 51 * The ego list
diff --git a/src/escrow/escrow_plugin_helper.c b/src/escrow/escrow_plugin_helper.c
index f5f67d4bf..25648dfa1 100644
--- a/src/escrow/escrow_plugin_helper.c
+++ b/src/escrow/escrow_plugin_helper.c
@@ -75,7 +75,10 @@ ESCROW_list_ego (void *cls,
75 struct EgoEntry *ego_entry; 75 struct EgoEntry *ego_entry;
76 struct GNUNET_CRYPTO_EcdsaPublicKey pk; 76 struct GNUNET_CRYPTO_EcdsaPublicKey pk;
77 77
78 // TODO: error when this method is called at cleanup if init is not yet finished 78 /* don't add/change/delete egos when we are already cleaning up */
79 if (ESCROW_PLUGIN_STATE_CLEANUP == ph->state)
80 return;
81
79 if ((NULL == ego) && (ESCROW_PLUGIN_STATE_INIT == ph->state)) 82 if ((NULL == ego) && (ESCROW_PLUGIN_STATE_INIT == ph->state))
80 { 83 {
81 ph->state = ESCROW_PLUGIN_STATE_POST_INIT; 84 ph->state = ESCROW_PLUGIN_STATE_POST_INIT;
@@ -109,8 +112,9 @@ ESCROW_list_ego (void *cls,
109 GNUNET_free (ego_entry->identifier); 112 GNUNET_free (ego_entry->identifier);
110 ego_entry->identifier = GNUNET_strdup (identifier); 113 ego_entry->identifier = GNUNET_strdup (identifier);
111 /* TODO: this handles an edge case when the user restores an ego 114 /* TODO: this handles an edge case when the user restores an ego
112 that already exists. In that case, @param ego is the same for the 115 that already exists, i.e. with the same private key. In that case,
113 new as for the existing ego and this method thinks it is a rename. */ 116 @param ego is the same for the new as for the existing ego and this
117 method thinks it is a rename. */
114 if (NULL != ph->ego_create_cont) 118 if (NULL != ph->ego_create_cont)
115 ph->ego_create_cont (ego); 119 ph->ego_create_cont (ego);
116 break; 120 break;
diff --git a/src/escrow/plugin_escrow_anastasis.c b/src/escrow/plugin_escrow_anastasis.c
index 5353b435a..8a5c05e24 100644
--- a/src/escrow/plugin_escrow_anastasis.c
+++ b/src/escrow/plugin_escrow_anastasis.c
@@ -218,6 +218,8 @@ libgnunet_plugin_escrow_anastasis_done (void *cls)
218{ 218{
219 struct GNUNET_ESCROW_KeyPluginFunctions *api = cls; 219 struct GNUNET_ESCROW_KeyPluginFunctions *api = cls;
220 220
221 ph.state = ESCROW_PLUGIN_STATE_CLEANUP;
222
221 GNUNET_free (api); 223 GNUNET_free (api);
222 GNUNET_IDENTITY_disconnect (identity_handle); 224 GNUNET_IDENTITY_disconnect (identity_handle);
223 ESCROW_cleanup_ego_list (&ph); 225 ESCROW_cleanup_ego_list (&ph);
diff --git a/src/escrow/plugin_escrow_gns.c b/src/escrow/plugin_escrow_gns.c
index 422a3849e..2d419caaf 100644
--- a/src/escrow/plugin_escrow_gns.c
+++ b/src/escrow/plugin_escrow_gns.c
@@ -1729,6 +1729,8 @@ libgnunet_plugin_escrow_gns_done (void *cls)
1729{ 1729{
1730 struct GNUNET_ESCROW_KeyPluginFunctions *api = cls; 1730 struct GNUNET_ESCROW_KeyPluginFunctions *api = cls;
1731 1731
1732 ph.state = ESCROW_PLUGIN_STATE_CLEANUP;
1733
1732 GNUNET_free (api); 1734 GNUNET_free (api);
1733 GNUNET_IDENTITY_disconnect (identity_handle); 1735 GNUNET_IDENTITY_disconnect (identity_handle);
1734 ESCROW_cleanup_ego_list (&ph); 1736 ESCROW_cleanup_ego_list (&ph);
diff --git a/src/escrow/plugin_escrow_plaintext.c b/src/escrow/plugin_escrow_plaintext.c
index 8e2c2204b..36c275a6b 100644
--- a/src/escrow/plugin_escrow_plaintext.c
+++ b/src/escrow/plugin_escrow_plaintext.c
@@ -540,6 +540,8 @@ libgnunet_plugin_escrow_plaintext_done (void *cls)
540{ 540{
541 struct GNUNET_ESCROW_KeyPluginFunctions *api = cls; 541 struct GNUNET_ESCROW_KeyPluginFunctions *api = cls;
542 542
543 ph.state = ESCROW_PLUGIN_STATE_CLEANUP;
544
543 GNUNET_free (api); 545 GNUNET_free (api);
544 GNUNET_IDENTITY_disconnect (identity_handle); 546 GNUNET_IDENTITY_disconnect (identity_handle);
545 ESCROW_cleanup_ego_list (&ph); 547 ESCROW_cleanup_ego_list (&ph);