diff options
Diffstat (limited to 'src/namestore/gnunet-namestore-gtk.c')
-rw-r--r-- | src/namestore/gnunet-namestore-gtk.c | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/src/namestore/gnunet-namestore-gtk.c b/src/namestore/gnunet-namestore-gtk.c index a23b615e..b03fd247 100644 --- a/src/namestore/gnunet-namestore-gtk.c +++ b/src/namestore/gnunet-namestore-gtk.c | |||
@@ -225,7 +225,7 @@ struct MoveOperationContext | |||
225 | /** | 225 | /** |
226 | * Associated namestore operation. | 226 | * Associated namestore operation. |
227 | */ | 227 | */ |
228 | struct GNUNET_NAMESTORE_QueueEntry *qe; | 228 | struct GNUNET_NAMESTORE_ZoneIterator *it; |
229 | 229 | ||
230 | /** | 230 | /** |
231 | * Info from editing dialog. | 231 | * Info from editing dialog. |
@@ -842,36 +842,35 @@ merge_with_existing_records (void *cls, | |||
842 | * merging. | 842 | * merging. |
843 | * | 843 | * |
844 | * @param cls closure with the `struct MoveOperationContext` | 844 | * @param cls closure with the `struct MoveOperationContext` |
845 | * @param block block to decrypt | 845 | * @param zone private key of the zone; NULL on disconnect |
846 | * @param label label of the records; NULL on disconnect | ||
847 | * @param rd_count number of entries in @a rd array, 0 if label was deleted | ||
848 | * @param rd array of records with data to store | ||
846 | */ | 849 | */ |
847 | static void | 850 | static void |
848 | decrypt_block_for_merge (void *cls, | 851 | handle_records_for_merge (void *cls, |
849 | const struct GNUNET_GNSRECORD_Block *block) | 852 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone, |
853 | const char *label, | ||
854 | unsigned int rd_count, | ||
855 | const struct GNUNET_GNSRECORD_Data *rd) | ||
850 | { | 856 | { |
851 | struct MoveOperationContext *moc = cls; | 857 | struct MoveOperationContext *moc = cls; |
852 | struct GNUNET_CRYPTO_EcdsaPublicKey pubkey; | ||
853 | 858 | ||
854 | if (NULL == block) | 859 | if (NULL == label) |
855 | { | 860 | { |
861 | moc->it = NULL; | ||
856 | merge_with_existing_records (moc, 0, NULL); | 862 | merge_with_existing_records (moc, 0, NULL); |
857 | return; | 863 | return; |
858 | } | 864 | } |
859 | GNUNET_CRYPTO_ecdsa_key_get_public (&moc->pk, | 865 | if (0 != strcmp (label, |
860 | &pubkey); | 866 | moc->edc->name)) |
861 | if (GNUNET_OK != | ||
862 | GNUNET_GNSRECORD_block_decrypt (block, | ||
863 | &pubkey, | ||
864 | moc->edc->name, | ||
865 | &merge_with_existing_records, | ||
866 | moc)) | ||
867 | { | 867 | { |
868 | show_error_message (_("Failed to decode existing record in target zone"), | 868 | GNUNET_NAMESTORE_zone_iterator_next (moc->it); |
869 | _("Failed to add new record.")); | ||
870 | GNUNET_free (moc->data); | ||
871 | free_edit_dialog_context (moc->edc); | ||
872 | GNUNET_free (moc); | ||
873 | return; | 869 | return; |
874 | } | 870 | } |
871 | GNUNET_NAMESTORE_zone_iteration_stop (moc->it); | ||
872 | moc->it = NULL; | ||
873 | merge_with_existing_records (moc, rd_count, rd); | ||
875 | } | 874 | } |
876 | 875 | ||
877 | 876 | ||
@@ -1009,9 +1008,9 @@ edit_dialog_continuation (struct EditDialogContext *edc, | |||
1009 | moc->edc = edc; | 1008 | moc->edc = edc; |
1010 | moc->pk = *pk; | 1009 | moc->pk = *pk; |
1011 | GNUNET_CONTAINER_DLL_insert (moc_head, moc_tail, moc); | 1010 | GNUNET_CONTAINER_DLL_insert (moc_head, moc_tail, moc); |
1012 | moc->qe = GNUNET_NAMESTORE_lookup_block (namestore, | 1011 | moc->it = GNUNET_NAMESTORE_zone_iteration_start (namestore, |
1013 | &query, | 1012 | pk, |
1014 | &decrypt_block_for_merge, | 1013 | &handle_records_for_merge, |
1015 | moc); | 1014 | moc); |
1016 | /* zone changed, remove record from old zone, add to new zone! */ | 1015 | /* zone changed, remove record from old zone, add to new zone! */ |
1017 | if (GNUNET_YES == edc->old_record_in_namestore) | 1016 | if (GNUNET_YES == edc->old_record_in_namestore) |
@@ -2072,7 +2071,8 @@ cleanup_task (void *cls, | |||
2072 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 2071 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
2073 | _("A pending namestore operation was not transmitted to the namestore.\n")); | 2072 | _("A pending namestore operation was not transmitted to the namestore.\n")); |
2074 | GNUNET_CONTAINER_DLL_remove (moc_head, moc_tail, moc); | 2073 | GNUNET_CONTAINER_DLL_remove (moc_head, moc_tail, moc); |
2075 | GNUNET_NAMESTORE_cancel (moc->qe); | 2074 | if (NULL != moc->it) |
2075 | GNUNET_NAMESTORE_zone_iteration_stop (moc->it); | ||
2076 | free_edit_dialog_context (moc->edc); | 2076 | free_edit_dialog_context (moc->edc); |
2077 | GNUNET_free (moc->data); | 2077 | GNUNET_free (moc->data); |
2078 | GNUNET_free (moc); | 2078 | GNUNET_free (moc); |