gnunet-svn
[Top][All Lists]
Advanced

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

[taler-merchant] branch master updated: adapt to exchange API change


From: gnunet
Subject: [taler-merchant] branch master updated: adapt to exchange API change
Date: Thu, 22 Jun 2023 22:10:47 +0200

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

grothoff pushed a commit to branch master
in repository merchant.

The following commit(s) were added to refs/heads/master by this push:
     new bb0967ea adapt to exchange API change
bb0967ea is described below

commit bb0967ea0f5d501079981ea33f21f4c133815234
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Thu Jun 22 22:10:45 2023 +0200

    adapt to exchange API change
---
 src/backend/taler-merchant-httpd.h            |  5 +++
 src/backend/taler-merchant-httpd_exchanges.c  |  5 ++-
 src/backend/taler-merchant-httpd_reserves.c   | 57 +++------------------------
 src/merchant-tools/taler-merchant-benchmark.c |  6 +--
 4 files changed, 17 insertions(+), 56 deletions(-)

diff --git a/src/backend/taler-merchant-httpd.h 
b/src/backend/taler-merchant-httpd.h
index 46bbcb5b..732c1bf3 100644
--- a/src/backend/taler-merchant-httpd.h
+++ b/src/backend/taler-merchant-httpd.h
@@ -636,6 +636,11 @@ extern char *TMH_currency;
  */
 extern int TMH_force_audit;
 
+/**
+ * Context for all CURL operations (useful to the event loop)
+ */
+extern struct GNUNET_CURL_Context *merchant_curl_ctx;
+
 /**
  * Handle to the database backend.
  */
diff --git a/src/backend/taler-merchant-httpd_exchanges.c 
b/src/backend/taler-merchant-httpd_exchanges.c
index ddbc0dee..090cef95 100644
--- a/src/backend/taler-merchant-httpd_exchanges.c
+++ b/src/backend/taler-merchant-httpd_exchanges.c
@@ -334,9 +334,10 @@ struct TMH_Exchange
 
 
 /**
- * Context for all exchange operations (useful to the event loop)
+ * Context for all exchange operations (useful to the event loop).
+ * FIXME: rename, move to taler-merchant-httpd.c
  */
-static struct GNUNET_CURL_Context *merchant_curl_ctx;
+struct GNUNET_CURL_Context *merchant_curl_ctx;
 
 /**
  * Context for integrating #merchant_curl_ctx with the
diff --git a/src/backend/taler-merchant-httpd_reserves.c 
b/src/backend/taler-merchant-httpd_reserves.c
index 3d11a954..83b70010 100644
--- a/src/backend/taler-merchant-httpd_reserves.c
+++ b/src/backend/taler-merchant-httpd_reserves.c
@@ -70,11 +70,6 @@ struct Reserve
    */
   char *instance_id;
 
-  /**
-   * Active find operation for this reserve.
-   */
-  struct TMH_EXCHANGES_FindOperation *fo;
-
   /**
    * Task scheduled waiting for a timeout for this reserve.
    */
@@ -124,11 +119,6 @@ free_reserve (struct Reserve *r)
   GNUNET_CONTAINER_DLL_remove (reserves_head,
                                reserves_tail,
                                r);
-  if (NULL != r->fo)
-  {
-    TMH_EXCHANGES_find_exchange_cancel (r->fo);
-    r->fo = NULL;
-  }
   if (NULL != r->gh)
   {
     TALER_EXCHANGE_reserves_get_cancel (r->gh);
@@ -225,43 +215,6 @@ reserve_cb (void *cls,
 }
 
 
-/**
- * Function called with the result of a #TMH_EXCHANGES_find_exchange()
- * operation.
- *
- * @param cls closure
- * @param hr HTTP response details
- * @param eh handle to the exchange context
- * @param ih internal handle to the exchange
- */
-static void
-find_cb (void *cls,
-         const struct TALER_EXCHANGE_HttpResponse *hr,
-         struct TALER_EXCHANGE_Handle *eh,
-         struct TMH_Exchange *ih)
-{
-  struct Reserve *r = cls;
-
-  (void) ih;
-  r->fo = NULL;
-  if (NULL == eh)
-  {
-    try_later (r);
-    return;
-  }
-  r->gh = TALER_EXCHANGE_reserves_get (eh,
-                                       &r->reserve_pub,
-                                       LONGPOLL_DELAY,
-                                       &reserve_cb,
-                                       r);
-  if (NULL == r->gh)
-  {
-    try_later (r);
-    return;
-  }
-}
-
-
 /**
  * Function called to probe a reserve now.
  *
@@ -273,11 +226,13 @@ try_now (void *cls)
   struct Reserve *r = cls;
 
   r->tt = NULL;
-  r->fo = TMH_EXCHANGES_find_exchange (r->exchange_url,
-                                       false,
-                                       &find_cb,
+  r->gh = TALER_EXCHANGE_reserves_get (merchant_curl_ctx,
+                                       r->exchange_url,
+                                       &r->reserve_pub,
+                                       LONGPOLL_DELAY,
+                                       &reserve_cb,
                                        r);
-  if (NULL == r->fo)
+  if (NULL == r->gh)
   {
     try_later (r);
     return;
diff --git a/src/merchant-tools/taler-merchant-benchmark.c 
b/src/merchant-tools/taler-merchant-benchmark.c
index d60cfeed..b1b907ab 100644
--- a/src/merchant-tools/taler-merchant-benchmark.c
+++ b/src/merchant-tools/taler-merchant-benchmark.c
@@ -604,9 +604,9 @@ main (int argc,
   {
     int result;
 
-    result = TALER_TESTING_setup_with_exchange (&run,
-                                                NULL,
-                                                cfg_filename);
+    result = TALER_TESTING_xxx (&run,
+                                NULL,
+                                cfg_filename);
     terminate_process (merchantd);
     terminate_process (bankd);
     return (GNUNET_OK == result) ? 0 : PG_RUNTIME_FAILURE;

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