diff options
Diffstat (limited to 'src/psycstore/plugin_psycstore_postgres.c')
-rw-r--r-- | src/psycstore/plugin_psycstore_postgres.c | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/src/psycstore/plugin_psycstore_postgres.c b/src/psycstore/plugin_psycstore_postgres.c index b8010af0a..046daf6ea 100644 --- a/src/psycstore/plugin_psycstore_postgres.c +++ b/src/psycstore/plugin_psycstore_postgres.c | |||
@@ -465,8 +465,10 @@ channel_key_store (struct Plugin *plugin, | |||
465 | GNUNET_PQ_query_param_end | 465 | GNUNET_PQ_query_param_end |
466 | }; | 466 | }; |
467 | 467 | ||
468 | if (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS != | 468 | if (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT != |
469 | GNUNET_PQ_eval_prepared_non_select (plugin->dbh, "insert_channel_key", params)) | 469 | GNUNET_PQ_eval_prepared_non_select (plugin->dbh, |
470 | "insert_channel_key", | ||
471 | params)) | ||
470 | return GNUNET_SYSERR; | 472 | return GNUNET_SYSERR; |
471 | 473 | ||
472 | return GNUNET_OK; | 474 | return GNUNET_OK; |
@@ -482,7 +484,7 @@ slave_key_store (struct Plugin *plugin, | |||
482 | GNUNET_PQ_query_param_end | 484 | GNUNET_PQ_query_param_end |
483 | }; | 485 | }; |
484 | 486 | ||
485 | if (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS != | 487 | if (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT != |
486 | GNUNET_PQ_eval_prepared_non_select (plugin->dbh, "insert_slave_key", params)) | 488 | GNUNET_PQ_eval_prepared_non_select (plugin->dbh, "insert_slave_key", params)) |
487 | return GNUNET_SYSERR; | 489 | return GNUNET_SYSERR; |
488 | 490 | ||
@@ -508,21 +510,22 @@ postgres_membership_store (void *cls, | |||
508 | uint64_t group_generation) | 510 | uint64_t group_generation) |
509 | { | 511 | { |
510 | struct Plugin *plugin = cls; | 512 | struct Plugin *plugin = cls; |
511 | 513 | uint32_t idid_join = (uint32_t) did_join; | |
512 | uint32_t idid_join = (uint32_t)did_join; | ||
513 | 514 | ||
514 | GNUNET_assert (TRANSACTION_NONE == plugin->transaction); | 515 | GNUNET_assert (TRANSACTION_NONE == plugin->transaction); |
515 | 516 | ||
516 | if (announced_at > INT64_MAX || | 517 | if ( (announced_at > INT64_MAX) || |
517 | effective_since > INT64_MAX || | 518 | (effective_since > INT64_MAX) || |
518 | group_generation > INT64_MAX) | 519 | (group_generation > INT64_MAX) ) |
519 | { | 520 | { |
520 | GNUNET_break (0); | 521 | GNUNET_break (0); |
521 | return GNUNET_SYSERR; | 522 | return GNUNET_SYSERR; |
522 | } | 523 | } |
523 | 524 | ||
524 | if (GNUNET_OK != channel_key_store (plugin, channel_key) | 525 | if ( (GNUNET_OK != |
525 | || GNUNET_OK != slave_key_store (plugin, slave_key)) | 526 | channel_key_store (plugin, channel_key)) || |
527 | (GNUNET_OK != | ||
528 | slave_key_store (plugin, slave_key)) ) | ||
526 | return GNUNET_SYSERR; | 529 | return GNUNET_SYSERR; |
527 | 530 | ||
528 | struct GNUNET_PQ_QueryParam params[] = { | 531 | struct GNUNET_PQ_QueryParam params[] = { |
@@ -535,8 +538,10 @@ postgres_membership_store (void *cls, | |||
535 | GNUNET_PQ_query_param_end | 538 | GNUNET_PQ_query_param_end |
536 | }; | 539 | }; |
537 | 540 | ||
538 | if (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS != | 541 | if (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT != |
539 | GNUNET_PQ_eval_prepared_non_select (plugin->dbh, "insert_membership", params)) | 542 | GNUNET_PQ_eval_prepared_non_select (plugin->dbh, |
543 | "insert_membership", | ||
544 | params)) | ||
540 | return GNUNET_SYSERR; | 545 | return GNUNET_SYSERR; |
541 | 546 | ||
542 | return GNUNET_OK; | 547 | return GNUNET_OK; |