gnunet-svn
[Top][All Lists]
Advanced

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

[taler-anastasis] 02/04: better debugging message


From: gnunet
Subject: [taler-anastasis] 02/04: better debugging message
Date: Tue, 01 Sep 2020 18:47: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 c9556437fc4663ec291371300cdda460813a685b
Author: Dennis Neufeld <dennis.neufeld@students.bfh.ch>
AuthorDate: Tue Sep 1 15:43:40 2020 +0200

    better debugging message
---
 src/backend/anastasis-httpd_policy_upload.c | 14 +++++++--
 src/stasis/plugin_anastasis_postgres.c      | 44 +++++++++++++++++++++--------
 2 files changed, 44 insertions(+), 14 deletions(-)

diff --git a/src/backend/anastasis-httpd_policy_upload.c 
b/src/backend/anastasis-httpd_policy_upload.c
index e12506a..f15b992 100644
--- a/src/backend/anastasis-httpd_policy_upload.c
+++ b/src/backend/anastasis-httpd_policy_upload.c
@@ -796,7 +796,9 @@ AH_handler_policy_post (struct MHD_Connection *connection,
                                            "Anastasis-Policy-Signature does 
not include a base32-encoded EdDSA signature");
       }
       GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                  "Account Signature to save: %s\n",
+                  "At %s:%d Account Signature to save is: %s\n",
+                  __FILE__,
+                  __LINE__,
                   TALER_B2S (&puc->account_sig));
     }
     {
@@ -859,9 +861,12 @@ AH_handler_policy_post (struct MHD_Connection *connection,
                                     sizeof (
                                       struct ANASTASIS_PaymentSecretP));
         GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                    "Payment-Identifier generated: %s\n",
+                    "At %s:%d Payment-Identifier generated is: %s\n",
+                    __FILE__,
+                    __LINE__,
                     TALER_B2S (&puc->payment_identifier));
 
+        /** FIXME: not really reasonable */
         int post_counter = 10;
 
         qs = db->record_payment (db->cls,
@@ -876,6 +881,9 @@ AH_handler_policy_post (struct MHD_Connection *connection,
                                        &puc->payment_identifier,
                                        GNUNET_TIME_UNIT_YEARS);
         }
+        if (qs < 0)
+          return handle_database_error (puc,
+                                        qs);
       }
 
       qs = db->lookup_account (db->cls,
@@ -946,7 +954,7 @@ AH_handler_policy_post (struct MHD_Connection *connection,
     pay_id = MHD_lookup_connection_value (connection,
                                           MHD_HEADER_KIND,
                                           "Payment-Identifier");
-    if ( (NULL != pay_id) &&
+    if ( pay_id &&
          (GNUNET_OK !=
           GNUNET_STRINGS_string_to_data (pay_id,
                                          strlen (pay_id),
diff --git a/src/stasis/plugin_anastasis_postgres.c 
b/src/stasis/plugin_anastasis_postgres.c
index 0fe5831..412b2f4 100644
--- a/src/stasis/plugin_anastasis_postgres.c
+++ b/src/stasis/plugin_anastasis_postgres.c
@@ -426,7 +426,9 @@ postgres_store_recovery_document (void *cls,
   /* get the version for the recoverydocument */
   {
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                "Public key used to query db: %s\n",
+                "At %s:%d Public key used to query db is: %s\n",
+                __FILE__,
+                __LINE__,
                 TALER_B2S (anastasis_pub));
 
     struct GNUNET_PQ_QueryParam params[] = {
@@ -467,7 +469,9 @@ 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",
+                "At %s:%d Public key used to query db is: %s\n",
+                __FILE__,
+                __LINE__,
                 TALER_B2S (anastasis_pub));
 
     struct GNUNET_PQ_QueryParam params[] = {
@@ -502,7 +506,9 @@ postgres_store_recovery_document (void *cls,
 
   // lookup if the user has enough uploads left and decrement
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-              "Payment-Identifier to query db: %s\n",
+              "At %s:%d Payment-Identifier used to query db is: %s\n",
+              __FILE__,
+              __LINE__,
               TALER_B2S (payment_secret));
   {
     struct GNUNET_PQ_QueryParam params[] = {
@@ -536,7 +542,9 @@ postgres_store_recovery_document (void *cls,
     return ANASTASIS_DB_STATUS_HARD_ERROR;
   case ANASTASIS_DB_STATUS_SUCCESS_ONE_RESULT:
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                "Post counter from db: %i\n",
+                "At %s:%d Post counter from db is: %u\n",
+                __FILE__,
+                __LINE__,
                 postcounter);
     break;
   default:
@@ -589,7 +597,9 @@ 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",
+                "At %s:%d Public key used to query db is: %s\n",
+                __FILE__,
+                __LINE__,
                 TALER_B2S (anastasis_pub));
 
     struct GNUNET_PQ_QueryParam params[] = {
@@ -717,7 +727,9 @@ postgres_increment_lifetime (void *cls,
 
   {
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                "Public key used to query db: %s\n",
+                "At %s:%d Public key used to query db is: %s\n",
+                __FILE__,
+                __LINE__,
                 TALER_B2S (anastasis_pub));
 
     struct GNUNET_PQ_QueryParam params[] = {
@@ -748,7 +760,9 @@ postgres_increment_lifetime (void *cls,
     {
       // user does not exist, create new one
       GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                  "Public key to be saved to user db: %s\n",
+                  "At %s:%d Public key to be saved to user db is: %s\n",
+                  __FILE__,
+                  __LINE__,
                   TALER_B2S (anastasis_pub));
 
       struct GNUNET_PQ_QueryParam params[] = {
@@ -842,7 +856,9 @@ postgres_record_payment (void *cls,
                          const struct TALER_Amount *amount)
 {
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-              "Post counter to save: %i\n",
+              "At %s:%d Post counter to save is: %u\n",
+              __FILE__,
+              __LINE__,
               post_counter);
 
   struct PostgresClosure *pg = cls;
@@ -865,7 +881,9 @@ postgres_record_payment (void *cls,
   // if user exists, otherwise we have to create one
   {
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                "Public key used to query user db: %s\n",
+                "At %s:%d Public key used to query user db is: %s\n",
+                __FILE__,
+                __LINE__,
                 TALER_B2S (anastasis_pub));
 
     struct GNUNET_PQ_QueryParam params[] = {
@@ -895,7 +913,9 @@ postgres_record_payment (void *cls,
     {
       // create new user
       GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                  "Public key to be saved to user db: %s\n",
+                  "At %s:%d Public key to be saved to user db is: %s\n",
+                  __FILE__,
+                  __LINE__,
                   TALER_B2S (anastasis_pub));
 
       struct GNUNET_PQ_QueryParam params[] = {
@@ -1138,7 +1158,9 @@ postgres_lookup_account (void *cls,
                          struct GNUNET_HashCode *recovery_data_hash)
 {
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-              "Public key used to query db: %s\n",
+              "At %s:%d Public key used to query db is: %s\n",
+              __FILE__,
+              __LINE__,
               TALER_B2S (anastasis_pub));
 
   struct PostgresClosure *pg = cls;

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

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