aboutsummaryrefslogtreecommitdiff
path: root/src/datastore/plugin_datastore_postgres.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/datastore/plugin_datastore_postgres.c')
-rw-r--r--src/datastore/plugin_datastore_postgres.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/datastore/plugin_datastore_postgres.c b/src/datastore/plugin_datastore_postgres.c
index 83fc423da..98109d4da 100644
--- a/src/datastore/plugin_datastore_postgres.c
+++ b/src/datastore/plugin_datastore_postgres.c
@@ -1,6 +1,6 @@
1/* 1/*
2 This file is part of GNUnet 2 This file is part of GNUnet
3 (C) 2009, 2010, 2011, 2012 Christian Grothoff (and other contributing authors) 3 (C) 2009-2013 Christian Grothoff (and other contributing authors)
4 4
5 GNUnet is free software; you can redistribute it and/or modify 5 GNUnet is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published 6 it under the terms of the GNU General Public License as published
@@ -283,7 +283,7 @@ postgres_plugin_put (void *cls, const struct GNUNET_HashCode * key, uint32_t siz
283 uint32_t bprio = htonl (priority); 283 uint32_t bprio = htonl (priority);
284 uint32_t banon = htonl (anonymity); 284 uint32_t banon = htonl (anonymity);
285 uint32_t brepl = htonl (replication); 285 uint32_t brepl = htonl (replication);
286 uint64_t bexpi = GNUNET_TIME_absolute_hton (expiration).abs_value__; 286 uint64_t bexpi = GNUNET_TIME_absolute_hton (expiration).abs_value_us__;
287 287
288 const char *paramValues[] = { 288 const char *paramValues[] = {
289 (const char *) &brepl, 289 (const char *) &brepl,
@@ -392,7 +392,7 @@ process_result (struct Plugin *plugin, PluginDatumProcessor proc,
392 type = ntohl (*(uint32_t *) PQgetvalue (res, 0, 0)); 392 type = ntohl (*(uint32_t *) PQgetvalue (res, 0, 0));
393 priority = ntohl (*(uint32_t *) PQgetvalue (res, 0, 1)); 393 priority = ntohl (*(uint32_t *) PQgetvalue (res, 0, 1));
394 anonymity = ntohl (*(uint32_t *) PQgetvalue (res, 0, 2)); 394 anonymity = ntohl (*(uint32_t *) PQgetvalue (res, 0, 2));
395 expiration_time.abs_value = 395 expiration_time.abs_value_us =
396 GNUNET_ntohll (*(uint64_t *) PQgetvalue (res, 0, 3)); 396 GNUNET_ntohll (*(uint64_t *) PQgetvalue (res, 0, 3));
397 memcpy (&key, PQgetvalue (res, 0, 4), sizeof (struct GNUNET_HashCode)); 397 memcpy (&key, PQgetvalue (res, 0, 4), sizeof (struct GNUNET_HashCode));
398 size = PQgetlength (res, 0, 5); 398 size = PQgetlength (res, 0, 5);
@@ -712,7 +712,7 @@ postgres_plugin_get_expiration (void *cls, PluginDatumProcessor proc,
712 const char *paramValues[] = { (const char *) &btime }; 712 const char *paramValues[] = { (const char *) &btime };
713 PGresult *ret; 713 PGresult *ret;
714 714
715 btime = GNUNET_htonll (GNUNET_TIME_absolute_get ().abs_value); 715 btime = GNUNET_htonll (GNUNET_TIME_absolute_get ().abs_value_us);
716 ret = 716 ret =
717 PQexecPrepared (plugin->dbh, "select_expiration_order", 1, paramValues, 717 PQexecPrepared (plugin->dbh, "select_expiration_order", 1, paramValues,
718 paramLengths, paramFormats, 1); 718 paramLengths, paramFormats, 1);
@@ -751,7 +751,7 @@ postgres_plugin_update (void *cls, uint64_t uid, int delta,
751 PGresult *ret; 751 PGresult *ret;
752 int32_t bdelta = (int32_t) htonl ((uint32_t) delta); 752 int32_t bdelta = (int32_t) htonl ((uint32_t) delta);
753 uint32_t boid = htonl ((uint32_t) uid); 753 uint32_t boid = htonl ((uint32_t) uid);
754 uint64_t bexpire = GNUNET_TIME_absolute_hton (expire).abs_value__; 754 uint64_t bexpire = GNUNET_TIME_absolute_hton (expire).abs_value_us__;
755 755
756 const char *paramValues[] = { 756 const char *paramValues[] = {
757 (const char *) &bdelta, 757 (const char *) &bdelta,