commit f4e0ec373360c7cfc04f59143eda64717f4f12cb
parent 95471d8638e56bada29e6611ed3de5aa5926f03b
Author: Florian Dold <florian.dold@gmail.com>
Date: Tue, 21 Jul 2020 12:42:05 +0530
use empty string as default for session ID
Diffstat:
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
@@ -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
@@ -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
@@ -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