gnunet-svn
[Top][All Lists]
Advanced

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

[taler-merchant] branch master updated: use empty string as default for


From: gnunet
Subject: [taler-merchant] branch master updated: use empty string as default for session ID
Date: Tue, 21 Jul 2020 09:12:12 +0200

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

dold pushed a commit to branch master
in repository merchant.

The following commit(s) were added to refs/heads/master by this push:
     new f4e0ec3  use empty string as default for session ID
f4e0ec3 is described below

commit f4e0ec373360c7cfc04f59143eda64717f4f12cb
Author: Florian Dold <florian.dold@gmail.com>
AuthorDate: Tue Jul 21 12:42:05 2020 +0530

    use empty string as default for session ID
---
 src/backend/taler-merchant-httpd_post-orders-ID-pay.c | 5 +++++
 src/backenddb/plugin_merchantdb_postgres.c            | 5 ++++-
 src/include/taler_merchantdb_plugin.h                 | 2 +-
 3 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/src/backend/taler-merchant-httpd_post-orders-ID-pay.c 
b/src/backend/taler-merchant-httpd_post-orders-ID-pay.c
index ca04186..64ba5e6 100644
--- a/src/backend/taler-merchant-httpd_post-orders-ID-pay.c
+++ b/src/backend/taler-merchant-httpd_post-orders-ID-pay.c
@@ -1593,6 +1593,11 @@ parse_pay (struct MHD_Connection *connection,
       GNUNET_assert (NULL != session_id);
       pc->session_id = GNUNET_strdup (session_id);
     }
+    else
+    {
+      /* use empty string as default if client didn't specify it */
+      pc->session_id = GNUNET_strdup ("");
+    }
   }
 
   /* copy order ID */
diff --git a/src/backenddb/plugin_merchantdb_postgres.c 
b/src/backenddb/plugin_merchantdb_postgres.c
index 6e7b955..06c2a17 100644
--- a/src/backenddb/plugin_merchantdb_postgres.c
+++ b/src/backenddb/plugin_merchantdb_postgres.c
@@ -2028,7 +2028,7 @@ postgres_lookup_refunds (void *cls,
  * @param cls closure
  * @param instance_id instance to mark contract as paid for
  * @param h_contract_terms hash of the contract that is now paid
- * @param session_id the session that paid the contract, can be NULL
+ * @param session_id the session that paid the contract
  * @return transaction status
  */
 static enum GNUNET_DB_QueryStatus
@@ -2051,6 +2051,9 @@ postgres_mark_contract_paid (void *cls,
   };
   enum GNUNET_DB_QueryStatus qs;
 
+  /* Session ID must always be given by the caller. */
+  GNUNET_assert (NULL != session_id);
+
   /* no preflight check here, run in transaction by caller! */
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "Marking h_contract_terms '%s' of %s as paid for session `%s'\n",
diff --git a/src/include/taler_merchantdb_plugin.h 
b/src/include/taler_merchantdb_plugin.h
index 1615224..2532289 100644
--- a/src/include/taler_merchantdb_plugin.h
+++ b/src/include/taler_merchantdb_plugin.h
@@ -1228,7 +1228,7 @@ struct TALER_MERCHANTDB_Plugin
    * @param cls closure
    * @param instance_id instance to mark contract as paid for
    * @param h_contract_terms hash of the contract that is now paid
-   * @param session_id the session that paid the contract, can be NULL
+   * @param session_id the session that paid the contract
    * @return transaction status
    */
   enum GNUNET_DB_QueryStatus

-- 
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]