aboutsummaryrefslogtreecommitdiff
path: root/src/datacache
diff options
context:
space:
mode:
Diffstat (limited to 'src/datacache')
-rw-r--r--src/datacache/perf_datacache.c4
-rw-r--r--src/datacache/plugin_datacache_heap.c4
-rw-r--r--src/datacache/plugin_datacache_postgres.c4
-rw-r--r--src/datacache/plugin_datacache_sqlite.c12
-rw-r--r--src/datacache/test_datacache.c2
-rw-r--r--src/datacache/test_datacache_quota.c2
6 files changed, 14 insertions, 14 deletions
diff --git a/src/datacache/perf_datacache.c b/src/datacache/perf_datacache.c
index 84775a314..027999d22 100644
--- a/src/datacache/perf_datacache.c
+++ b/src/datacache/perf_datacache.c
@@ -96,7 +96,7 @@ run (void *cls, char *const *args, const char *cfgfile,
96 GNUNET_STRINGS_relative_time_to_string (GNUNET_TIME_absolute_get_duration (start), GNUNET_YES)); 96 GNUNET_STRINGS_relative_time_to_string (GNUNET_TIME_absolute_get_duration (start), GNUNET_YES));
97 GNUNET_snprintf (gstr, sizeof (gstr), "DATACACHE-%s", plugin_name); 97 GNUNET_snprintf (gstr, sizeof (gstr), "DATACACHE-%s", plugin_name);
98 GAUGER (gstr, "Time to PUT item in datacache", 98 GAUGER (gstr, "Time to PUT item in datacache",
99 GNUNET_TIME_absolute_get_duration (start).rel_value / ITERATIONS, 99 GNUNET_TIME_absolute_get_duration (start).rel_value_us / 1000LL / ITERATIONS,
100 "ms/item"); 100 "ms/item");
101 start = GNUNET_TIME_absolute_get (); 101 start = GNUNET_TIME_absolute_get ();
102 memset (&k, 0, sizeof (struct GNUNET_HashCode)); 102 memset (&k, 0, sizeof (struct GNUNET_HashCode));
@@ -116,7 +116,7 @@ run (void *cls, char *const *args, const char *cfgfile,
116 ITERATIONS - found); 116 ITERATIONS - found);
117 if (found > 0) 117 if (found > 0)
118 GAUGER (gstr, "Time to GET item from datacache", 118 GAUGER (gstr, "Time to GET item from datacache",
119 GNUNET_TIME_absolute_get_duration (start).rel_value / found, 119 GNUNET_TIME_absolute_get_duration (start).rel_value_us / 1000LL / found,
120 "ms/item"); 120 "ms/item");
121 GNUNET_DATACACHE_destroy (h); 121 GNUNET_DATACACHE_destroy (h);
122 ASSERT (ok == 0); 122 ASSERT (ok == 0);
diff --git a/src/datacache/plugin_datacache_heap.c b/src/datacache/plugin_datacache_heap.c
index 41dd08974..aee6cd5b8 100644
--- a/src/datacache/plugin_datacache_heap.c
+++ b/src/datacache/plugin_datacache_heap.c
@@ -182,7 +182,7 @@ put_cb (void *cls,
182 put_ctx->path_info_len * sizeof (struct GNUNET_PeerIdentity)); 182 put_ctx->path_info_len * sizeof (struct GNUNET_PeerIdentity));
183 GNUNET_CONTAINER_heap_update_cost (put_ctx->heap, 183 GNUNET_CONTAINER_heap_update_cost (put_ctx->heap,
184 val->hn, 184 val->hn,
185 val->discard_time.abs_value); 185 val->discard_time.abs_value_us);
186 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 186 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
187 "Got same value for key %s and type %d (size %u vs %u)\n", 187 "Got same value for key %s and type %d (size %u vs %u)\n",
188 GNUNET_h2s (key), 188 GNUNET_h2s (key),
@@ -250,7 +250,7 @@ heap_plugin_put (void *cls, const struct GNUNET_HashCode * key, size_t size,
250 GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE); 250 GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE);
251 val->hn = GNUNET_CONTAINER_heap_insert (plugin->heap, 251 val->hn = GNUNET_CONTAINER_heap_insert (plugin->heap,
252 val, 252 val,
253 val->discard_time.abs_value); 253 val->discard_time.abs_value_us);
254 return size + OVERHEAD; 254 return size + OVERHEAD;
255} 255}
256 256
diff --git a/src/datacache/plugin_datacache_postgres.c b/src/datacache/plugin_datacache_postgres.c
index e7d2e72c2..c8d66ead1 100644
--- a/src/datacache/plugin_datacache_postgres.c
+++ b/src/datacache/plugin_datacache_postgres.c
@@ -176,7 +176,7 @@ postgres_plugin_put (void *cls, const struct GNUNET_HashCode * key, size_t size,
176 struct Plugin *plugin = cls; 176 struct Plugin *plugin = cls;
177 PGresult *ret; 177 PGresult *ret;
178 uint32_t btype = htonl (type); 178 uint32_t btype = htonl (type);
179 uint64_t bexpi = GNUNET_TIME_absolute_hton (discard_time).abs_value__; 179 uint64_t bexpi = GNUNET_TIME_absolute_hton (discard_time).abs_value_us__;
180 180
181 const char *paramValues[] = { 181 const char *paramValues[] = {
182 (const char *) &btype, 182 (const char *) &btype,
@@ -277,7 +277,7 @@ postgres_plugin_get (void *cls, const struct GNUNET_HashCode * key,
277 } 277 }
278 for (i = 0; i < cnt; i++) 278 for (i = 0; i < cnt; i++)
279 { 279 {
280 expiration_time.abs_value = 280 expiration_time.abs_value_us =
281 GNUNET_ntohll (*(uint64_t *) PQgetvalue (res, i, 0)); 281 GNUNET_ntohll (*(uint64_t *) PQgetvalue (res, i, 0));
282 type = ntohl (*(uint32_t *) PQgetvalue (res, i, 1)); 282 type = ntohl (*(uint32_t *) PQgetvalue (res, i, 1));
283 size = PQgetlength (res, i, 2); 283 size = PQgetlength (res, i, 2);
diff --git a/src/datacache/plugin_datacache_sqlite.c b/src/datacache/plugin_datacache_sqlite.c
index bf76f310f..34aa61363 100644
--- a/src/datacache/plugin_datacache_sqlite.c
+++ b/src/datacache/plugin_datacache_sqlite.c
@@ -116,7 +116,7 @@ sqlite_plugin_put (void *cls,
116 "Processing `%s' of %u bytes with key `%4s' and expiration %s\n", 116 "Processing `%s' of %u bytes with key `%4s' and expiration %s\n",
117 "PUT", (unsigned int) size, GNUNET_h2s (key), 117 "PUT", (unsigned int) size, GNUNET_h2s (key),
118 GNUNET_STRINGS_relative_time_to_string (GNUNET_TIME_absolute_get_remaining (discard_time), GNUNET_YES)); 118 GNUNET_STRINGS_relative_time_to_string (GNUNET_TIME_absolute_get_remaining (discard_time), GNUNET_YES));
119 dval = (int64_t) discard_time.abs_value; 119 dval = (int64_t) discard_time.abs_value_us;
120 if (dval < 0) 120 if (dval < 0)
121 dval = INT64_MAX; 121 dval = INT64_MAX;
122 if (sq_prepare 122 if (sq_prepare
@@ -203,13 +203,13 @@ sqlite_plugin_get (void *cls, const struct GNUNET_HashCode * key,
203 "sq_prepare"); 203 "sq_prepare");
204 return 0; 204 return 0;
205 } 205 }
206 ntime = (int64_t) now.abs_value; 206 ntime = (int64_t) now.abs_value_us;
207 GNUNET_assert (ntime >= 0); 207 GNUNET_assert (ntime >= 0);
208 if ((SQLITE_OK != 208 if ((SQLITE_OK !=
209 sqlite3_bind_blob (stmt, 1, key, sizeof (struct GNUNET_HashCode), 209 sqlite3_bind_blob (stmt, 1, key, sizeof (struct GNUNET_HashCode),
210 SQLITE_TRANSIENT)) || 210 SQLITE_TRANSIENT)) ||
211 (SQLITE_OK != sqlite3_bind_int (stmt, 2, type)) || 211 (SQLITE_OK != sqlite3_bind_int (stmt, 2, type)) ||
212 (SQLITE_OK != sqlite3_bind_int64 (stmt, 3, now.abs_value))) 212 (SQLITE_OK != sqlite3_bind_int64 (stmt, 3, now.abs_value_us)))
213 { 213 {
214 LOG_SQLITE (plugin->dbh, GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK, 214 LOG_SQLITE (plugin->dbh, GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK,
215 "sqlite3_bind_xxx"); 215 "sqlite3_bind_xxx");
@@ -256,7 +256,7 @@ sqlite_plugin_get (void *cls, const struct GNUNET_HashCode * key,
256 sqlite3_bind_blob (stmt, 1, key, sizeof (struct GNUNET_HashCode), 256 sqlite3_bind_blob (stmt, 1, key, sizeof (struct GNUNET_HashCode),
257 SQLITE_TRANSIENT)) || 257 SQLITE_TRANSIENT)) ||
258 (SQLITE_OK != sqlite3_bind_int (stmt, 2, type)) || 258 (SQLITE_OK != sqlite3_bind_int (stmt, 2, type)) ||
259 (SQLITE_OK != sqlite3_bind_int64 (stmt, 3, now.abs_value))) 259 (SQLITE_OK != sqlite3_bind_int64 (stmt, 3, now.abs_value_us)))
260 { 260 {
261 LOG_SQLITE (plugin->dbh, GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK, 261 LOG_SQLITE (plugin->dbh, GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK,
262 "sqlite3_bind_xxx"); 262 "sqlite3_bind_xxx");
@@ -267,7 +267,7 @@ sqlite_plugin_get (void *cls, const struct GNUNET_HashCode * key,
267 break; 267 break;
268 size = sqlite3_column_bytes (stmt, 0); 268 size = sqlite3_column_bytes (stmt, 0);
269 dat = sqlite3_column_blob (stmt, 0); 269 dat = sqlite3_column_blob (stmt, 0);
270 exp.abs_value = sqlite3_column_int64 (stmt, 1); 270 exp.abs_value_us = sqlite3_column_int64 (stmt, 1);
271 psize = sqlite3_column_bytes (stmt, 2); 271 psize = sqlite3_column_bytes (stmt, 2);
272 if (0 != psize % sizeof (struct GNUNET_PeerIdentity)) 272 if (0 != psize % sizeof (struct GNUNET_PeerIdentity))
273 { 273 {
@@ -279,7 +279,7 @@ sqlite_plugin_get (void *cls, const struct GNUNET_HashCode * key,
279 path = sqlite3_column_blob (stmt, 2); 279 path = sqlite3_column_blob (stmt, 2);
280 else 280 else
281 path = NULL; 281 path = NULL;
282 ntime = (int64_t) exp.abs_value; 282 ntime = (int64_t) exp.abs_value_us;
283 if (ntime == INT64_MAX) 283 if (ntime == INT64_MAX)
284 exp = GNUNET_TIME_UNIT_FOREVER_ABS; 284 exp = GNUNET_TIME_UNIT_FOREVER_ABS;
285 cnt++; 285 cnt++;
diff --git a/src/datacache/test_datacache.c b/src/datacache/test_datacache.c
index 8c429cc7a..071ae721f 100644
--- a/src/datacache/test_datacache.c
+++ b/src/datacache/test_datacache.c
@@ -80,7 +80,7 @@ run (void *cls, char *const *args, const char *cfgfile,
80 return; 80 return;
81 } 81 }
82 exp = GNUNET_TIME_absolute_get (); 82 exp = GNUNET_TIME_absolute_get ();
83 exp.abs_value += 5 * 60 * 1000; 83 exp.abs_value_us += 5 * 60 * 1000 * 1000LL;
84 memset (&k, 0, sizeof (struct GNUNET_HashCode)); 84 memset (&k, 0, sizeof (struct GNUNET_HashCode));
85 for (i = 0; i < 100; i++) 85 for (i = 0; i < 100; i++)
86 { 86 {
diff --git a/src/datacache/test_datacache_quota.c b/src/datacache/test_datacache_quota.c
index 0400b5051..877c62a3f 100644
--- a/src/datacache/test_datacache_quota.c
+++ b/src/datacache/test_datacache_quota.c
@@ -71,7 +71,7 @@ run (void *cls, char *const *args, const char *cfgfile,
71 GNUNET_CRYPTO_hash (&k, sizeof (struct GNUNET_HashCode), &n); 71 GNUNET_CRYPTO_hash (&k, sizeof (struct GNUNET_HashCode), &n);
72 for (j = i; j < sizeof (buf); j += 10) 72 for (j = i; j < sizeof (buf); j += 10)
73 { 73 {
74 exp.abs_value++; 74 exp.abs_value_us++;
75 buf[j] = i; 75 buf[j] = i;
76 ASSERT (GNUNET_OK == GNUNET_DATACACHE_put (h, &k, j, buf, 1 + i, exp, 0, NULL)); 76 ASSERT (GNUNET_OK == GNUNET_DATACACHE_put (h, &k, j, buf, 1 + i, exp, 0, NULL));
77 ASSERT (0 < GNUNET_DATACACHE_get (h, &k, 1 + i, NULL, NULL)); 77 ASSERT (0 < GNUNET_DATACACHE_get (h, &k, 1 + i, NULL, NULL));