gnunet-svn
[Top][All Lists]
Advanced

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

[taler-exchange] branch master updated: add ENABLE_SANITY_CHECKS #define


From: gnunet
Subject: [taler-exchange] branch master updated: add ENABLE_SANITY_CHECKS #define instead of using '1'
Date: Sun, 01 Mar 2020 13:13:35 +0100

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 f979ee9a add ENABLE_SANITY_CHECKS #define instead of using '1'
f979ee9a is described below

commit f979ee9acaa69bfb26973db43c1c82f704f6b01d
Author: Christian Grothoff <address@hidden>
AuthorDate: Sun Mar 1 13:13:33 2020 +0100

    add ENABLE_SANITY_CHECKS #define instead of using '1'
---
 src/include/taler_util.h | 12 ++++++++++++
 src/util/crypto.c        |  6 +++---
 src/util/url.c           | 17 ++++++++++++++++-
 3 files changed, 31 insertions(+), 4 deletions(-)

diff --git a/src/include/taler_util.h b/src/include/taler_util.h
index f64ab342..71000e8e 100644
--- a/src/include/taler_util.h
+++ b/src/include/taler_util.h
@@ -171,6 +171,10 @@ TALER_mhd_is_https (struct MHD_Connection *connection);
 /**
  * Make an absolute URL with query parameters.
  *
+ * If a 'value' is given as NULL, both the key and the value are skipped. Note
+ * that a NULL value does not terminate the list, only a NULL key signals the
+ * end of the list of arguments.
+ *
  * @param base_url absolute base URL to use
  * @param path path of the url
  * @param ... NULL-terminated key-value pairs (char *) for query parameters,
@@ -186,6 +190,10 @@ TALER_url_join (const char *base_url,
 /**
  * Make an absolute URL for the given parameters.
  *
+ * If a 'value' is given as NULL, both the key and the value are skipped. Note
+ * that a NULL value does not terminate the list, only a NULL key signals the
+ * end of the list of arguments.
+ *
  * @param proto protocol for the URL (typically https)
  * @param host hostname for the URL
  * @param prefix prefix for the URL
@@ -205,6 +213,10 @@ TALER_url_absolute_raw (const char *proto,
 /**
  * Make an absolute URL for the given parameters.
  *
+ * If a 'value' is given as NULL, both the key and the value are skipped. Note
+ * that a NULL value does not terminate the list, only a NULL key signals the
+ * end of the list of arguments.
+ *
  * @param proto protocol for the URL (typically https)
  * @param host hostname for the URL
  * @param prefix prefix for the URL
diff --git a/src/util/crypto.c b/src/util/crypto.c
index e847633f..3544fdcc 100644
--- a/src/util/crypto.c
+++ b/src/util/crypto.c
@@ -62,7 +62,8 @@ TALER_gcrypt_init ()
              "libgcrypt version mismatch\n");
     abort ();
   }
-  /* Disable secure memory.  */
+  /* Disable secure memory (we should never run on a system that
+     even uses swap space for memory). */
   gcry_control (GCRYCTL_DISABLE_SECMEM, 0);
   gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0);
 }
@@ -83,8 +84,7 @@ TALER_test_coin_valid (const struct TALER_CoinPublicInfo 
*coin_public_info,
                        const struct TALER_DenominationPublicKey *denom_pub)
 {
   struct GNUNET_HashCode c_hash;
-#if 1 /* sanity check of invariant, could probably be disabled in production
-         for slightly more performance */
+#if ENABLE_SANITY_CHECKS
   struct GNUNET_HashCode d_hash;
 
   GNUNET_CRYPTO_rsa_public_key_hash (denom_pub->rsa_public_key,
diff --git a/src/util/url.c b/src/util/url.c
index 22bdd3fc..ec94f58b 100644
--- a/src/util/url.c
+++ b/src/util/url.c
@@ -157,7 +157,10 @@ calculate_argument_length (va_list args)
 
 /**
  * Take the key-value pairs in @a args and serialize them into
- * @a buf, using URL encoding for the values.
+ * @a buf, using URL encoding for the values.  If a 'value' is
+ * given as NULL, both the key and the value are skipped. Note
+ * that a NULL value does not terminate the list, only a NULL
+ * key signals the end of the list of arguments.
  *
  * @param buf where to write the values
  * @param args NULL-terminated key-value pairs (char *) for query parameters,
@@ -201,6 +204,10 @@ serialize_arguments (struct GNUNET_Buffer *buf,
 /**
  * Make an absolute URL with query parameters.
  *
+ * If a 'value' is given as NULL, both the key and the value are skipped. Note
+ * that a NULL value does not terminate the list, only a NULL key signals the
+ * end of the list of arguments.
+ *
  * @param base_url absolute base URL to use
  * @param path path of the url
  * @param ... NULL-terminated key-value pairs (char *) for query parameters,
@@ -265,6 +272,10 @@ TALER_url_join (const char *base_url,
 /**
  * Make an absolute URL for the given parameters.
  *
+ * If a 'value' is given as NULL, both the key and the value are skipped. Note
+ * that a NULL value does not terminate the list, only a NULL key signals the
+ * end of the list of arguments.
+ *
  * @param proto protocol for the URL (typically https)
  * @param host hostname for the URL
  * @param prefix prefix for the URL
@@ -308,6 +319,10 @@ TALER_url_absolute_raw_va (const char *proto,
 /**
  * Make an absolute URL for the given parameters.
  *
+ * If a 'value' is given as NULL, both the key and the value are skipped. Note
+ * that a NULL value does not terminate the list, only a NULL key signals the
+ * end of the list of arguments.
+ *
  * @param proto protocol for the URL (typically https)
  * @param host hostname for the URL
  * @param prefix prefix for the URL

-- 
To stop receiving notification emails like this one, please contact
address@hidden.



reply via email to

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