diff options
Diffstat (limited to 'src/setup/gnunet-setup-gns.c')
-rw-r--r-- | src/setup/gnunet-setup-gns.c | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/src/setup/gnunet-setup-gns.c b/src/setup/gnunet-setup-gns.c index 95ca617b..7c0b2f5e 100644 --- a/src/setup/gnunet-setup-gns.c +++ b/src/setup/gnunet-setup-gns.c | |||
@@ -346,6 +346,16 @@ static struct PseuContext *pc_head; | |||
346 | static struct PseuContext *pc_tail; | 346 | static struct PseuContext *pc_tail; |
347 | 347 | ||
348 | /** | 348 | /** |
349 | * Tail of linked list of active record move operations. | ||
350 | */ | ||
351 | static struct EditDialogContext *edc_head; | ||
352 | |||
353 | /** | ||
354 | * Tail of linked list of active record move operations. | ||
355 | */ | ||
356 | static struct EditDialogContext *edc_tail; | ||
357 | |||
358 | /** | ||
349 | * Name of our zone as a string. | 359 | * Name of our zone as a string. |
350 | */ | 360 | */ |
351 | static char *zone_as_string; | 361 | static char *zone_as_string; |
@@ -664,6 +674,8 @@ free_update_context (struct UpdateContext *uc) | |||
664 | 674 | ||
665 | if (NULL != uc->qe) | 675 | if (NULL != uc->qe) |
666 | { | 676 | { |
677 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | ||
678 | _("Setup shutdown before all records could be written. Record lost!\n")); | ||
667 | GNUNET_NAMESTORE_cancel (uc->qe); | 679 | GNUNET_NAMESTORE_cancel (uc->qe); |
668 | uc->qe = NULL; | 680 | uc->qe = NULL; |
669 | } | 681 | } |
@@ -972,6 +984,8 @@ free_remove_context (struct RemoveContext *rc) | |||
972 | { | 984 | { |
973 | if (NULL != rc->qe) | 985 | if (NULL != rc->qe) |
974 | { | 986 | { |
987 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | ||
988 | _("Setup shutdown before all records could be written. Record lost!\n")); | ||
975 | GNUNET_NAMESTORE_cancel (rc->qe); | 989 | GNUNET_NAMESTORE_cancel (rc->qe); |
976 | rc->qe = NULL; | 990 | rc->qe = NULL; |
977 | } | 991 | } |
@@ -1159,6 +1173,9 @@ record_move_finish (void *cls, | |||
1159 | struct EditDialogContext *edc = cls; | 1173 | struct EditDialogContext *edc = cls; |
1160 | 1174 | ||
1161 | edc->qe = NULL; | 1175 | edc->qe = NULL; |
1176 | GNUNET_CONTAINER_DLL_remove (edc_head, | ||
1177 | edc_tail, | ||
1178 | edc); | ||
1162 | if (NULL != emsg) | 1179 | if (NULL != emsg) |
1163 | show_error_message (_("Failed to move record to target zone"), | 1180 | show_error_message (_("Failed to move record to target zone"), |
1164 | emsg); | 1181 | emsg); |
@@ -1190,6 +1207,9 @@ record_move_continuation (void *cls, | |||
1190 | { | 1207 | { |
1191 | show_error_message (_("Failed to access key for target zone"), | 1208 | show_error_message (_("Failed to access key for target zone"), |
1192 | emsg); | 1209 | emsg); |
1210 | GNUNET_CONTAINER_DLL_remove (edc_head, | ||
1211 | edc_tail, | ||
1212 | edc); | ||
1193 | free_edit_dialog_context (edc); | 1213 | free_edit_dialog_context (edc); |
1194 | return; | 1214 | return; |
1195 | } | 1215 | } |
@@ -1201,6 +1221,10 @@ record_move_continuation (void *cls, | |||
1201 | { | 1221 | { |
1202 | /* edit dialog produced invalid value string!? */ | 1222 | /* edit dialog produced invalid value string!? */ |
1203 | GNUNET_break (0); | 1223 | GNUNET_break (0); |
1224 | GNUNET_CONTAINER_DLL_remove (edc_head, | ||
1225 | edc_tail, | ||
1226 | edc); | ||
1227 | free_edit_dialog_context (edc); | ||
1204 | return; | 1228 | return; |
1205 | } | 1229 | } |
1206 | rd.record_type = edc->record_type; | 1230 | rd.record_type = edc->record_type; |
@@ -1334,6 +1358,15 @@ edit_dialog_continuation (struct EditDialogContext *edc, | |||
1334 | edc->rkgc = GNUNET_CRYPTO_rsa_key_create_start (keyfile, | 1358 | edc->rkgc = GNUNET_CRYPTO_rsa_key_create_start (keyfile, |
1335 | &record_move_continuation, | 1359 | &record_move_continuation, |
1336 | edc); | 1360 | edc); |
1361 | if (NULL == edc->rkgc) | ||
1362 | { | ||
1363 | GNUNET_break (0); | ||
1364 | GNUNET_free (keyfile); | ||
1365 | break; | ||
1366 | } | ||
1367 | GNUNET_CONTAINER_DLL_insert (edc_head, | ||
1368 | edc_tail, | ||
1369 | edc); | ||
1337 | GNUNET_free (keyfile); | 1370 | GNUNET_free (keyfile); |
1338 | return; | 1371 | return; |
1339 | } | 1372 | } |
@@ -2293,6 +2326,8 @@ GNUNET_SETUP_gns_init () | |||
2293 | void | 2326 | void |
2294 | GNUNET_SETUP_gns_done () | 2327 | GNUNET_SETUP_gns_done () |
2295 | { | 2328 | { |
2329 | struct EditDialogContext *edc; | ||
2330 | |||
2296 | gtk_widget_show (GTK_WIDGET (GNUNET_SETUP_get_object ("GNUNET_setup_gns_status_label"))); | 2331 | gtk_widget_show (GTK_WIDGET (GNUNET_SETUP_get_object ("GNUNET_setup_gns_status_label"))); |
2297 | gtk_widget_hide (GTK_WIDGET (GNUNET_SETUP_get_object ("GNUNET_setup_gns_main_scrolledwindow"))); | 2332 | gtk_widget_hide (GTK_WIDGET (GNUNET_SETUP_get_object ("GNUNET_setup_gns_main_scrolledwindow"))); |
2298 | gtk_tree_store_clear (ts); | 2333 | gtk_tree_store_clear (ts); |
@@ -2302,6 +2337,17 @@ GNUNET_SETUP_gns_done () | |||
2302 | free_update_context (uc_head); | 2337 | free_update_context (uc_head); |
2303 | while (NULL != rc_head) | 2338 | while (NULL != rc_head) |
2304 | free_remove_context (rc_head); | 2339 | free_remove_context (rc_head); |
2340 | while (NULL != (edc = edc_head)) | ||
2341 | { | ||
2342 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | ||
2343 | _("Setup shutdown before all records could be written. Record lost!\n")); | ||
2344 | if (NULL != edc->qe) | ||
2345 | GNUNET_NAMESTORE_cancel (edc->qe); | ||
2346 | if (NULL != edc->rkgc) | ||
2347 | GNUNET_CRYPTO_rsa_key_create_stop (edc->rkgc); | ||
2348 | GNUNET_CONTAINER_DLL_remove (edc_head, edc_tail, edc); | ||
2349 | free_edit_dialog_context (edc); | ||
2350 | } | ||
2305 | if (NULL != namestore) | 2351 | if (NULL != namestore) |
2306 | { | 2352 | { |
2307 | GNUNET_NAMESTORE_disconnect (namestore); | 2353 | GNUNET_NAMESTORE_disconnect (namestore); |