gnunet-svn
[Top][All Lists]
Advanced

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

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


From: gnunet
Subject: [GNUnet-SVN] r37600 - gnunet/src/psycstore
Date: Thu, 28 Jul 2016 15:18:20 +0200

Author: christophe.genevey
Date: 2016-07-28 15:18:20 +0200 (Thu, 28 Jul 2016)
New Revision: 37600

Modified:
   gnunet/src/psycstore/plugin_psycstore_mysql.c
Log:
fix fragment_store function

Modified: gnunet/src/psycstore/plugin_psycstore_mysql.c
===================================================================
--- gnunet/src/psycstore/plugin_psycstore_mysql.c       2016-07-28 13:05:33 UTC 
(rev 37599)
+++ gnunet/src/psycstore/plugin_psycstore_mysql.c       2016-07-28 13:18:20 UTC 
(rev 37600)
@@ -956,6 +956,9 @@
   uint64_t message_id = GNUNET_ntohll (msg->message_id);
   uint64_t group_generation = GNUNET_ntohll (msg->group_generation);
 
+  uint64_t hop_counter = ntohl(msg->hop_counter);
+  uint64_t flags = ntohl(msg->flags);
+
   if (fragment_id > INT64_MAX || fragment_offset > INT64_MAX ||
       message_id > INT64_MAX || group_generation > INT64_MAX)
   {
@@ -972,16 +975,19 @@
 
   struct GNUNET_MY_QueryParam params_insert[] = {
     GNUNET_MY_query_param_auto_from_type (channel_key),
-    GNUNET_MY_query_param_uint32 ((const uint32_t *) &msg->hop_counter),
+    GNUNET_MY_query_param_uint64 (&hop_counter),
     GNUNET_MY_query_param_auto_from_type (&msg->signature),
     GNUNET_MY_query_param_auto_from_type (&msg->purpose),
+    //GNUNET_MY_query_param_fixed_size (&msg->signature, sizeof 
(msg->signature)),
+    //GNUNET_MY_query_param_fixed_size (&msg->purpose, sizeof (msg->purpose)),
     GNUNET_MY_query_param_uint64 (&fragment_id),
     GNUNET_MY_query_param_uint64 (&fragment_offset),
     GNUNET_MY_query_param_uint64 (&message_id),
     GNUNET_MY_query_param_uint64 (&group_generation),
-    GNUNET_MY_query_param_uint32 ( (const uint32_t *) &msg->flags),
+    GNUNET_MY_query_param_uint64 (&flags),
     GNUNET_MY_query_param_uint32 (&psycstore_flags),
-    GNUNET_MY_query_param_auto_from_type (&msg[1]),
+    GNUNET_MY_query_param_fixed_size (&msg[1], ntohs (msg->header.size)
+                                                  - sizeof (*msg)),
     GNUNET_MY_query_param_end
   };
 
@@ -1112,9 +1118,9 @@
                     purpose,
                     purpose_size);
       mp->fragment_id = GNUNET_htonll (fragment_id);
-      mp->fragment_offset = GNUNET_htonllk (fragment_offset);
-      mp->message_id = GNUNET_htonllk (message_id);
-      mp->group_generation = GNUNET_htonllk (group_generation);
+      mp->fragment_offset = GNUNET_htonll (fragment_offset);
+      mp->message_id = GNUNET_htonll (message_id);
+      mp->group_generation = GNUNET_htonll (group_generation);
       mp->flags = msg_flags;
 
       GNUNET_memcpy (&mp[1],




reply via email to

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