[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-exchange] branch master updated: -misc minor fixes
From: |
gnunet |
Subject: |
[taler-exchange] branch master updated: -misc minor fixes |
Date: |
Wed, 05 Jul 2023 13:13:22 +0200 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository exchange.
The following commit(s) were added to refs/heads/master by this push:
new 1db17d43 -misc minor fixes
1db17d43 is described below
commit 1db17d43bd9256ec86508bf9e282263e35fd9e01
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Wed Jul 5 13:13:16 2023 +0200
-misc minor fixes
---
src/exchange/taler-exchange-httpd_keys.c | 8 +++++---
src/lib/exchange_api_handle.c | 21 +++++++++++++++++++++
src/testing/testing_api_cmd_run_fakebank.c | 2 ++
3 files changed, 28 insertions(+), 3 deletions(-)
diff --git a/src/exchange/taler-exchange-httpd_keys.c
b/src/exchange/taler-exchange-httpd_keys.c
index e53f2732..8b9e54b4 100644
--- a/src/exchange/taler-exchange-httpd_keys.c
+++ b/src/exchange/taler-exchange-httpd_keys.c
@@ -1,6 +1,6 @@
/*
This file is part of TALER
- Copyright (C) 2020-2022 Taler Systems SA
+ Copyright (C) 2020-2023 Taler Systems SA
TALER is free software; you can redistribute it and/or modify it under the
terms of the GNU Affero General Public License as published by the Free
Software
@@ -1701,8 +1701,10 @@ setup_general_response_headers (struct
TEH_KeyStateHandle *ksh,
TALER_MHD_get_date_string (m.abs_time,
dat);
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
- "Setting /keys 'Expires' header to '%s'\n",
- dat);
+ "Setting /keys 'Expires' header to '%s' (rekey frequency is
%s)\n",
+ dat,
+ GNUNET_TIME_relative2s (ksh->rekey_frequency,
+ false));
GNUNET_break (MHD_YES ==
MHD_add_response_header (response,
MHD_HTTP_HEADER_EXPIRES,
diff --git a/src/lib/exchange_api_handle.c b/src/lib/exchange_api_handle.c
index 0ea7e642..40ae390f 100644
--- a/src/lib/exchange_api_handle.c
+++ b/src/lib/exchange_api_handle.c
@@ -69,6 +69,13 @@
*/
#define DEFAULT_EXPIRATION GNUNET_TIME_UNIT_HOURS
+/**
+ * If the "Expire" cache control header is missing, for
+ * how long do we assume the reply to be valid at least?
+ */
+#define MINIMUM_EXPIRATION GNUNET_TIME_relative_multiply ( \
+ GNUNET_TIME_UNIT_MINUTES, 2)
+
/**
* Handle for a GET /keys request.
@@ -1109,6 +1116,20 @@ keys_completed_cb (void *cls,
break;
}
kd->rc = 1;
+ kd->key_data_expiration = gkh->expire;
+ if (GNUNET_TIME_relative_cmp (
+ GNUNET_TIME_absolute_get_remaining (gkh->expire.abs_time),
+ <,
+ MINIMUM_EXPIRATION))
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+ "Exchange returned keys with expiration time below %s.
Compensating.\n",
+ GNUNET_TIME_relative2s (MINIMUM_EXPIRATION,
+ true));
+ kd->key_data_expiration
+ = GNUNET_TIME_relative_to_timestamp (MINIMUM_EXPIRATION);
+ }
+
kresp.details.ok.keys = kd;
break;
case MHD_HTTP_BAD_REQUEST:
diff --git a/src/testing/testing_api_cmd_run_fakebank.c
b/src/testing/testing_api_cmd_run_fakebank.c
index f9a6b9b6..03b36763 100644
--- a/src/testing/testing_api_cmd_run_fakebank.c
+++ b/src/testing/testing_api_cmd_run_fakebank.c
@@ -110,6 +110,7 @@ run_fakebank_cleanup (void *cls,
}
GNUNET_free (rfs->ba.wire_gateway_url);
GNUNET_free (rfs->bank_url);
+ GNUNET_free (rfs->currency);
GNUNET_free (rfs);
}
@@ -195,6 +196,7 @@ TALER_TESTING_cmd_run_fakebank (
exchange_xtalerbank_account);
GNUNET_free (exchange_xtalerbank_account);
}
+ GNUNET_free (exchange_payto_uri);
rfs->ba.method = TALER_BANK_AUTH_NONE;
{
struct TALER_TESTING_Command cmd = {
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [taler-exchange] branch master updated: -misc minor fixes,
gnunet <=