aboutsummaryrefslogtreecommitdiff
path: root/src/datastore
diff options
context:
space:
mode:
authorgrothoff <grothoff@140774ce-b5e7-0310-ab8b-a85725594a96>2012-10-26 22:13:01 +0000
committergrothoff <grothoff@140774ce-b5e7-0310-ab8b-a85725594a96>2012-10-26 22:13:01 +0000
commit38ef1d735d91ed90ec71f41562793f6028ba32b6 (patch)
tree83093d92761d5c1b8b2fded713adaa19af29274c /src/datastore
parent05123118a344d73e34c3a8cb15c078ecb273844d (diff)
-bugfixes, code cleanup
git-svn-id: https://gnunet.org/svn/gnunet@24573 140774ce-b5e7-0310-ab8b-a85725594a96
Diffstat (limited to 'src/datastore')
-rw-r--r--src/datastore/datastore_api.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/datastore/datastore_api.c b/src/datastore/datastore_api.c
index fcfc076d27..8ff96d639c 100644
--- a/src/datastore/datastore_api.c
+++ b/src/datastore/datastore_api.c
@@ -512,12 +512,7 @@ try_reconnect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
struct GNUNET_DATASTORE_Handle *h = cls;
- if (h->retry_time.rel_value < GNUNET_CONSTANTS_SERVICE_RETRY.rel_value)
- h->retry_time = GNUNET_CONSTANTS_SERVICE_RETRY;
- else
- h->retry_time = GNUNET_TIME_relative_multiply (h->retry_time, 2);
- if (h->retry_time.rel_value > GNUNET_CONSTANTS_SERVICE_TIMEOUT.rel_value)
- h->retry_time = GNUNET_CONSTANTS_SERVICE_TIMEOUT;
+ h->retry_time = GNUNET_TIME_STD_BACKOFF (h->retry_time);
h->reconnect_task = GNUNET_SCHEDULER_NO_TASK;
h->client = GNUNET_CLIENT_connect ("datastore", h->cfg);
if (h->client == NULL)
@@ -802,7 +797,7 @@ process_status_message (void *cls, const struct GNUNET_MessageHeader *msg)
GNUNET_STATISTICS_update (h->stats,
gettext_noop ("# status messages received"), 1,
GNUNET_NO);
- h->retry_time.rel_value = 0;
+ h->retry_time = GNUNET_TIME_UNIT_ZERO;
process_queue (h);
if (rc.cont != NULL)
rc.cont (rc.cont_cls, status,
@@ -1184,7 +1179,7 @@ process_result_message (void *cls, const struct GNUNET_MessageHeader *msg)
free_queue_entry (qe);
LOG (GNUNET_ERROR_TYPE_DEBUG,
"Received end of result set, new queue size is %u\n", h->queue_size);
- h->retry_time.rel_value = 0;
+ h->retry_time = GNUNET_TIME_UNIT_ZERO;
h->result_count = 0;
process_queue (h);
if (rc.proc != NULL)
@@ -1231,7 +1226,7 @@ process_result_message (void *cls, const struct GNUNET_MessageHeader *msg)
(unsigned long long) GNUNET_ntohll (dm->uid), ntohl (dm->type),
ntohl (dm->size), GNUNET_h2s (&dm->key));
free_queue_entry (qe);
- h->retry_time.rel_value = 0;
+ h->retry_time = GNUNET_TIME_UNIT_ZERO;
process_queue (h);
if (rc.proc != NULL)
rc.proc (rc.proc_cls, &dm->key, ntohl (dm->size), &dm[1], ntohl (dm->type),