diff options
author | Jacki <jacki@thejackimonster.de> | 2024-01-05 03:24:31 +0100 |
---|---|---|
committer | Jacki <jacki@thejackimonster.de> | 2024-01-05 03:24:31 +0100 |
commit | 155016406d44a5a12a123a91a8eaf8aaa62e7430 (patch) | |
tree | ebc809005fbcaee9d15c9984f74a3e5487c21b6a /src/gnunet_chat_handle.c | |
parent | 2825c2b3391e1f65d58b6754ea603b83fd6959f1 (diff) | |
download | libgnunetchat-155016406d44a5a12a123a91a8eaf8aaa62e7430.tar.gz libgnunetchat-155016406d44a5a12a123a91a8eaf8aaa62e7430.zip |
Implement setting and deleting attributes with handle
Signed-off-by: Jacki <jacki@thejackimonster.de>
Diffstat (limited to 'src/gnunet_chat_handle.c')
-rw-r--r-- | src/gnunet_chat_handle.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/gnunet_chat_handle.c b/src/gnunet_chat_handle.c index 25eecc6..b58a8ab 100644 --- a/src/gnunet_chat_handle.c +++ b/src/gnunet_chat_handle.c | |||
@@ -99,6 +99,9 @@ handle_create_from_config (const struct GNUNET_CONFIGURATION_Handle* cfg, | |||
99 | handle->lookups_head = NULL; | 99 | handle->lookups_head = NULL; |
100 | handle->lookups_tail = NULL; | 100 | handle->lookups_tail = NULL; |
101 | 101 | ||
102 | handle->attributes_head = NULL; | ||
103 | handle->attributes_tail = NULL; | ||
104 | |||
102 | handle->tickets_head = NULL; | 105 | handle->tickets_head = NULL; |
103 | handle->tickets_tail = NULL; | 106 | handle->tickets_tail = NULL; |
104 | 107 | ||
@@ -460,6 +463,29 @@ handle_disconnect (struct GNUNET_CHAT_Handle *handle) | |||
460 | GNUNET_free(lobbies); | 463 | GNUNET_free(lobbies); |
461 | } | 464 | } |
462 | 465 | ||
466 | struct GNUNET_CHAT_AttributeProcess *attributes; | ||
467 | while (handle->attributes_head) | ||
468 | { | ||
469 | attributes = handle->attributes_head; | ||
470 | |||
471 | if (attributes->attribute) | ||
472 | GNUNET_free(attributes->attribute); | ||
473 | |||
474 | if (attributes->iter) | ||
475 | GNUNET_RECLAIM_get_attributes_stop(attributes->iter); | ||
476 | |||
477 | if (attributes->op) | ||
478 | GNUNET_RECLAIM_cancel(attributes->op); | ||
479 | |||
480 | GNUNET_CONTAINER_DLL_remove( | ||
481 | handle->attributes_head, | ||
482 | handle->attributes_tail, | ||
483 | attributes | ||
484 | ); | ||
485 | |||
486 | GNUNET_free(attributes); | ||
487 | } | ||
488 | |||
463 | GNUNET_CONTAINER_multihashmap_destroy(handle->groups); | 489 | GNUNET_CONTAINER_multihashmap_destroy(handle->groups); |
464 | GNUNET_CONTAINER_multishortmap_destroy(handle->contacts); | 490 | GNUNET_CONTAINER_multishortmap_destroy(handle->contacts); |
465 | GNUNET_CONTAINER_multihashmap_destroy(handle->contexts); | 491 | GNUNET_CONTAINER_multihashmap_destroy(handle->contexts); |