[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r37547 - gnunet/src/psycstore
From: |
gnunet |
Subject: |
[GNUnet-SVN] r37547 - gnunet/src/psycstore |
Date: |
Mon, 18 Jul 2016 16:22:58 +0200 |
Author: christophe.genevey
Date: 2016-07-18 16:22:58 +0200 (Mon, 18 Jul 2016)
New Revision: 37547
Modified:
gnunet/src/psycstore/plugin_psycstore_mysql.c
gnunet/src/psycstore/psycstore.conf.in
gnunet/src/psycstore/test_psycstore.conf
Log:
start to fix psycstore mysql
Modified: gnunet/src/psycstore/plugin_psycstore_mysql.c
===================================================================
--- gnunet/src/psycstore/plugin_psycstore_mysql.c 2016-07-17 13:26:36 UTC
(rev 37546)
+++ gnunet/src/psycstore/plugin_psycstore_mysql.c 2016-07-18 14:22:58 UTC
(rev 37547)
@@ -307,6 +307,7 @@
"psycstore-mysql", "FILENAME");
return GNUNET_SYSERR;
}
+ //ERROR
if (GNUNET_OK != GNUNET_DISK_file_test (filename))
{
if (GNUNET_OK != GNUNET_DISK_directory_create_for_file (filename))
@@ -639,6 +640,7 @@
GNUNET_MYSQL_context_destroy (plugin->mc);
GNUNET_free_non_null (plugin->fn);
+
}
@@ -1106,21 +1108,30 @@
uint64_t fragment_offset;
uint64_t message_id;
uint64_t group_generation;
- struct GNUNET_MULTICAST_MessageHeader msg; // to be removed...
void *buf;
size_t buf_size;
int ret;
uint64_t flags;
+ struct GNUNET_MULTICAST_MessageHeader msg;
struct GNUNET_MULTICAST_MessageHeader *mp;
+
+
+ uint32_t hop_counter;
+ void *signature = NULL;
+ void *purpose = NULL;
+ size_t signature_size;
+ size_t purpose_size;
+ uint32_t msg_flags;
+
struct GNUNET_MY_ResultSpec results[] = {
- GNUNET_MY_result_spec_uint32 ((uint32_t *)&msg.hop_counter), // FIXME
- GNUNET_MY_result_spec_auto_from_type (&msg.signature), // FIXME
- GNUNET_MY_result_spec_auto_from_type (&msg.purpose), // FIXME
+ GNUNET_MY_result_spec_uint32 (&hop_counter),
+ GNUNET_MY_result_spec_variable_size (&signature, &signature_size),
+ GNUNET_MY_result_spec_variable_size (&purpose, &purpose_size),
GNUNET_MY_result_spec_uint64 (&fragment_id),
GNUNET_MY_result_spec_uint64 (&fragment_offset),
GNUNET_MY_result_spec_uint64 (&message_id),
GNUNET_MY_result_spec_uint64 (&group_generation),
- GNUNET_MY_result_spec_uint32 (&msg.flags), // FIXME
+ GNUNET_MY_result_spec_uint32 (&msg_flags),
GNUNET_MY_result_spec_uint64 (&flags),
GNUNET_MY_result_spec_variable_size (&buf,
&buf_size),
@@ -1134,16 +1145,26 @@
LOG_MYSQL(plugin,
GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK,
"mysql extract_result",
- GNUNET_MYSQL_statement_get_stmt (stmt));
+ stmt);
return GNUNET_SYSERR;
}
mp = GNUNET_malloc (sizeof (msg) + buf_size);
*mp = msg;
+
+ mp->hop_counter = hop_counter;
+ GNUNET_memcpy (&mp->signature,
+ signature,
+ signature_size);
+ GNUNET_memcpy (&mp->purpose,
+ 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->flags = msg_flags;
+
GNUNET_memcpy (&mp[1],
buf,
buf_size);
Modified: gnunet/src/psycstore/psycstore.conf.in
===================================================================
--- gnunet/src/psycstore/psycstore.conf.in 2016-07-17 13:26:36 UTC (rev
37546)
+++ gnunet/src/psycstore/psycstore.conf.in 2016-07-18 14:22:58 UTC (rev
37547)
@@ -15,3 +15,6 @@
[psycstore-sqlite]
FILENAME = $GNUNET_DATA_HOME/psycstore/sqlite.db
+
+[psycstore-mysql]
+FILENAME = $GNUNET_DATA_HOME/psycstore/mysql.sql
Modified: gnunet/src/psycstore/test_psycstore.conf
===================================================================
--- gnunet/src/psycstore/test_psycstore.conf 2016-07-17 13:26:36 UTC (rev
37546)
+++ gnunet/src/psycstore/test_psycstore.conf 2016-07-18 14:22:58 UTC (rev
37547)
@@ -6,3 +6,6 @@
[psycstore-sqlite]
FILENAME = $GNUNET_TEST_HOME/psycstore/sqlite_test.db
+
+[psycstore-mysql]
+FILENAME = $GNUNET_TEST_HOME/psycstore/mysql_test.sql
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r37547 - gnunet/src/psycstore,
gnunet <=