gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [taler-merchant] branch master updated: support VC checks (


From: gnunet
Subject: [GNUnet-SVN] [taler-merchant] branch master updated: support VC checks (#5035)
Date: Sat, 01 Jul 2017 14:18:36 +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 aa83a91  support VC checks (#5035)
aa83a91 is described below

commit aa83a9187873339c97177da77f9cd84f30f678f0
Author: Christian Grothoff <address@hidden>
AuthorDate: Sat Jul 1 14:18:25 2017 +0200

    support VC checks (#5035)
---
 src/backend/taler-merchant-httpd_exchanges.c       | 29 ++++++++++++++++++++--
 .../taler-merchant-generate-payments.c             |  4 ++-
 2 files changed, 30 insertions(+), 3 deletions(-)

diff --git a/src/backend/taler-merchant-httpd_exchanges.c 
b/src/backend/taler-merchant-httpd_exchanges.c
index ea84e6b..a0d3202 100644
--- a/src/backend/taler-merchant-httpd_exchanges.c
+++ b/src/backend/taler-merchant-httpd_exchanges.c
@@ -255,10 +255,12 @@ json_t *trusted_exchanges;
  *   in order to get the "good" keys.
  * @param keys information about the various keys used
  *        by the exchange
+ * @param compat version compatibility data
  */
 static void
 keys_mgmt_cb (void *cls,
-              const struct TALER_EXCHANGE_Keys *keys);
+              const struct TALER_EXCHANGE_Keys *keys,
+             enum TALER_EXCHANGE_VersionCompatibility compat);
 
 
 /**
@@ -589,10 +591,12 @@ wire_task_cb (void *cls)
  *   in order to get the "good" keys.
  * @param keys information about the various keys used
  *        by the exchange
+ * @param compat version compatibility data
  */
 static void
 keys_mgmt_cb (void *cls,
-              const struct TALER_EXCHANGE_Keys *keys)
+              const struct TALER_EXCHANGE_Keys *keys,
+             enum TALER_EXCHANGE_VersionCompatibility compat)
 {
   struct Exchange *exchange = cls;
   struct GNUNET_TIME_Absolute expire;
@@ -611,6 +615,14 @@ keys_mgmt_cb (void *cls,
       GNUNET_SCHEDULER_cancel (exchange->wire_task);
       exchange->wire_task = NULL;
     }
+    if (TALER_EXCHANGE_VC_INCOMPATIBLE_NEWER == compat)
+    {
+      /* Give up, log hard error. */
+      GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+                 "Exchange `%s' runs an incompatible more recent version of 
the Taler protocol. Will not retry. This client may need to be updated.\n",
+                 exchange->uri);
+      return;
+    }
     exchange->retry_delay = RETRY_BACKOFF (exchange->retry_delay);
     GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
                 "Failed to fetch /keys from `%s', retrying in %s\n",
@@ -622,6 +634,19 @@ keys_mgmt_cb (void *cls,
                                                          exchange);
     return;
   }
+  if (0 != (TALER_EXCHANGE_VC_NEWER & compat))
+  {
+    /* Warn user exactly once about need to upgrade */
+    static int once;
+
+    if (0 == once)
+    {
+      once = 1;
+      GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+                 "Exchange `%s' runs a more recent version of the Taler 
protocol. You may want to update this client.\n",
+                 exchange->uri);
+    }
+  }
   expire = TALER_EXCHANGE_check_keys_current (exchange->conn);
   if (0 == expire.abs_value_us)
     delay = RELOAD_DELAY;
diff --git a/src/merchant-tools/taler-merchant-generate-payments.c 
b/src/merchant-tools/taler-merchant-generate-payments.c
index 9dc46f6..8ba3704 100644
--- a/src/merchant-tools/taler-merchant-generate-payments.c
+++ b/src/merchant-tools/taler-merchant-generate-payments.c
@@ -1315,10 +1315,12 @@ interpreter_run (void *cls)
  *
  * @param cls closure
  * @param keys information about keys of the exchange
+ * @param compat version compatibility data
  */
 static void
 cert_cb (void *cls,
-         const struct TALER_EXCHANGE_Keys *keys)
+         const struct TALER_EXCHANGE_Keys *keys,
+        enum TALER_EXCHANGE_VersionCompatibility compat)
 {
   struct InterpreterState *is = cls;
 

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



reply via email to

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