aboutsummaryrefslogtreecommitdiff
path: root/src/conversation/gnunet-conversation-gtk_import.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/conversation/gnunet-conversation-gtk_import.c')
-rw-r--r--src/conversation/gnunet-conversation-gtk_import.c34
1 files changed, 32 insertions, 2 deletions
diff --git a/src/conversation/gnunet-conversation-gtk_import.c b/src/conversation/gnunet-conversation-gtk_import.c
index e8e1eede..199ed9e2 100644
--- a/src/conversation/gnunet-conversation-gtk_import.c
+++ b/src/conversation/gnunet-conversation-gtk_import.c
@@ -251,13 +251,27 @@ add_phone_handle_existing_records (void *cls,
251 add_phone_qe = GNUNET_NAMESTORE_records_store (ns, 251 add_phone_qe = GNUNET_NAMESTORE_records_store (ns,
252 zone, 252 zone,
253 label, 253 label,
254 rd_count + 1, rd_new, 254 rd_count + 1,
255 rd_new,
255 &add_phone_continuation, 256 &add_phone_continuation,
256 NULL); 257 NULL);
257} 258}
258 259
259 260
260/** 261/**
262 * Called on error communicating with the namestore.
263 */
264static void
265handle_add_error (void *cls)
266{
267 add_phone_qe = NULL;
268 GCG_log (_("Error communicating with namestore!\n"));
269 GNUNET_free (phone_label);
270 phone_label = NULL;
271}
272
273
274/**
261 * Add the data from #my_rd under the #phone_label to the namestore. 275 * Add the data from #my_rd under the #phone_label to the namestore.
262 */ 276 */
263static void 277static void
@@ -273,6 +287,8 @@ add_phone ()
273 add_phone_qe = GNUNET_NAMESTORE_records_lookup (ns, 287 add_phone_qe = GNUNET_NAMESTORE_records_lookup (ns,
274 &zone_pkey, 288 &zone_pkey,
275 phone_label, 289 phone_label,
290 &handle_add_error,
291 NULL,
276 &add_phone_handle_existing_records, 292 &add_phone_handle_existing_records,
277 NULL); 293 NULL);
278} 294}
@@ -409,6 +425,19 @@ remove_phone_handle_existing_records (void *cls,
409 425
410 426
411/** 427/**
428 * Called on error communicating with the namestore.
429 */
430static void
431handle_remove_error (void *cls)
432{
433 remove_phone_qe = NULL;
434 GCG_log (_("Error communicating with namestore!\n"));
435 if (GNUNET_YES == in_shutdown)
436 finish_shutdown ();
437}
438
439
440/**
412 * Remove previously added phone address from namestore. 441 * Remove previously added phone address from namestore.
413 */ 442 */
414void 443void
@@ -420,6 +449,8 @@ GSC_remove_phone ()
420 remove_phone_qe = GNUNET_NAMESTORE_records_lookup (ns, 449 remove_phone_qe = GNUNET_NAMESTORE_records_lookup (ns,
421 &zone_pkey, 450 &zone_pkey,
422 phone_label, 451 phone_label,
452 &handle_remove_error,
453 NULL,
423 &remove_phone_handle_existing_records, 454 &remove_phone_handle_existing_records,
424 NULL); 455 NULL);
425 GNUNET_free (phone_label); 456 GNUNET_free (phone_label);
@@ -492,4 +523,3 @@ GCG_IMPORT_shutdown ()
492 523
493 524
494/* end of gnunet-conversation-gtk_import.c */ 525/* end of gnunet-conversation-gtk_import.c */
495