gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [taler-exchange] 02/02: force TALER_EXCHANGE_connect() va-l


From: gnunet
Subject: [GNUnet-SVN] [taler-exchange] 02/02: force TALER_EXCHANGE_connect() va-list to be actually provided
Date: Sun, 19 Aug 2018 13:07:38 +0200

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

grothoff pushed a commit to branch master
in repository exchange.

commit 6982ccd78b185751553a01d1f420d5603ad2faca
Author: Christian Grothoff <address@hidden>
AuthorDate: Sun Aug 19 12:22:42 2018 +0200

    force TALER_EXCHANGE_connect() va-list to be actually provided
---
 src/exchange-lib/exchange_api_handle.c             | 23 ++++++++++++++--------
 src/exchange-lib/test_exchange_api.c               |  3 ++-
 .../test_exchange_api_keys_cherry_picking.c        |  6 ++++--
 .../test_exchange_api_keys_cherry_picking_new.c    |  9 ++-------
 src/exchange-lib/testing_api_loop.c                |  3 ++-
 5 files changed, 25 insertions(+), 19 deletions(-)

diff --git a/src/exchange-lib/exchange_api_handle.c 
b/src/exchange-lib/exchange_api_handle.c
index 2be8b37b..1d8a31b7 100644
--- a/src/exchange-lib/exchange_api_handle.c
+++ b/src/exchange-lib/exchange_api_handle.c
@@ -1,6 +1,6 @@
 /*
   This file is part of TALER
-  Copyright (C) 2014-2017 GNUnet e.V.
+  Copyright (C) 2014-2018 GNUnet e.V.
 
   TALER is free software; you can redistribute it and/or modify it under the
   terms of the GNU General Public License as published by the Free Software
@@ -118,6 +118,12 @@ struct TALER_EXCHANGE_Handle
   struct GNUNET_SCHEDULER_Task *retry_task;
 
   /**
+   * Raw key data of the exchange, only valid if
+   * @e handshake_complete is past stage #MHS_CERT.
+   */
+  json_t *key_data_raw;
+
+  /**
    * Key data of the exchange, only valid if
    * @e handshake_complete is past stage #MHS_CERT.
    */
@@ -134,12 +140,6 @@ struct TALER_EXCHANGE_Handle
   struct GNUNET_TIME_Absolute key_data_expiration;
 
   /**
-   * Raw key data of the exchange, only valid if
-   * @e handshake_complete is past stage #MHS_CERT.
-   */
-  json_t *key_data_raw;
-
-  /**
    * Stage of the exchange's initialization routines.
    */
   enum ExchangeHandleState state;
@@ -801,7 +801,7 @@ TALER_EXCHANGE_check_keys_current (struct 
TALER_EXCHANGE_Handle *exchange,
   if ( (GNUNET_NO == force_download) &&
        (0 < GNUNET_TIME_absolute_get_remaining 
(exchange->key_data_expiration).rel_value_us) )
     return exchange->key_data_expiration;
-  if (NULL != exchange->retry_task)
+  if (NULL == exchange->retry_task)
     exchange->retry_task = GNUNET_SCHEDULER_add_now (&request_keys,
                                                      exchange);
   return GNUNET_TIME_UNIT_ZERO_ABS;
@@ -1096,8 +1096,10 @@ header_cb (char *buffer,
   return total;
 }
 
+
 /* ********************* public API ******************* */
 
+
 /**
  * Initialise a connection to the exchange. Will connect to the
  * exchange and obtain information about the exchange's master public
@@ -1121,7 +1123,12 @@ TALER_EXCHANGE_connect (struct GNUNET_CURL_Context *ctx,
                         ...)
 {
   struct TALER_EXCHANGE_Handle *exchange;
+  va_list ap;
 
+  va_start (ap, cert_cb_cls);
+  GNUNET_assert (TALER_EXCHANGE_OPTION_END ==
+                 va_arg (ap, int));
+  va_end (ap);
   exchange = GNUNET_new (struct TALER_EXCHANGE_Handle);
   exchange->ctx = ctx;
   exchange->url = GNUNET_strdup (url);
diff --git a/src/exchange-lib/test_exchange_api.c 
b/src/exchange-lib/test_exchange_api.c
index 7ca74a22..a96e4996 100644
--- a/src/exchange-lib/test_exchange_api.c
+++ b/src/exchange-lib/test_exchange_api.c
@@ -3821,7 +3821,8 @@ run (void *cls)
   fakebank = TALER_FAKEBANK_start (8082);
   exchange = TALER_EXCHANGE_connect (ctx,
                                      "http://localhost:8081";,
-                                     &cert_cb, is,
+                                     &cert_cb,
+                                     is,
                                      TALER_EXCHANGE_OPTION_END);
   GNUNET_assert (NULL != exchange);
   timeout_task
diff --git a/src/exchange-lib/test_exchange_api_keys_cherry_picking.c 
b/src/exchange-lib/test_exchange_api_keys_cherry_picking.c
index e5fd22a1..0dc0c540 100644
--- a/src/exchange-lib/test_exchange_api_keys_cherry_picking.c
+++ b/src/exchange-lib/test_exchange_api_keys_cherry_picking.c
@@ -597,13 +597,15 @@ run (void *cls)
   rc = GNUNET_CURL_gnunet_rc_create (ctx);
   exchange = TALER_EXCHANGE_connect (ctx,
                                      "http://localhost:8081";,
-                                     &cert_cb, is,
+                                     &cert_cb,
+                                     is,
                                      TALER_EXCHANGE_OPTION_END);
   GNUNET_assert (NULL != exchange);
   timeout_task
     = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply
                                     (GNUNET_TIME_UNIT_SECONDS, 300),
-                                    &do_timeout, NULL);
+                                    &do_timeout,
+                                    NULL);
   GNUNET_SCHEDULER_add_shutdown (&do_shutdown,
                                  is);
 }
diff --git a/src/exchange-lib/test_exchange_api_keys_cherry_picking_new.c 
b/src/exchange-lib/test_exchange_api_keys_cherry_picking_new.c
index 64c03ff9..d1fd25cf 100644
--- a/src/exchange-lib/test_exchange_api_keys_cherry_picking_new.c
+++ b/src/exchange-lib/test_exchange_api_keys_cherry_picking_new.c
@@ -63,28 +63,22 @@ run (void *cls,
      struct TALER_TESTING_Interpreter *is)
 {
   struct TALER_TESTING_Command commands[] = {
-
     /* Trigger keys reloading from disk.  */
     TALER_TESTING_cmd_signal ("signal-reaction-1",
                               is->exchanged,
                               SIGUSR1),
-
     TALER_TESTING_cmd_check_keys ("check-keys-1",
                                   1,
                                   4,
                                   is->exchange),
-
     /* 1st keyup happens at start-up */
-    TALER_TESTING_cmd_exec_keyup ("keyup-2", 
+    TALER_TESTING_cmd_exec_keyup ("keyup-2",
                                   CONFIG_FILE_EXTENDED),
-
     TALER_TESTING_cmd_exec_auditor_sign ("sign-keys-1",
                                          CONFIG_FILE),
-
     TALER_TESTING_cmd_signal ("trigger-keys-reload-1",
                               is->exchanged,
                               SIGUSR1),
-
     TALER_TESTING_cmd_check_keys ("check-keys-2",
                                   2,
 #if TALER_EXCHANGE_API_DISABLE_CHERRYPICKING
@@ -99,6 +93,7 @@ run (void *cls,
   TALER_TESTING_run (is, commands);
 }
 
+
 int
 main (int argc,
       char * const *argv)
diff --git a/src/exchange-lib/testing_api_loop.c 
b/src/exchange-lib/testing_api_loop.c
index 43d0ecc8..27611b2d 100644
--- a/src/exchange-lib/testing_api_loop.c
+++ b/src/exchange-lib/testing_api_loop.c
@@ -657,7 +657,8 @@ main_wrapper_exchange_connect (void *cls)
                  (is->exchange = TALER_EXCHANGE_connect (is->ctx,
                                                          exchange_url,
                                                          &cert_cb,
-                                                         main_ctx)));
+                                                         main_ctx,
+                                                         
TALER_EXCHANGE_OPTION_END)));
   GNUNET_free (exchange_url);
   GNUNET_CONFIGURATION_destroy (cfg);
 }

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



reply via email to

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