aboutsummaryrefslogtreecommitdiff
path: root/src/gnunet_chat_context_intern.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gnunet_chat_context_intern.c')
-rw-r--r--src/gnunet_chat_context_intern.c22
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,