port 0 for tcp plugin is BAD
[oweals/gnunet.git] / src / datacache / plugin_datacache_postgres.c
index fcd9e516138571c8faa6aa4e04a0ff6fc2ddc07d..182341b98713ab50bb9e99bf609f6a9301d61c74 100644 (file)
@@ -25,7 +25,7 @@
  */
 #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
@@ -301,10 +301,10 @@ delete_by_rowid (struct Plugin *plugin,
  * @param discard_time when to discard the value in any case
  * @return 0 on error, number of bytes used otherwise
  */
-static uint32_t 
+static size_t 
 postgres_plugin_put (void *cls,
                     const GNUNET_HashCode * key,
-                    uint32_t size,
+                    size_t size,
                     const char *data,
                     enum GNUNET_BLOCK_Type type,
                     struct GNUNET_TIME_Absolute discard_time)
@@ -312,7 +312,7 @@ postgres_plugin_put (void *cls,
   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,
@@ -422,7 +422,7 @@ postgres_plugin_get (void *cls,
     }
   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