diff options
author | Christian Grothoff <christian@grothoff.org> | 2012-10-26 22:13:01 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2012-10-26 22:13:01 +0000 |
commit | 64d3e46cfb99a711e500fa1f114e7c44bdf10040 (patch) | |
tree | 83093d92761d5c1b8b2fded713adaa19af29274c /src/datastore | |
parent | ef6f05f63769263a5201636c4b7f71eaa455cdf3 (diff) | |
download | gnunet-64d3e46cfb99a711e500fa1f114e7c44bdf10040.tar.gz gnunet-64d3e46cfb99a711e500fa1f114e7c44bdf10040.zip |
-bugfixes, code cleanup
Diffstat (limited to 'src/datastore')
-rw-r--r-- | src/datastore/datastore_api.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/src/datastore/datastore_api.c b/src/datastore/datastore_api.c index fcfc076d2..8ff96d639 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) | |||
512 | { | 512 | { |
513 | struct GNUNET_DATASTORE_Handle *h = cls; | 513 | struct GNUNET_DATASTORE_Handle *h = cls; |
514 | 514 | ||
515 | if (h->retry_time.rel_value < GNUNET_CONSTANTS_SERVICE_RETRY.rel_value) | 515 | h->retry_time = GNUNET_TIME_STD_BACKOFF (h->retry_time); |
516 | h->retry_time = GNUNET_CONSTANTS_SERVICE_RETRY; | ||
517 | else | ||
518 | h->retry_time = GNUNET_TIME_relative_multiply (h->retry_time, 2); | ||
519 | if (h->retry_time.rel_value > GNUNET_CONSTANTS_SERVICE_TIMEOUT.rel_value) | ||
520 | h->retry_time = GNUNET_CONSTANTS_SERVICE_TIMEOUT; | ||
521 | h->reconnect_task = GNUNET_SCHEDULER_NO_TASK; | 516 | h->reconnect_task = GNUNET_SCHEDULER_NO_TASK; |
522 | h->client = GNUNET_CLIENT_connect ("datastore", h->cfg); | 517 | h->client = GNUNET_CLIENT_connect ("datastore", h->cfg); |
523 | if (h->client == NULL) | 518 | if (h->client == NULL) |
@@ -802,7 +797,7 @@ process_status_message (void *cls, const struct GNUNET_MessageHeader *msg) | |||
802 | GNUNET_STATISTICS_update (h->stats, | 797 | GNUNET_STATISTICS_update (h->stats, |
803 | gettext_noop ("# status messages received"), 1, | 798 | gettext_noop ("# status messages received"), 1, |
804 | GNUNET_NO); | 799 | GNUNET_NO); |
805 | h->retry_time.rel_value = 0; | 800 | h->retry_time = GNUNET_TIME_UNIT_ZERO; |
806 | process_queue (h); | 801 | process_queue (h); |
807 | if (rc.cont != NULL) | 802 | if (rc.cont != NULL) |
808 | rc.cont (rc.cont_cls, status, | 803 | rc.cont (rc.cont_cls, status, |
@@ -1184,7 +1179,7 @@ process_result_message (void *cls, const struct GNUNET_MessageHeader *msg) | |||
1184 | free_queue_entry (qe); | 1179 | free_queue_entry (qe); |
1185 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 1180 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
1186 | "Received end of result set, new queue size is %u\n", h->queue_size); | 1181 | "Received end of result set, new queue size is %u\n", h->queue_size); |
1187 | h->retry_time.rel_value = 0; | 1182 | h->retry_time = GNUNET_TIME_UNIT_ZERO; |
1188 | h->result_count = 0; | 1183 | h->result_count = 0; |
1189 | process_queue (h); | 1184 | process_queue (h); |
1190 | if (rc.proc != NULL) | 1185 | if (rc.proc != NULL) |
@@ -1231,7 +1226,7 @@ process_result_message (void *cls, const struct GNUNET_MessageHeader *msg) | |||
1231 | (unsigned long long) GNUNET_ntohll (dm->uid), ntohl (dm->type), | 1226 | (unsigned long long) GNUNET_ntohll (dm->uid), ntohl (dm->type), |
1232 | ntohl (dm->size), GNUNET_h2s (&dm->key)); | 1227 | ntohl (dm->size), GNUNET_h2s (&dm->key)); |
1233 | free_queue_entry (qe); | 1228 | free_queue_entry (qe); |
1234 | h->retry_time.rel_value = 0; | 1229 | h->retry_time = GNUNET_TIME_UNIT_ZERO; |
1235 | process_queue (h); | 1230 | process_queue (h); |
1236 | if (rc.proc != NULL) | 1231 | if (rc.proc != NULL) |
1237 | rc.proc (rc.proc_cls, &dm->key, ntohl (dm->size), &dm[1], ntohl (dm->type), | 1232 | rc.proc (rc.proc_cls, &dm->key, ntohl (dm->size), &dm[1], ntohl (dm->type), |