gnunet-svn
[Top][All Lists]
Advanced

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

[taler-exchange] 01/04: fix logic to ensure that we do not call the call


From: gnunet
Subject: [taler-exchange] 01/04: fix logic to ensure that we do not call the callback after the iteration was aborted (caused big trouble in wirewatcher)
Date: Fri, 20 Mar 2020 13:18:52 +0100

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

grothoff pushed a commit to branch master
in repository exchange.

commit 2021f75995732d760323eca1d1844bc29f0ac976
Author: Christian Grothoff <address@hidden>
AuthorDate: Fri Mar 20 12:34:26 2020 +0100

    fix logic to ensure that we do not call the callback after the iteration 
was aborted (caused big trouble in wirewatcher)
---
 src/bank-lib/bank_api_credit.c | 31 +++++++++++++++++++------------
 src/bank-lib/bank_api_debit.c  | 31 +++++++++++++++++++------------
 2 files changed, 38 insertions(+), 24 deletions(-)

diff --git a/src/bank-lib/bank_api_credit.c b/src/bank-lib/bank_api_credit.c
index 551831d2..4b6f40bb 100644
--- a/src/bank-lib/bank_api_credit.c
+++ b/src/bank-lib/bank_api_credit.c
@@ -113,12 +113,18 @@ parse_account_history (struct 
TALER_BANK_CreditHistoryHandle *hh,
       GNUNET_break_op (0);
       return GNUNET_SYSERR;
     }
-    hh->hcb (hh->hcb_cls,
-             MHD_HTTP_OK,
-             TALER_EC_NONE,
-             row_id,
-             &td,
-             transaction);
+    if (GNUNET_OK !=
+        hh->hcb (hh->hcb_cls,
+                 MHD_HTTP_OK,
+                 TALER_EC_NONE,
+                 row_id,
+                 &td,
+                 transaction))
+    {
+      hh->hcb = NULL;
+      GNUNET_JSON_parse_free (hist_spec);
+      return GNUNET_OK;
+    }
     GNUNET_JSON_parse_free (hist_spec);
   }
   return GNUNET_OK;
@@ -195,12 +201,13 @@ handle_credit_history_finished (void *cls,
     response_code = 0;
     break;
   }
-  hh->hcb (hh->hcb_cls,
-           response_code,
-           ec,
-           0LLU,
-           NULL,
-           j);
+  if (NULL != hh->hcb)
+    hh->hcb (hh->hcb_cls,
+             response_code,
+             ec,
+             0LLU,
+             NULL,
+             j);
   TALER_BANK_credit_history_cancel (hh);
 }
 
diff --git a/src/bank-lib/bank_api_debit.c b/src/bank-lib/bank_api_debit.c
index 1418492e..33ff20ef 100644
--- a/src/bank-lib/bank_api_debit.c
+++ b/src/bank-lib/bank_api_debit.c
@@ -115,12 +115,18 @@ parse_account_history (struct 
TALER_BANK_DebitHistoryHandle *hh,
       GNUNET_break_op (0);
       return GNUNET_SYSERR;
     }
-    hh->hcb (hh->hcb_cls,
-             MHD_HTTP_OK,
-             TALER_EC_NONE,
-             row_id,
-             &td,
-             transaction);
+    if (GNUNET_OK !=
+        hh->hcb (hh->hcb_cls,
+                 MHD_HTTP_OK,
+                 TALER_EC_NONE,
+                 row_id,
+                 &td,
+                 transaction))
+    {
+      hh->hcb = NULL;
+      GNUNET_JSON_parse_free (hist_spec);
+      return GNUNET_OK;
+    }
     GNUNET_JSON_parse_free (hist_spec);
   }
   return GNUNET_OK;
@@ -199,12 +205,13 @@ handle_debit_history_finished (void *cls,
     response_code = 0;
     break;
   }
-  hh->hcb (hh->hcb_cls,
-           response_code,
-           ec,
-           0LLU,
-           NULL,
-           j);
+  if (NULL != hh->hcb)
+    hh->hcb (hh->hcb_cls,
+             response_code,
+             ec,
+             0LLU,
+             NULL,
+             j);
   TALER_BANK_debit_history_cancel (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]