summaryrefslogtreecommitdiff
path: root/src/exchange/taler-exchange-httpd.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2019-06-05 23:38:28 +0200
committerChristian Grothoff <christian@grothoff.org>2019-06-05 23:51:26 +0200
commit69a07468de8555d5260afab4019e34f40e5ec6be (patch)
tree57aa9a3093c8aa10c789391f4c6a010304aecbfd /src/exchange/taler-exchange-httpd.c
parent2f0015b80385364ffbacca71504a96a46db6f0e0 (diff)
downloadexchange-69a07468de8555d5260afab4019e34f40e5ec6be.tar.gz
exchange-69a07468de8555d5260afab4019e34f40e5ec6be.tar.bz2
exchange-69a07468de8555d5260afab4019e34f40e5ec6be.zip
working on fix for #5747
Diffstat (limited to 'src/exchange/taler-exchange-httpd.c')
-rw-r--r--src/exchange/taler-exchange-httpd.c26
1 files changed, 21 insertions, 5 deletions
diff --git a/src/exchange/taler-exchange-httpd.c b/src/exchange/taler-exchange-httpd.c
index b24feef61..45e0c764b 100644
--- a/src/exchange/taler-exchange-httpd.c
+++ b/src/exchange/taler-exchange-httpd.c
@@ -98,6 +98,11 @@ char *TEH_revocation_directory;
struct GNUNET_CONFIGURATION_Handle *cfg;
/**
+ * How long is caching /keys allowed at most?
+ */
+struct GNUNET_TIME_Relative max_keys_caching;
+
+/**
* Master public key (according to the
* configuration in the exchange directory).
*/
@@ -370,8 +375,8 @@ handle_mhd_request (void *cls,
&TEH_MHD_handler_send_json_pack_error, MHD_HTTP_METHOD_NOT_ALLOWED },
{ "/test/eddsa", MHD_HTTP_METHOD_POST, "application/json",
- NULL, 0,
- &TEH_TEST_handler_test_eddsa, MHD_HTTP_OK },
+ NULL, 0,
+ &TEH_TEST_handler_test_eddsa, MHD_HTTP_OK },
{ "/test/eddsa", NULL, "text/plain",
"Only POST is allowed", 0,
&TEH_MHD_handler_send_json_pack_error, MHD_HTTP_METHOD_NOT_ALLOWED },
@@ -391,13 +396,12 @@ handle_mhd_request (void *cls,
&TEH_MHD_handler_send_json_pack_error, MHD_HTTP_METHOD_NOT_ALLOWED },
{ "/test/transfer", MHD_HTTP_METHOD_POST, "application/json",
- NULL, 0,
- &TEH_TEST_handler_test_transfer, MHD_HTTP_OK },
+ NULL, 0,
+ &TEH_TEST_handler_test_transfer, MHD_HTTP_OK },
{ "/test/transfer", NULL, "text/plain",
"Only POST is allowed", 0,
&TEH_MHD_handler_send_json_pack_error, MHD_HTTP_METHOD_NOT_ALLOWED },
#endif
-
{ NULL, NULL, NULL, NULL, 0, 0 }
};
static struct TEH_RequestHandler h404 =
@@ -606,6 +610,18 @@ exchange_serve_process_config ()
char *TEH_master_public_key_str;
if (GNUNET_OK !=
+ GNUNET_CONFIGURATION_get_value_time (cfg,
+ "exchange",
+ "MAX_KEYS_CACHING",
+ &max_keys_caching))
+ {
+ GNUNET_log_config_invalid (GNUNET_ERROR_TYPE_ERROR,
+ "exchange",
+ "MAX_KEYS_CACHING",
+ "valid relative time expected");
+ return GNUNET_SYSERR;
+ }
+ if (GNUNET_OK !=
GNUNET_CONFIGURATION_get_value_filename (cfg,
"exchange",
"KEYDIR",