From 93a6bbfc58ec48c774ecf475ec7e58184504bbc4 Mon Sep 17 00:00:00 2001 From: Marcello Stanisci Date: Tue, 8 Jan 2019 15:59:14 +0100 Subject: 5136: fix multiple invocations of /keys callback. Basically, we allow such a callback to be invoked only once. Subsequent invocations (due to keys updates / whatever) cause the callback to simply return in a do-nothing fashion. Also: adding a /wire CMD - that uses /keys - after serilized keys have been loaded. --- src/exchange-lib/exchange_api_handle.c | 51 +++++++++++++++++++--------------- 1 file changed, 29 insertions(+), 22 deletions(-) (limited to 'src/exchange-lib/exchange_api_handle.c') diff --git a/src/exchange-lib/exchange_api_handle.c b/src/exchange-lib/exchange_api_handle.c index 47b984386..6b2e30030 100644 --- a/src/exchange-lib/exchange_api_handle.c +++ b/src/exchange-lib/exchange_api_handle.c @@ -2,18 +2,21 @@ This file is part of TALER 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 - Foundation; either version 3, or (at your option) any later version. - - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, see + 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 Foundation; either version 3, or (at your + option) any later version. + + TALER is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public + License along with TALER; see the file COPYING. If not, see */ + /** * @file exchange-lib/exchange_api_handle.c * @brief Implementation of the "handle" component of the exchange's HTTP API @@ -1372,25 +1375,29 @@ TALER_EXCHANGE_serialize_data (struct TALER_EXCHANGE_Handle *exchange) /** * Initialise a connection to the exchange. Will connect to the - * exchange and obtain information about the exchange's master public - * key and the exchange's auditor. The respective information will - * be passed to the @a cert_cb once available, and all future - * interactions with the exchange will be checked to be signed - * (where appropriate) by the respective master key. + * exchange and obtain information about the exchange's master + * public key and the exchange's auditor. + * The respective information will be passed to the @a cert_cb + * once available, and all future interactions with the exchange + * will be checked to be signed (where appropriate) by the + * respective master key. * * @param ctx the context * @param url HTTP base URL for the exchange - * @param cert_cb function to call with the exchange's certification information + * @param cert_cb function to call with the exchange's + * certification information * @param cert_cb_cls closure for @a cert_cb - * @param ... list of additional arguments, terminated by #TALER_EXCHANGE_OPTION_END. + * @param ... list of additional arguments, + * terminated by #TALER_EXCHANGE_OPTION_END. * @return the exchange handle; NULL upon error */ struct TALER_EXCHANGE_Handle * -TALER_EXCHANGE_connect (struct GNUNET_CURL_Context *ctx, - const char *url, - TALER_EXCHANGE_CertificationCallback cert_cb, - void *cert_cb_cls, - ...) +TALER_EXCHANGE_connect + (struct GNUNET_CURL_Context *ctx, + const char *url, + TALER_EXCHANGE_CertificationCallback cert_cb, + void *cert_cb_cls, + ...) { struct TALER_EXCHANGE_Handle *exchange; va_list ap; -- cgit v1.2.3