diff options
author | TheJackiMonster <thejackimonster@gmail.com> | 2022-03-19 16:48:52 +0100 |
---|---|---|
committer | TheJackiMonster <thejackimonster@gmail.com> | 2022-03-19 16:48:52 +0100 |
commit | 7293cd91dfa15e290d01952b4f4d51fe6ec46f25 (patch) | |
tree | 98bfaa8e2e91e1695ca0232b6596120ec18c8cd4 /src/gnunet_chat_context_intern.c | |
parent | 89d4e01123cc5d9130f6b0a20591081ddb66288d (diff) | |
download | libgnunetchat-7293cd91dfa15e290d01952b4f4d51fe6ec46f25.tar.gz libgnunetchat-7293cd91dfa15e290d01952b4f4d51fe6ec46f25.zip |
Cleanup namestore operations
Signed-off-by: TheJackiMonster <thejackimonster@gmail.com>
Diffstat (limited to 'src/gnunet_chat_context_intern.c')
-rw-r--r-- | src/gnunet_chat_context_intern.c | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/src/gnunet_chat_context_intern.c b/src/gnunet_chat_context_intern.c index 79c09a2..af1e2cc 100644 --- a/src/gnunet_chat_context_intern.c +++ b/src/gnunet_chat_context_intern.c | |||
@@ -70,6 +70,10 @@ cont_context_commit_records (void *cls, | |||
70 | { | 70 | { |
71 | struct GNUNET_CHAT_Context *context = cls; | 71 | struct GNUNET_CHAT_Context *context = cls; |
72 | 72 | ||
73 | GNUNET_assert(context); | ||
74 | |||
75 | context->query_commit = NULL; | ||
76 | |||
73 | if ((!emsg) || (!(context->handle))) | 77 | if ((!emsg) || (!(context->handle))) |
74 | return; | 78 | return; |
75 | 79 | ||
@@ -86,6 +90,10 @@ error_context_open_records (void *cls) | |||
86 | { | 90 | { |
87 | struct GNUNET_CHAT_Context *context = cls; | 91 | struct GNUNET_CHAT_Context *context = cls; |
88 | 92 | ||
93 | GNUNET_assert(context); | ||
94 | |||
95 | context->query_open = NULL; | ||
96 | |||
89 | if (!(context->handle)) | 97 | if (!(context->handle)) |
90 | return; | 98 | return; |
91 | 99 | ||
@@ -108,6 +116,8 @@ monitor_context_open_records (void *cls, | |||
108 | 116 | ||
109 | GNUNET_assert((context) && (context->handle)); | 117 | GNUNET_assert((context) && (context->handle)); |
110 | 118 | ||
119 | context->query_open = NULL; | ||
120 | |||
111 | const struct GNUNET_HashCode *hash = GNUNET_MESSENGER_room_get_key( | 121 | const struct GNUNET_HashCode *hash = GNUNET_MESSENGER_room_get_key( |
112 | context->room | 122 | context->room |
113 | ); | 123 | ); |
@@ -172,7 +182,10 @@ monitor_context_open_records (void *cls, | |||
172 | count++; | 182 | count++; |
173 | } | 183 | } |
174 | 184 | ||
175 | GNUNET_NAMESTORE_records_commit( | 185 | if (context->query_commit) |
186 | GNUNET_NAMESTORE_cancel(context->query_commit); | ||
187 | |||
188 | context->query_commit = GNUNET_NAMESTORE_records_commit( | ||
176 | context->handle->namestore, | 189 | context->handle->namestore, |
177 | zone, | 190 | zone, |
178 | label, | 191 | label, |
@@ -194,7 +207,12 @@ monitor_context_delete_records (void *cls, | |||
194 | 207 | ||
195 | GNUNET_assert((context) && (context->handle)); | 208 | GNUNET_assert((context) && (context->handle)); |
196 | 209 | ||
197 | GNUNET_NAMESTORE_records_commit( | 210 | context->query_open = NULL; |
211 | |||
212 | if (context->query_commit) | ||
213 | GNUNET_NAMESTORE_cancel(context->query_commit); | ||
214 | |||
215 | context->query_commit = GNUNET_NAMESTORE_records_commit( | ||
198 | context->handle->namestore, | 216 | context->handle->namestore, |
199 | zone, | 217 | zone, |
200 | label, | 218 | label, |