gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r38143 - gnunet/src/psycstore


From: gnunet
Subject: [GNUnet-SVN] r38143 - gnunet/src/psycstore
Date: Wed, 12 Oct 2016 21:58:24 +0200

Author: tg
Date: 2016-10-12 21:58:23 +0200 (Wed, 12 Oct 2016)
New Revision: 38143

Modified:
   gnunet/src/psycstore/plugin_psycstore_postgres.c
   gnunet/src/psycstore/test_plugin_psycstore.c
Log:
psycstore: postgres fixes

Modified: gnunet/src/psycstore/plugin_psycstore_postgres.c
===================================================================
--- gnunet/src/psycstore/plugin_psycstore_postgres.c    2016-10-12 19:58:22 UTC 
(rev 38142)
+++ gnunet/src/psycstore/plugin_psycstore_postgres.c    2016-10-12 19:58:23 UTC 
(rev 38143)
@@ -166,8 +166,8 @@
                               "  fragment_offset BIGINT NOT NULL,\n"
                               "  message_id BIGINT NOT NULL,\n"
                               "  group_generation BIGINT NOT NULL,\n"
-                              "  multicast_flags BIGINT NOT NULL,\n"
-                              "  psycstore_flags BIGINT NOT NULL,\n"
+                              "  multicast_flags INT NOT NULL,\n"
+                              "  psycstore_flags INT NOT NULL,\n"
                               "  data BYTEA,\n"
                               "  PRIMARY KEY (channel_id, fragment_id),\n"
                               "  UNIQUE (channel_id, message_id, 
fragment_offset)\n"
@@ -765,7 +765,7 @@
   uint64_t group_generation = GNUNET_ntohll (msg->group_generation);
 
   uint64_t hop_counter = ntohl(msg->hop_counter);
-  uint64_t flags = ntohl(msg->flags);
+  uint32_t flags = ntohl(msg->flags);
 
   if (fragment_id > INT64_MAX || fragment_offset > INT64_MAX ||
       message_id > INT64_MAX || group_generation > INT64_MAX)
@@ -790,10 +790,9 @@
     GNUNET_PQ_query_param_uint64 (&fragment_offset),
     GNUNET_PQ_query_param_uint64 (&message_id),
     GNUNET_PQ_query_param_uint64 (&group_generation),
-    GNUNET_PQ_query_param_uint64 (&flags),
+    GNUNET_PQ_query_param_uint32 (&flags),
     GNUNET_PQ_query_param_uint32 (&psycstore_flags),
-    GNUNET_PQ_query_param_fixed_size (&msg[1], ntohs (msg->header.size)
-                                                  - sizeof (*msg)),
+    GNUNET_PQ_query_param_fixed_size (&msg[1], ntohs (msg->header.size) - 
sizeof (*msg)),
     GNUNET_PQ_query_param_end
   };
 
@@ -880,10 +879,9 @@
     GNUNET_PQ_result_spec_uint64 ("fragment_offset", &fragment_offset),
     GNUNET_PQ_result_spec_uint64 ("message_id", &message_id),
     GNUNET_PQ_result_spec_uint64 ("group_generation", &group_generation),
-    GNUNET_PQ_result_spec_uint64 ("msg_flags", &msg_flags),
-    GNUNET_PQ_result_spec_uint64 ("flags", &flags),
-    GNUNET_PQ_result_spec_variable_size ("data", &buf,
-                                         &buf_size),
+    GNUNET_PQ_result_spec_uint64 ("multicast_flags", &msg_flags),
+    GNUNET_PQ_result_spec_uint64 ("psycstore_flags", &flags),
+    GNUNET_PQ_result_spec_variable_size ("data", &buf, &buf_size),
     GNUNET_PQ_result_spec_end
   };
 
@@ -905,7 +903,6 @@
   else
   {
     if (GNUNET_OK != GNUNET_PQ_extract_result(res, results, 0)) {
-      PQclear (res);
       return GNUNET_SYSERR;
     }
 
@@ -933,7 +930,6 @@
     ret = cb (cb_cls, mp, (enum GNUNET_PSYCSTORE_MessageFlags) flags);
   }
 
-  PQclear (res);
   return ret;
 }
 

Modified: gnunet/src/psycstore/test_plugin_psycstore.c
===================================================================
--- gnunet/src/psycstore/test_plugin_psycstore.c        2016-10-12 19:58:22 UTC 
(rev 38142)
+++ gnunet/src/psycstore/test_plugin_psycstore.c        2016-10-12 19:58:23 UTC 
(rev 38143)
@@ -279,17 +279,6 @@
                                    &ret_frags, fragment_cb, &fcls));
   GNUNET_assert (fcls.n == 1);
 
-#if GABOR
-  LOG (GNUNET_ERROR_TYPE_INFO, "fragment_get(%" PRIu64 ")\n", fragment_id+1);
-  ret_frags = 0;
-  GNUNET_assert (
-    GNUNET_OK == db->fragment_get (db->cls, &channel_pub_key,
-                                   fragment_id+1, fragment_id+1,
-                                   &ret_frags, fragment_cb, &fcls));
-  GNUNET_assert (fcls.n == 1);
-
-  // FIXME: test fragment_get_latest and message_get_latest
-#endif
   LOG (GNUNET_ERROR_TYPE_INFO, "message_get_fragment()\n");
 
   fcls.n = 0;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]