gnunet-svn
[Top][All Lists]
Advanced

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

[taler-anastasis] branch master updated: errors and warnings


From: gnunet
Subject: [taler-anastasis] branch master updated: errors and warnings
Date: Mon, 23 Nov 2020 14:55:36 +0100

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

ds-meister pushed a commit to branch master
in repository anastasis.

The following commit(s) were added to refs/heads/master by this push:
     new 31c7b94  errors and warnings
31c7b94 is described below

commit 31c7b9425a9d47b0d04cd19a39f572ef2e7cc6b8
Author: Dominik Meister <dominik.meister@hotmail.ch>
AuthorDate: Mon Nov 23 14:55:27 2020 +0100

    errors and warnings
---
 src/backend/anastasis-httpd_policy_upload.c       |  7 +++++++
 src/backend/anastasis-httpd_truth.c               |  9 +++++++--
 src/backend/anastasis_authorization_plugin_file.c |  1 -
 src/lib/anastasis.c                               |  8 --------
 src/lib/testing_api_cmd_challenge_run.c           | 12 +++++++++++-
 5 files changed, 25 insertions(+), 12 deletions(-)

diff --git a/src/backend/anastasis-httpd_policy_upload.c 
b/src/backend/anastasis-httpd_policy_upload.c
index 7be4a87..f90e60d 100644
--- a/src/backend/anastasis-httpd_policy_upload.c
+++ b/src/backend/anastasis-httpd_policy_upload.c
@@ -641,6 +641,13 @@ handle_database_error (struct PolicyUploadContext *puc,
   case ANASTASIS_DB_STATUS_SUCCESS_ONE_RESULT:
     GNUNET_assert (0);
     return MHD_NO;
+  /*Should never happen*/
+  default:
+    GNUNET_break (0);
+    return TALER_MHD_reply_with_error (puc->con,
+                                       MHD_HTTP_INTERNAL_SERVER_ERROR,
+                                       TALER_EC_GENERIC_DB_FETCH_FAILED,
+                                       NULL);
   }
   GNUNET_break (0);
   return MHD_NO;
diff --git a/src/backend/anastasis-httpd_truth.c 
b/src/backend/anastasis-httpd_truth.c
index 3c72e33..bfd0e5b 100644
--- a/src/backend/anastasis-httpd_truth.c
+++ b/src/backend/anastasis-httpd_truth.c
@@ -598,6 +598,13 @@ handle_database_error (struct GetContext *gc,
   case ANASTASIS_DB_STATUS_SUCCESS_ONE_RESULT:
     GNUNET_assert (0);
     return MHD_NO;
+  /*Should never happen*/
+  default:
+    GNUNET_break (0);
+    return TALER_MHD_reply_with_error (gc->connection,
+                                       MHD_HTTP_INTERNAL_SERVER_ERROR,
+                                       TALER_EC_GENERIC_DB_FETCH_FAILED,
+                                       NULL);
   }
   GNUNET_break (0);
   return MHD_NO;
@@ -819,12 +826,10 @@ AH_handler_truth_get (struct MHD_Connection *connection,
       zero_cost = true;
   }
 
-
   /* Check database to see if the transaction is permissible */
 
   if (! zero_cost)
   {
-    struct GNUNET_HashCode hc;
     enum ANASTASIS_DB_QueryStatus qs;
 
     if (0 == strcmp ("question",
diff --git a/src/backend/anastasis_authorization_plugin_file.c 
b/src/backend/anastasis_authorization_plugin_file.c
index bd81c67..3e0e485 100644
--- a/src/backend/anastasis_authorization_plugin_file.c
+++ b/src/backend/anastasis_authorization_plugin_file.c
@@ -226,7 +226,6 @@ file_cleanup (struct ANASTASIS_AUTHORIZATION_State *as)
 void *
 libanastasis_plugin_authorization_file_init (void *cls)
 {
-  struct GNUNET_CONFIGURATION_Handle *cfg = cls;
   struct ANASTASIS_AuthorizationPlugin *plugin;
 
   plugin = GNUNET_new (struct ANASTASIS_AuthorizationPlugin);
diff --git a/src/lib/anastasis.c b/src/lib/anastasis.c
index f107fb0..9484d6f 100644
--- a/src/lib/anastasis.c
+++ b/src/lib/anastasis.c
@@ -576,8 +576,6 @@ policy_lookup_cb (void *cls,
     return;
   }
   json_decref (recovery_document);
-  GNUNET_JSON_parse_free (spec);
-
   r->ri->cs_len = json_array_size (esc_methods);
   r->ri->dps_len = json_array_size (dec_policies);
   r->ri->dps = GNUNET_new_array (r->ri->dps_len,
@@ -595,11 +593,9 @@ policy_lookup_cb (void *cls,
   struct ANASTASIS_Challenge **cs = GNUNET_new_array (r->ri->cs_len,
                                                       struct 
ANASTASIS_Challenge
                                                       *);
-
   for (unsigned int i = 0; i < r->ri->cs_len; i++)
   {
     cs[i] = GNUNET_new (struct ANASTASIS_Challenge);
-
     struct GNUNET_JSON_Specification spec[] = {
       GNUNET_JSON_spec_fixed_auto ("nonce",
                                    &cs[i]->nonce),
@@ -615,7 +611,6 @@ policy_lookup_cb (void *cls,
                                &cs[i]->escrow_method),
       GNUNET_JSON_spec_end ()
     };
-
     if (GNUNET_OK !=
         GNUNET_JSON_parse (json_array_get (esc_methods, i),
                            spec,
@@ -626,11 +621,9 @@ policy_lookup_cb (void *cls,
       ANASTASIS_recovery_abort (r);
       return;
     }
-
     ANASTASIS_CRYPTO_truth_public_key_derive (&cs[i]->nonce,
                                               &cs[i]->truth_public_key);
     cs[i]->recovery = r;
-
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                 "At %s:%d challenge public key is %s-%llu b\n", __FILE__,
                 __LINE__,
@@ -715,7 +708,6 @@ policy_lookup_cb (void *cls,
   }
   r->solved_challenge_pos = 0;
   r->ri->cs = cs;
-
   // SETUP POLICY CALLBACK
   if (NULL != r->pc)
   {
diff --git a/src/lib/testing_api_cmd_challenge_run.c 
b/src/lib/testing_api_cmd_challenge_run.c
index d673233..f6bd0ce 100644
--- a/src/lib/testing_api_cmd_challenge_run.c
+++ b/src/lib/testing_api_cmd_challenge_run.c
@@ -182,7 +182,17 @@ challenge_run_cb (void *cls,
     TALER_TESTING_interpreter_fail (crs->is);
     return;
   }
-  fscanf (file, "%s", crs->code);
+  if (0 == fscanf (file, "%s", crs->code))
+  {
+    GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+                "could not read file: %s to command %s in %s:%u\n",
+                response_string,
+                crs->is->commands[crs->is->ip].label,
+                __FILE__,
+                __LINE__);
+    TALER_TESTING_interpreter_fail (crs->is);
+    return;
+  }
 
   TALER_TESTING_interpreter_next (crs->is);
 }

-- 
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]