{
struct GNUNET_DATASTORE_Handle *h = cls;
- if (h->retry_time.value < GNUNET_CONSTANTS_SERVICE_RETRY.value)
+ 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.value > GNUNET_CONSTANTS_SERVICE_TIMEOUT.value)
+ if (h->retry_time.rel_value > GNUNET_CONSTANTS_SERVICE_TIMEOUT.rel_value)
h->retry_time = GNUNET_CONSTANTS_SERVICE_TIMEOUT;
h->reconnect_task = GNUNET_SCHEDULER_NO_TASK;
h->client = GNUNET_CLIENT_connect (h->sched, "datastore", h->cfg);
gettext_noop ("# status messages received"),
1,
GNUNET_NO);
- h->retry_time.value = 0;
+ h->retry_time.rel_value = 0;
process_queue (h);
if (rc.cont != NULL)
rc.cont (rc.cont_cls,
"Asked to update entry %llu raising priority by %u and expiration to %llu\n",
uid,
(unsigned int) priority,
- (unsigned long long) expiration.value);
+ (unsigned long long) expiration.abs_value);
#endif
qc.sc.cont = cont;
qc.sc.cont_cls = cont_cls;
rc.iter (rc.iter_cls,
NULL, 0, NULL, 0, 0, 0,
GNUNET_TIME_UNIT_ZERO_ABS, 0);
- h->retry_time.value = 0;
+ h->retry_time.rel_value = 0;
h->result_count = 0;
process_queue (h);
return;
ntohl(dm->size),
GNUNET_h2s(&dm->key));
#endif
- h->retry_time.value = 0;
+ h->retry_time.rel_value = 0;
rc.iter (rc.iter_cls,
&dm->key,
ntohl(dm->size),
#if DEBUG_DATASTORE
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Asked to get random entry in %llu ms\n",
- (unsigned long long) timeout.value);
+ (unsigned long long) timeout.abs_value);
#endif
qc.rc.iter = iter;
qc.rc.iter_cls = iter_cls;
#if DEBUG_DATASTORE
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Asked to get zero-anonymity entry in %llu ms\n",
- (unsigned long long) timeout.value);
+ (unsigned long long) timeout.abs_value);
#endif
qc.rc.iter = iter;
qc.rc.iter_cls = iter_cls;
return GNUNET_SYSERR;
}
now = GNUNET_TIME_absolute_get ();
- if (expiration.value > now.value)
+ if (expiration.abs_value > now.abs_value)
{
/* finished processing */
plugin->api->next_request (next_cls, GNUNET_YES);
"Deleting content `%s' of type %u that expired %llu ms ago\n",
GNUNET_h2s (key),
type,
- (unsigned long long) (now.value - expiration.value));
+ (unsigned long long) (now.abs_value - expiration.abs_value));
#endif
GNUNET_STATISTICS_update (stats,
gettext_noop ("# bytes expired"),
#if DEBUG_SQLITE
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Notification from statistics about existing payload (%llu), new payload is %llu\n",
- value,
+ abs_value,
payload);
#endif
return GNUNET_OK;
"Stored %llu kB / %lluk ops / %llu ops/s\n",
stored_bytes / 1024, /* used size in k */
stored_ops / 1024, /* total operations (in k) */
- 1000 * stored_ops / (1 + GNUNET_TIME_absolute_get_duration(start_time).value));
+ 1000 * stored_ops / (1 + GNUNET_TIME_absolute_get_duration(start_time).rel_value));
crc->phase = RP_PUT;
crc->j = 0;
GNUNET_SCHEDULER_add_continuation (crc->sched,
size = size - (size & 7); /* always multiple of 8 */
/* generate random key */
- key.bits[0] = (unsigned int) GNUNET_TIME_absolute_get ().value;
+ key.bits[0] = (unsigned int) GNUNET_TIME_absolute_get ().abs_value;
GNUNET_CRYPTO_hash (&key, sizeof (GNUNET_HashCode), &key);
memset (value, i, size);
if (i > 255)
crc->end = GNUNET_TIME_absolute_get();
printf (crc->msg,
crc->i,
- (unsigned long long) (crc->end.value - crc->start.value),
+ (unsigned long long) (crc->end.abs_value - crc->start.abs_value),
crc->cnt);
if (crc->phase != RP_AN_GET)
{
#if VERBOSE
fprintf (stderr, "Found result type=%u, priority=%u, size=%u, expire=%llu\n",
type, priority, size,
- (unsigned long long) expiration.value);
+ (unsigned long long) expiration.abs_value);
#endif
crc->cnt++;
crc->api->next_request (next_cls,
crc->end = GNUNET_TIME_absolute_get ();
printf ("%3u insertion took %20llums for %u\n",
crc->i,
- (unsigned long long) (crc->end.value - crc->start.value),
+ (unsigned long long) (crc->end.abs_value - crc->start.abs_value),
(unsigned int) PUT_10);
crc->i++;
crc->phase = RP_LP_GET;
&nrc->last_vkey,
GNUNET_YES,
MYSQL_TYPE_LONGLONG,
- &nrc->now.value,
+ &nrc->now.abs_value,
GNUNET_YES,
MYSQL_TYPE_LONGLONG,
&nrc->last_expire,
&nrc->last_vkey,
GNUNET_YES,
MYSQL_TYPE_LONGLONG,
- &nrc->now.value,
+ &nrc->now.abs_value,
GNUNET_YES, -1);
break;
default:
exp);
#endif
GNUNET_assert (nrc->plugin->next_task == GNUNET_SCHEDULER_NO_TASK);
- expiration.value = exp;
+ expiration.abs_value = exp;
ret = nrc->dviter (nrc->dviter_cls,
nrc,
&key,
unsigned int itype = type;
unsigned int ipriority = priority;
unsigned int ianonymity = anonymity;
- unsigned long long lexpiration = expiration.value;
+ unsigned long long lexpiration = expiration.abs_value;
unsigned long hashSize;
unsigned long hashSize2;
unsigned long long vkey;
{
struct Plugin *plugin = cls;
unsigned long long vkey = uid;
- unsigned long long lexpire = expire.value;
+ unsigned long long lexpire = expire.abs_value;
int ret;
#if DEBUG_MYSQL
type = ntohl (*(uint32_t *) PQgetvalue (res, 0, 0));
priority = ntohl (*(uint32_t *) PQgetvalue (res, 0, 1));
anonymity = ntohl ( *(uint32_t *) PQgetvalue (res, 0, 2));
- expiration_time.value = GNUNET_ntohll (*(uint64_t *) PQgetvalue (res, 0, 3));
+ expiration_time.abs_value = GNUNET_ntohll (*(uint64_t *) PQgetvalue (res, 0, 3));
memcpy (&key, PQgetvalue (res, 0, 4), sizeof (GNUNET_HashCode));
size = PQgetlength (res, 0, 5);
nrc->blast_prio = htonl (priority);
- nrc->blast_expire = GNUNET_htonll (expiration_time.value);
+ nrc->blast_expire = GNUNET_htonll (expiration_time.abs_value);
nrc->blast_rowid = htonl (rowid);
nrc->count++;
priority = sqlite3_column_int (nc->stmt, 2);
anonymity = sqlite3_column_int (nc->stmt, 3);
- expiration.value = sqlite3_column_int64 (nc->stmt, 4);
+ expiration.abs_value = sqlite3_column_int64 (nc->stmt, 4);
key = sqlite3_column_blob (nc->stmt, 5);
nc->lastPriority = priority;
nc->lastExpiration = expiration;
type,
GNUNET_h2s(key),
priority,
- (unsigned long long) GNUNET_TIME_absolute_get_remaining (expiration).value,
- (long long) expiration.value);
+ (unsigned long long) GNUNET_TIME_absolute_get_remaining (expiration).abs_value,
+ (long long) expiration.abs_value);
#endif
GNUNET_CRYPTO_hash (data, size, &vhash);
stmt = plugin->insertContent;
(SQLITE_OK != sqlite3_bind_int (stmt, 2, type)) ||
(SQLITE_OK != sqlite3_bind_int (stmt, 3, priority)) ||
(SQLITE_OK != sqlite3_bind_int (stmt, 4, anonymity)) ||
- (SQLITE_OK != sqlite3_bind_int64 (stmt, 5, expiration.value)) ||
+ (SQLITE_OK != sqlite3_bind_int64 (stmt, 5, expiration.abs_value)) ||
(SQLITE_OK !=
sqlite3_bind_blob (stmt, 6, key, sizeof (GNUNET_HashCode),
SQLITE_TRANSIENT)) ||
int n;
sqlite3_bind_int (plugin->updPrio, 1, delta);
- sqlite3_bind_int64 (plugin->updPrio, 2, expire.value);
+ sqlite3_bind_int64 (plugin->updPrio, 2, expire.abs_value);
sqlite3_bind_int64 (plugin->updPrio, 3, uid);
n = sqlite3_step (plugin->updPrio);
if (n != SQLITE_DONE)
#if DEBUG_SQLITE
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Restricting to results larger than the last expiration %llu\n",
- (unsigned long long) nc->lastExpiration.value);
+ (unsigned long long) nc->lastExpiration.abs_value);
#endif
- sqlite3_bind_int64 (ic->stmt_1, 1, nc->lastExpiration.value);
- sqlite3_bind_int64 (ic->stmt_2, 1, nc->lastExpiration.value);
+ sqlite3_bind_int64 (ic->stmt_1, 1, nc->lastExpiration.abs_value);
+ sqlite3_bind_int64 (ic->stmt_2, 1, nc->lastExpiration.abs_value);
}
#if DEBUG_SQLITE
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
#if DEBUG_SQLITE
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"At %llu, using queries `%s' and `%s'\n",
- (unsigned long long) GNUNET_TIME_absolute_get ().value,
+ (unsigned long long) GNUNET_TIME_absolute_get ().abs_value,
stmt_str_1,
stmt_str_2);
#endif
if (is_asc)
{
nc->lastPriority = 0;
- nc->lastExpiration.value = 0;
+ nc->lastExpiration.abs_value = 0;
memset (&nc->lastKey, 0, sizeof (GNUNET_HashCode));
}
else
{
nc->lastPriority = 0x7FFFFFFF;
- nc->lastExpiration.value = 0x7FFFFFFFFFFFFFFFLL;
+ nc->lastExpiration.abs_value = 0x7FFFFFFFFFFFFFFFLL;
memset (&nc->lastKey, 255, sizeof (GNUNET_HashCode));
}
sqlite_next_request (nc, GNUNET_NO);
now = GNUNET_TIME_absolute_get ();
GNUNET_asprintf (&q1, SELECT_IT_NON_ANONYMOUS_1,
- (unsigned long long) now.value);
+ (unsigned long long) now.abs_value);
GNUNET_asprintf (&q2, SELECT_IT_NON_ANONYMOUS_2,
- (unsigned long long) now.value);
+ (unsigned long long) now.abs_value);
basic_iter (cls,
type,
GNUNET_NO, GNUNET_YES,
now = GNUNET_TIME_absolute_get ();
GNUNET_asprintf (&q1, SELECT_IT_EXPIRATION_TIME_1,
- (unsigned long long) 0*now.value);
+ (unsigned long long) 0*now.abs_value);
GNUNET_asprintf (&q2, SELECT_IT_EXPIRATION_TIME_2,
- (unsigned long long) 0*now.value);
+ (unsigned long long) 0*now.abs_value);
basic_iter (cls,
type,
GNUNET_YES, GNUNET_NO,
now = GNUNET_TIME_absolute_get ();
GNUNET_asprintf (&q, SELECT_IT_MIGRATION_ORDER_2,
- (unsigned long long) now.value);
+ (unsigned long long) now.abs_value);
basic_iter (cls,
type,
GNUNET_NO, GNUNET_NO,
{
struct GNUNET_TIME_Absolute av;
- av.value = now.value + 20000000 - i * 1000;
+ av.abs_value = now.abs_value + 20000000 - i * 1000;
return av;
}
GNUNET_assert (type == get_type (i));
GNUNET_assert (priority == get_priority (i));
GNUNET_assert (anonymity == get_anonymity(i));
- GNUNET_assert (expiration.value == get_expiration(i).value);
+ GNUNET_assert (expiration.abs_value == get_expiration(i).abs_value);
GNUNET_DATASTORE_get_next (datastore, GNUNET_YES);
}
{
struct GNUNET_TIME_Absolute av;
- av.value = now.value + i * 1000;
+ av.abs_value = now.abs_value + i * 1000;
return av;
}
GNUNET_assert (type == get_type (i));
GNUNET_assert (priority == get_priority (i));
GNUNET_assert (anonymity == get_anonymity(i));
- GNUNET_assert (expiration.value == get_expiration(i).value);
+ GNUNET_assert (expiration.abs_value == get_expiration(i).abs_value);
GNUNET_DATASTORE_get_next (datastore, GNUNET_YES);
}