gnunet-svn
[Top][All Lists]
Advanced

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

[taler-anastasis] 03/05: fixed loop


From: gnunet
Subject: [taler-anastasis] 03/05: fixed loop
Date: Tue, 07 Apr 2020 01:02:15 +0200

This is an automated email from the git hooks/post-receive script.

dennis-neufeld pushed a commit to branch master
in repository anastasis.

commit 220fab19fcd655126309a15505d9c606ee9f3ae5
Author: Dennis Neufeld <address@hidden>
AuthorDate: Mon Apr 6 21:50:57 2020 +0000

    fixed loop
---
 src/backend/anastasis-httpd_policy_upload.c | 12 +++++----
 src/stasis/plugin_anastasis_postgres.c      | 42 +++++++++++++++++++++++++----
 2 files changed, 44 insertions(+), 10 deletions(-)

diff --git a/src/backend/anastasis-httpd_policy_upload.c 
b/src/backend/anastasis-httpd_policy_upload.c
index 81ffe97..9484154 100644
--- a/src/backend/anastasis-httpd_policy_upload.c
+++ b/src/backend/anastasis-httpd_policy_upload.c
@@ -912,9 +912,9 @@ AH_handler_policy_post (struct MHD_Connection *connection,
     *recovery_data_size = 0;
     return MHD_YES;
   }
-  else if ( (0 == puc->upload_off) &&
-            (0 != puc->upload_size) &&
-            (NULL == puc->resp) )
+  if ( (0 == puc->upload_off) &&
+       (0 != puc->upload_size) &&
+       (NULL == puc->resp) )
   {
     /* wait for upload */
     return MHD_YES;
@@ -966,14 +966,16 @@ AH_handler_policy_post (struct MHD_Connection *connection,
     GNUNET_log (GNUNET_ERROR_TYPE_INFO,
                 "Uploading recovery document\n");
     qs = db->store_recovery_document (db->cls,
-                                      &accountPubP,
+                                      &puc->account,
                                       &puc->account_sig,
                                       &puc->new_policy_upload_hash,
                                       puc->upload,
                                       puc->upload_size,
                                       &puc->payment_identifier,
                                       &version);
-
+    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+                "DB status after uploading recovery document: %i\n",
+                qs);
     if (qs < 0)
       return handle_database_error (puc,
                                     qs);
diff --git a/src/stasis/plugin_anastasis_postgres.c 
b/src/stasis/plugin_anastasis_postgres.c
index e975316..16ca41c 100644
--- a/src/stasis/plugin_anastasis_postgres.c
+++ b/src/stasis/plugin_anastasis_postgres.c
@@ -425,6 +425,10 @@ postgres_store_recovery_document (void *cls,
   postgres_preflight (pg);
   /* get the version for the recoverydocument */
   {
+    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+                "Public key used to query db: %s\n",
+                TALER_B2S (anastasis_pub));
+
     struct GNUNET_PQ_QueryParam params[] = {
       GNUNET_PQ_query_param_auto_from_type (anastasis_pub),
       GNUNET_PQ_query_param_end
@@ -462,6 +466,10 @@ postgres_store_recovery_document (void *cls,
 
   /* First, check if account exists */
   {
+    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+                "Public key used to query db: %s\n",
+                TALER_B2S (anastasis_pub));
+
     struct GNUNET_TIME_Absolute ed;
     struct GNUNET_PQ_QueryParam params[] = {
       GNUNET_PQ_query_param_auto_from_type (anastasis_pub),
@@ -503,7 +511,7 @@ postgres_store_recovery_document (void *cls,
       GNUNET_PQ_query_param_end
     };
     struct GNUNET_PQ_ResultSpec rs[] = {
-      GNUNET_PQ_result_spec_uint32 ("post_counter", &postcounter),
+      GNUNET_PQ_result_spec_auto_from_type ("post_counter", &postcounter),
       GNUNET_PQ_result_spec_end
     };
 
@@ -576,6 +584,10 @@ postgres_store_recovery_document (void *cls,
 
   /* check if existing recovery_data conflicts */
   {
+    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+                "Public key used to query db: %s\n",
+                TALER_B2S (anastasis_pub));
+
     struct GNUNET_PQ_QueryParam params[] = {
       GNUNET_PQ_query_param_auto_from_type (anastasis_pub),
       GNUNET_PQ_query_param_end
@@ -700,13 +712,17 @@ postgres_increment_lifetime (void *cls,
   }
 
   {
+    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+                "Public key used to query db: %s\n",
+                TALER_B2S (anastasis_pub));
+
     struct GNUNET_PQ_QueryParam params[] = {
       GNUNET_PQ_query_param_auto_from_type (anastasis_pub),
       GNUNET_PQ_query_param_end
     };
     struct GNUNET_PQ_ResultSpec rs[] = {
-      GNUNET_PQ_result_spec_absolute_time ("expiration_date",
-                                           &expiration),
+      GNUNET_PQ_result_spec_auto_from_type ("expiration_date",
+                                            &expiration),
       GNUNET_PQ_result_spec_end
     };
 
@@ -727,6 +743,10 @@ postgres_increment_lifetime (void *cls,
   case GNUNET_DB_STATUS_SUCCESS_NO_RESULTS:
     {
       // user does not exist, create new one
+      GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+                  "Public key to be saved to user db: %s\n",
+                  TALER_B2S (anastasis_pub));
+
       struct GNUNET_PQ_QueryParam params[] = {
         GNUNET_PQ_query_param_auto_from_type (anastasis_pub),
         GNUNET_PQ_query_param_absolute_time (&expiration),
@@ -836,13 +856,17 @@ postgres_record_payment (void *cls,
   // because of constraint at user_id, first we have to verify
   // if user exists, otherwise we have to create one
   {
+    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+                "Public key used to query db: %s\n",
+                TALER_B2S (anastasis_pub));
+
     struct GNUNET_PQ_QueryParam params[] = {
       GNUNET_PQ_query_param_auto_from_type (anastasis_pub),
       GNUNET_PQ_query_param_end
     };
     struct GNUNET_PQ_ResultSpec rs[] = {
-      GNUNET_PQ_result_spec_absolute_time ("expiration_date",
-                                           &expiration),
+      GNUNET_PQ_result_spec_auto_from_type ("expiration_date",
+                                            &expiration),
       GNUNET_PQ_result_spec_end
     };
 
@@ -862,6 +886,10 @@ postgres_record_payment (void *cls,
   case GNUNET_DB_STATUS_SUCCESS_NO_RESULTS:
     {
       // create new user
+      GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+                  "Public key to be saved to user db: %s\n",
+                  TALER_B2S (anastasis_pub));
+
       struct GNUNET_PQ_QueryParam params[] = {
         GNUNET_PQ_query_param_auto_from_type (anastasis_pub),
         GNUNET_PQ_query_param_absolute_time (&now),
@@ -1111,6 +1139,10 @@ postgres_lookup_account (void *cls,
                          ANASTASIS_CRYPTO_AccountPublicKey *anastasis_pub,
                          struct GNUNET_HashCode *recovery_data_hash)
 {
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+              "Public key used to query db: %s\n",
+              TALER_B2S (anastasis_pub));
+
   struct PostgresClosure *pg = cls;
   enum ANASTASIS_DB_QueryStatus qs;
   struct GNUNET_PQ_QueryParam params[] = {

-- 
To stop receiving notification emails like this one, please contact
address@hidden.



reply via email to

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