gnunet-svn
[Top][All Lists]
Advanced

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

[taler-exchange] branch master updated: better naming, comments and more


From: gnunet
Subject: [taler-exchange] branch master updated: better naming, comments and more logging for incoming history
Date: Wed, 22 Jan 2020 13:53:37 +0100

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

dold pushed a commit to branch master
in repository exchange.

The following commit(s) were added to refs/heads/master by this push:
     new 0fe82acc better naming, comments and more logging for incoming history
0fe82acc is described below

commit 0fe82acc1b7a57d53903624a5789ca83dfae2b45
Author: Florian Dold <address@hidden>
AuthorDate: Wed Jan 22 13:53:11 2020 +0100

    better naming, comments and more logging for incoming history
---
 src/bank-lib/bank_api_credit.c | 22 +++++++++++++---------
 1 file changed, 13 insertions(+), 9 deletions(-)

diff --git a/src/bank-lib/bank_api_credit.c b/src/bank-lib/bank_api_credit.c
index a99b34e2..50725a4e 100644
--- a/src/bank-lib/bank_api_credit.c
+++ b/src/bank-lib/bank_api_credit.c
@@ -132,16 +132,16 @@ parse_account_history (struct 
TALER_BANK_CreditHistoryHandle *hh,
 
 /**
  * Function called when we're done processing the
- * HTTP /history request.
+ * HTTP /history/incoming request.
  *
  * @param cls the `struct TALER_BANK_CreditHistoryHandle`
  * @param response_code HTTP response code, 0 on error
  * @param response parsed JSON result, NULL on error
  */
 static void
-handle_history_finished (void *cls,
-                         long response_code,
-                         const void *response)
+handle_credit_history_finished (void *cls,
+                                long response_code,
+                                const void *response)
 {
   struct TALER_BANK_CreditHistoryHandle *hh = cls;
   enum TALER_ErrorCode ec;
@@ -167,32 +167,36 @@ handle_history_finished (void *cls,
     response_code = MHD_HTTP_NO_CONTENT; /* signal end of list */
     ec = TALER_EC_NONE;
     break;
-  case MHD_HTTP_NO_CONTENT:
-    ec = TALER_EC_NONE;
-    break;
   case MHD_HTTP_BAD_REQUEST:
     /* This should never happen, either us or the bank is buggy
        (or API version conflict); just pass JSON reply to the application */
+    GNUNET_break_op (0);
     ec = TALER_JSON_get_error_code (j);
     break;
   case MHD_HTTP_FORBIDDEN:
     /* Access denied */
+    GNUNET_break_op (0);
     ec = TALER_JSON_get_error_code (j);
     break;
   case MHD_HTTP_UNAUTHORIZED:
+    /* FIXME(dold): I don't get this comment below.  What signatures would the
+       bank even verify?! */
     /* Nothing really to verify, bank says one of the signatures is
        invalid; as we checked them, this should never happen, we
        should pass the JSON reply to the application */
+    GNUNET_break_op (0);
     ec = TALER_JSON_get_error_code (j);
     break;
   case MHD_HTTP_NOT_FOUND:
     /* Nothing really to verify, this should never
        happen, we should pass the JSON reply to the application */
+    GNUNET_break_op (0);
     ec = TALER_JSON_get_error_code (j);
     break;
   case MHD_HTTP_INTERNAL_SERVER_ERROR:
     /* Server had an internal issue; we should retry, but this API
        leaves this to the application */
+    GNUNET_break_op (0);
     ec = TALER_JSON_get_error_code (j);
     break;
   default:
@@ -200,7 +204,7 @@ handle_history_finished (void *cls,
     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
                 "Unexpected response code %u\n",
                 (unsigned int) response_code);
-    GNUNET_break (0);
+    GNUNET_break_op (0);
     ec = TALER_JSON_get_error_code (j);
     response_code = 0;
     break;
@@ -297,7 +301,7 @@ TALER_BANK_credit_history (struct GNUNET_CURL_Context *ctx,
   hh->job = GNUNET_CURL_job_add2 (ctx,
                                   eh,
                                   NULL,
-                                  &handle_history_finished,
+                                  &handle_credit_history_finished,
                                   hh);
   return hh;
 }

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



reply via email to

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