[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [taler-exchange] branch master updated: add argument to TAL
From: |
gnunet |
Subject: |
[GNUnet-SVN] [taler-exchange] branch master updated: add argument to TALER_EXCHANGE_check_keys_current() to allow forcing the download |
Date: |
Wed, 13 Sep 2017 14:07:44 +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 b46735f add argument to TALER_EXCHANGE_check_keys_current() to allow
forcing the download
b46735f is described below
commit b46735fbafdea562a0d56e7ea1ce844faadcc192
Author: Christian Grothoff <address@hidden>
AuthorDate: Wed Sep 13 14:08:11 2017 +0200
add argument to TALER_EXCHANGE_check_keys_current() to allow forcing the
download
---
.gitignore | 1 +
ChangeLog | 5 +++++
src/exchange-lib/exchange_api_handle.c | 13 +++++++++----
src/include/taler_exchange_service.h | 4 +++-
4 files changed, 18 insertions(+), 5 deletions(-)
diff --git a/.gitignore b/.gitignore
index 608d4d6..8855941 100644
--- a/.gitignore
+++ b/.gitignore
@@ -86,3 +86,4 @@ doc/manual/manual.tp
doc/manual/manual.vr
contrib/taler-exchange.tag
doxygen-doc/
+src/exchange-lib/test_exchange_api_keys_cherry_picking
diff --git a/ChangeLog b/ChangeLog
index d8adb7d..a133921 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Wed Sep 13 14:06:44 CEST 2017
+ Add argument to TALER_EXCHANGE_check_keys_current()
+ to force download even if /keys are still considered
+ current. -CG
+
Fri Jul 14 17:38:54 CEST 2017
Fix #4751 by not allowing denomination deletion (GC)
to cascade into reserve_out table (and tolerating such
diff --git a/src/exchange-lib/exchange_api_handle.c
b/src/exchange-lib/exchange_api_handle.c
index 99255e4..91309cc 100644
--- a/src/exchange-lib/exchange_api_handle.c
+++ b/src/exchange-lib/exchange_api_handle.c
@@ -770,14 +770,17 @@ request_keys (struct TALER_EXCHANGE_Handle *exchange);
* not trigger download.
*
* @param exchange exchange to check keys for
+ * @param force_download #GNUNET_YES to force download even if /keys is still
valid
* @return until when the response is current, 0 if we are re-downloading
*/
struct GNUNET_TIME_Absolute
-TALER_EXCHANGE_check_keys_current (struct TALER_EXCHANGE_Handle *exchange)
+TALER_EXCHANGE_check_keys_current (struct TALER_EXCHANGE_Handle *exchange,
+ int force_download)
{
if (NULL != exchange->kr)
return GNUNET_TIME_UNIT_ZERO_ABS;
- if (0 < GNUNET_TIME_absolute_get_remaining
(exchange->key_data_expiration).rel_value_us)
+ if ( (GNUNET_NO == force_download) &&
+ (0 < GNUNET_TIME_absolute_get_remaining
(exchange->key_data_expiration).rel_value_us) )
return exchange->key_data_expiration;
request_keys (exchange);
return GNUNET_TIME_UNIT_ZERO_ABS;
@@ -1280,7 +1283,8 @@ TALER_EXCHANGE_get_denomination_key_by_hash (const struct
TALER_EXCHANGE_Keys *k
const struct TALER_EXCHANGE_Keys *
TALER_EXCHANGE_get_keys (struct TALER_EXCHANGE_Handle *exchange)
{
- (void) TALER_EXCHANGE_check_keys_current (exchange);
+ (void) TALER_EXCHANGE_check_keys_current (exchange,
+ GNUNET_NO);
return &exchange->key_data;
}
@@ -1295,7 +1299,8 @@ TALER_EXCHANGE_get_keys (struct TALER_EXCHANGE_Handle
*exchange)
json_t *
TALER_EXCHANGE_get_keys_raw (struct TALER_EXCHANGE_Handle *exchange)
{
- (void) TALER_EXCHANGE_check_keys_current (exchange);
+ (void) TALER_EXCHANGE_check_keys_current (exchange,
+ GNUNET_NO);
return json_deep_copy (exchange->key_data_raw);
}
diff --git a/src/include/taler_exchange_service.h
b/src/include/taler_exchange_service.h
index d7056b5..814078a 100644
--- a/src/include/taler_exchange_service.h
+++ b/src/include/taler_exchange_service.h
@@ -367,10 +367,12 @@ TALER_EXCHANGE_get_keys (struct TALER_EXCHANGE_Handle
*exchange);
* not, trigger /keys download.
*
* @param exchange exchange to check keys for
+ * @param force_download #GNUNET_YES to force download even if /keys is still
valid
* @return until when the response is current, 0 if we are re-downloading
*/
struct GNUNET_TIME_Absolute
-TALER_EXCHANGE_check_keys_current (struct TALER_EXCHANGE_Handle *exchange);
+TALER_EXCHANGE_check_keys_current (struct TALER_EXCHANGE_Handle *exchange,
+ int force_download);
/**
--
To stop receiving notification emails like this one, please contact
address@hidden
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] [taler-exchange] branch master updated: add argument to TALER_EXCHANGE_check_keys_current() to allow forcing the download,
gnunet <=