*/
#include "platform.h"
#include "gnunet_util_lib.h"
-#include "plugin_datacache.h"
+#include "gnunet_datacache_plugin.h"
#include <postgresql/libpq-fe.h>
#define DEBUG_POSTGRES GNUNET_NO
PGresult *ret;
/* Open database and precompile statements */
- conninfo = NULL;
- GNUNET_CONFIGURATION_get_value_string (plugin->env->cfg,
- "datacache-postgres",
- "CONFIG",
- &conninfo);
+ if (GNUNET_OK !=
+ GNUNET_CONFIGURATION_get_value_string (plugin->env->cfg,
+ "datacache-postgres",
+ "CONFIG",
+ &conninfo))
+ conninfo = NULL;
plugin->dbh = PQconnectdb (conninfo == NULL ? "" : conninfo);
GNUNET_free_non_null (conninfo);
if (NULL == plugin->dbh)
(ret,
PG_DIAG_SQLSTATE)))))
{
- check_result (plugin,
- ret, PGRES_COMMAND_OK, "CREATE TABLE", "gn090dc", __LINE__);
+ (void) check_result (plugin,
+ ret, PGRES_COMMAND_OK, "CREATE TABLE", "gn090dc", __LINE__);
PQfinish (plugin->dbh);
plugin->dbh = NULL;
return GNUNET_SYSERR;
struct Plugin *plugin = cls;
PGresult *ret;
uint32_t btype = htonl (type);
- uint64_t bexpi = GNUNET_TIME_absolute_hton (discard_time).value__;
+ uint64_t bexpi = GNUNET_TIME_absolute_hton (discard_time).abs_value__;
const char *paramValues[] = {
(const char *) &btype,
(const char *) &bexpi,
}
for (i=0;i<cnt;i++)
{
- expiration_time.value = GNUNET_ntohll (*(uint64_t *) PQgetvalue (res, i, 0));
+ expiration_time.abs_value = GNUNET_ntohll (*(uint64_t *) PQgetvalue (res, i, 0));
type = ntohl (*(uint32_t *) PQgetvalue (res, i, 1));
size = PQgetlength (res, i, 2);
#if DEBUG_POSTGRES