aboutsummaryrefslogtreecommitdiff
path: root/src/datastore/datastore_api.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/datastore/datastore_api.c')
-rw-r--r--src/datastore/datastore_api.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/datastore/datastore_api.c b/src/datastore/datastore_api.c
index 6a994fbb0..497e654b2 100644
--- a/src/datastore/datastore_api.c
+++ b/src/datastore/datastore_api.c
@@ -142,7 +142,7 @@ struct GNUNET_DATASTORE_QueueEntry
142 /** 142 /**
143 * Task for timeout signalling. 143 * Task for timeout signalling.
144 */ 144 */
145 GNUNET_SCHEDULER_TaskIdentifier task; 145 struct GNUNET_SCHEDULER_Task * task;
146 146
147 /** 147 /**
148 * Timeout for the current operation. 148 * Timeout for the current operation.
@@ -216,7 +216,7 @@ struct GNUNET_DATASTORE_Handle
216 /** 216 /**
217 * Task for trying to reconnect. 217 * Task for trying to reconnect.
218 */ 218 */
219 GNUNET_SCHEDULER_TaskIdentifier reconnect_task; 219 struct GNUNET_SCHEDULER_Task * reconnect_task;
220 220
221 /** 221 /**
222 * How quickly should we retry? Used for exponential back-off on 222 * How quickly should we retry? Used for exponential back-off on
@@ -345,10 +345,10 @@ GNUNET_DATASTORE_disconnect (struct GNUNET_DATASTORE_Handle *h, int drop)
345 GNUNET_CLIENT_disconnect (h->client); 345 GNUNET_CLIENT_disconnect (h->client);
346 h->client = NULL; 346 h->client = NULL;
347 } 347 }
348 if (h->reconnect_task != GNUNET_SCHEDULER_NO_TASK) 348 if (h->reconnect_task != NULL)
349 { 349 {
350 GNUNET_SCHEDULER_cancel (h->reconnect_task); 350 GNUNET_SCHEDULER_cancel (h->reconnect_task);
351 h->reconnect_task = GNUNET_SCHEDULER_NO_TASK; 351 h->reconnect_task = NULL;
352 } 352 }
353 while (NULL != (qe = h->queue_head)) 353 while (NULL != (qe = h->queue_head))
354 { 354 {
@@ -393,7 +393,7 @@ timeout_queue_entry (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
393 GNUNET_STATISTICS_update (h->stats, 393 GNUNET_STATISTICS_update (h->stats,
394 gettext_noop ("# queue entry timeouts"), 1, 394 gettext_noop ("# queue entry timeouts"), 1,
395 GNUNET_NO); 395 GNUNET_NO);
396 qe->task = GNUNET_SCHEDULER_NO_TASK; 396 qe->task = NULL;
397 GNUNET_assert (GNUNET_NO == qe->was_transmitted); 397 GNUNET_assert (GNUNET_NO == qe->was_transmitted);
398 LOG (GNUNET_ERROR_TYPE_DEBUG, 398 LOG (GNUNET_ERROR_TYPE_DEBUG,
399 "Timeout of request in datastore queue\n"); 399 "Timeout of request in datastore queue\n");
@@ -521,7 +521,7 @@ try_reconnect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
521 struct GNUNET_DATASTORE_Handle *h = cls; 521 struct GNUNET_DATASTORE_Handle *h = cls;
522 522
523 h->retry_time = GNUNET_TIME_STD_BACKOFF (h->retry_time); 523 h->retry_time = GNUNET_TIME_STD_BACKOFF (h->retry_time);
524 h->reconnect_task = GNUNET_SCHEDULER_NO_TASK; 524 h->reconnect_task = NULL;
525 h->client = GNUNET_CLIENT_connect ("datastore", h->cfg); 525 h->client = GNUNET_CLIENT_connect ("datastore", h->cfg);
526 if (h->client == NULL) 526 if (h->client == NULL)
527 { 527 {
@@ -628,7 +628,7 @@ transmit_request (void *cls, size_t size, void *buf)
628 memcpy (buf, &qe[1], msize); 628 memcpy (buf, &qe[1], msize);
629 qe->was_transmitted = GNUNET_YES; 629 qe->was_transmitted = GNUNET_YES;
630 GNUNET_SCHEDULER_cancel (qe->task); 630 GNUNET_SCHEDULER_cancel (qe->task);
631 qe->task = GNUNET_SCHEDULER_NO_TASK; 631 qe->task = NULL;
632 GNUNET_assert (GNUNET_NO == h->in_receive); 632 GNUNET_assert (GNUNET_NO == h->in_receive);
633 h->in_receive = GNUNET_YES; 633 h->in_receive = GNUNET_YES;
634 GNUNET_CLIENT_receive (h->client, &receive_cb, h, 634 GNUNET_CLIENT_receive (h->client, &receive_cb, h,
@@ -720,10 +720,10 @@ free_queue_entry (struct GNUNET_DATASTORE_QueueEntry *qe)
720 struct GNUNET_DATASTORE_Handle *h = qe->h; 720 struct GNUNET_DATASTORE_Handle *h = qe->h;
721 721
722 GNUNET_CONTAINER_DLL_remove (h->queue_head, h->queue_tail, qe); 722 GNUNET_CONTAINER_DLL_remove (h->queue_head, h->queue_tail, qe);
723 if (qe->task != GNUNET_SCHEDULER_NO_TASK) 723 if (qe->task != NULL)
724 { 724 {
725 GNUNET_SCHEDULER_cancel (qe->task); 725 GNUNET_SCHEDULER_cancel (qe->task);
726 qe->task = GNUNET_SCHEDULER_NO_TASK; 726 qe->task = NULL;
727 } 727 }
728 h->queue_size--; 728 h->queue_size--;
729 qe->was_transmitted = GNUNET_SYSERR; /* use-after-free warning */ 729 qe->was_transmitted = GNUNET_SYSERR; /* use-after-free warning */