gnunet-svn
[Top][All Lists]
Advanced

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

[taler-exchange] 02/02: -bugfixes


From: gnunet
Subject: [taler-exchange] 02/02: -bugfixes
Date: Tue, 04 Jul 2023 23:28:14 +0200

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

grothoff pushed a commit to branch master
in repository exchange.

commit 999db0fb80c35900b3431b3f90bbd87fca02d983
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Tue Jul 4 23:21:47 2023 +0200

    -bugfixes
---
 src/lib/exchange_api_handle.c                    | 18 +++++++++++++-----
 src/testing/testing_api_cmd_check_keys.c         |  1 +
 src/testing/testing_api_cmd_connect_with_state.c |  1 +
 3 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/src/lib/exchange_api_handle.c b/src/lib/exchange_api_handle.c
index 7fcb590a..0ea7e642 100644
--- a/src/lib/exchange_api_handle.c
+++ b/src/lib/exchange_api_handle.c
@@ -1281,6 +1281,10 @@ header_cb (char *buffer,
     return total;
   val = GNUNET_strndup (&buffer[strlen (MHD_HTTP_HEADER_EXPIRES ": ")],
                         total - strlen (MHD_HTTP_HEADER_EXPIRES ": "));
+  GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+              "Found %s header `%s'\n",
+              MHD_HTTP_HEADER_EXPIRES,
+              val);
   if (GNUNET_OK !=
       parse_date_string (val,
                          &kr->expire))
@@ -1541,7 +1545,8 @@ TALER_EXCHANGE_keys_from_json (const json_t *j)
   const json_t *jkeys;
   const char *url;
   uint32_t version;
-  struct GNUNET_TIME_Timestamp expire;
+  struct GNUNET_TIME_Timestamp expire
+    = GNUNET_TIME_UNIT_ZERO_TS;
   struct GNUNET_JSON_Specification spec[] = {
     GNUNET_JSON_spec_uint32 ("version",
                              &version),
@@ -1549,8 +1554,10 @@ TALER_EXCHANGE_keys_from_json (const json_t *j)
                                   &jkeys),
     GNUNET_JSON_spec_string ("exchange_url",
                              &url),
-    GNUNET_JSON_spec_timestamp ("expire",
-                                &expire),
+    GNUNET_JSON_spec_mark_optional (
+      GNUNET_JSON_spec_timestamp ("expire",
+                                  &expire),
+      NULL),
     GNUNET_JSON_spec_end ()
   };
   struct TALER_EXCHANGE_Keys *keys;
@@ -1747,8 +1754,9 @@ TALER_EXCHANGE_keys_to_json (const struct 
TALER_EXCHANGE_Keys *kd)
   return GNUNET_JSON_PACK (
     GNUNET_JSON_pack_uint64 ("version",
                              EXCHANGE_SERIALIZATION_FORMAT_VERSION),
-    GNUNET_JSON_pack_timestamp ("expire",
-                                kd->key_data_expiration),
+    GNUNET_JSON_pack_allow_null (
+      GNUNET_JSON_pack_timestamp ("expire",
+                                  kd->key_data_expiration)),
     GNUNET_JSON_pack_string ("exchange_url",
                              kd->exchange_url),
     GNUNET_JSON_pack_object_steal ("keys",
diff --git a/src/testing/testing_api_cmd_check_keys.c 
b/src/testing/testing_api_cmd_check_keys.c
index bb26d10a..0097725c 100644
--- a/src/testing/testing_api_cmd_check_keys.c
+++ b/src/testing/testing_api_cmd_check_keys.c
@@ -73,6 +73,7 @@ keys_cb (void *cls,
 {
   struct CheckKeysState *cks = cls;
 
+  cks->gkh = NULL;
   if (MHD_HTTP_OK != kr->hr.http_status)
   {
     TALER_TESTING_unexpected_status (cks->is,
diff --git a/src/testing/testing_api_cmd_connect_with_state.c 
b/src/testing/testing_api_cmd_connect_with_state.c
index 81587248..caeef90b 100644
--- a/src/testing/testing_api_cmd_connect_with_state.c
+++ b/src/testing/testing_api_cmd_connect_with_state.c
@@ -67,6 +67,7 @@ cert_cb (void *cls,
   struct TALER_TESTING_Interpreter *is = cwss->is;
   const struct TALER_EXCHANGE_HttpResponse *hr = &kr->hr;
 
+  cwss->exchange = NULL;
   switch (hr->http_status)
   {
   case MHD_HTTP_OK:

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

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