diff options
author | Gabor X Toth <*@tg-x.net> | 2016-10-12 19:58:23 +0000 |
---|---|---|
committer | Gabor X Toth <*@tg-x.net> | 2016-10-12 19:58:23 +0000 |
commit | 9371fa2437cdac5abe624670b528da859a0a0025 (patch) | |
tree | 688213236e3e08baa9899e0af86bdc124785f2af /src/psycstore/plugin_psycstore_postgres.c | |
parent | d6c75f855dad02aeb5e6a4aab5278a2340f70f80 (diff) |
psycstore: postgres fixes
Diffstat (limited to 'src/psycstore/plugin_psycstore_postgres.c')
-rw-r--r-- | src/psycstore/plugin_psycstore_postgres.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/src/psycstore/plugin_psycstore_postgres.c b/src/psycstore/plugin_psycstore_postgres.c index 147e70bd67..5bbb3c4475 100644 --- a/src/psycstore/plugin_psycstore_postgres.c +++ b/src/psycstore/plugin_psycstore_postgres.c @@ -166,8 +166,8 @@ database_setup (struct Plugin *plugin) " 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 @@ fragment_store (void *cls, 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 @@ fragment_store (void *cls, 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 @@ fragment_row (struct Plugin *plugin, 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 @@ fragment_row (struct Plugin *plugin, else { if (GNUNET_OK != GNUNET_PQ_extract_result(res, results, 0)) { - PQclear (res); return GNUNET_SYSERR; } @@ -933,7 +930,6 @@ fragment_row (struct Plugin *plugin, ret = cb (cb_cls, mp, (enum GNUNET_PSYCSTORE_MessageFlags) flags); } - PQclear (res); return ret; } |