diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-08-11 21:21:56 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-08-11 21:21:56 +0000 |
commit | 3d7fefedc9ba60bd8e8448efe8b628446d958536 (patch) | |
tree | 61ce41a52cd6e7232cead77818ef265993b2427e /src/datacache/plugin_datacache_sqlite.c | |
parent | 4a0398474db197abed243a123fb971fbeeffab4b (diff) | |
download | gnunet-3d7fefedc9ba60bd8e8448efe8b628446d958536.tar.gz gnunet-3d7fefedc9ba60bd8e8448efe8b628446d958536.zip |
changing time measurement from milliseconds to microseconds
Diffstat (limited to 'src/datacache/plugin_datacache_sqlite.c')
-rw-r--r-- | src/datacache/plugin_datacache_sqlite.c | 12 |
1 files changed, 6 insertions, 6 deletions
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++; |