diff options
author | Christian Grothoff <christian@grothoff.org> | 2021-03-13 10:53:10 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2021-03-13 10:53:10 +0100 |
commit | a3fd8a78b07f49b31cf76c99d1d859f6c62baceb (patch) | |
tree | 5fada617e9cf7608331e2fd7ade0c279ddcefe4b | |
parent | 2ae55e5e7ff366ed1e4602710663a25f2f85420f (diff) |
clean up url_join calls
-rw-r--r-- | src/lib/merchant_api_merchant_get_order.c | 3 | ||||
-rw-r--r-- | src/lib/merchant_api_wallet_get_order.c | 26 |
2 files changed, 19 insertions, 10 deletions
diff --git a/src/lib/merchant_api_merchant_get_order.c b/src/lib/merchant_api_merchant_get_order.c index 7cce082a..466f2cd1 100644 --- a/src/lib/merchant_api_merchant_get_order.c +++ b/src/lib/merchant_api_merchant_get_order.c @@ -489,8 +489,7 @@ TALER_MERCHANT_merchant_order_get (struct GNUNET_CURL_Context *ctx, path, "session_id", session_id, "transfer", transfer ? "YES" : "NO", - (0 != tms) ? "timeout_ms" : NULL, - timeout_ms, + "timeout_ms", (0 != tms) ? timeout_ms : NULL, NULL); GNUNET_free (path); } diff --git a/src/lib/merchant_api_wallet_get_order.c b/src/lib/merchant_api_wallet_get_order.c index 5979e69f..0452d70d 100644 --- a/src/lib/merchant_api_wallet_get_order.c +++ b/src/lib/merchant_api_wallet_get_order.c @@ -264,19 +264,15 @@ TALER_MERCHANT_wallet_order_get (struct GNUNET_CURL_Context *ctx, h_contract_s.encoding, "session_id", session_id, + "timeout_ms", (0 != tms) - ? "timeout_ms" - : NULL, - timeout_ms, - (NULL != min_refund) - ? "refund" + ? timeout_ms : NULL, + "refund", (NULL != min_refund) ? TALER_amount2s (min_refund) : NULL, - await_refund_obtained - ? "await_refund_obtained" - : NULL, + "await_refund_obtained", await_refund_obtained ? "yes" : NULL, @@ -302,6 +298,20 @@ TALER_MERCHANT_wallet_order_get (struct GNUNET_CURL_Context *ctx, GNUNET_free (owgh); return NULL; } + if (0 != tms) + { + if (CURLE_OK != + curl_easy_setopt (eh, + CURLOPT_TIMEOUT_MS, + (long) tms)) + { + GNUNET_break (0); + curl_easy_cleanup (eh); + GNUNET_free (owgh->url); + GNUNET_free (owgh); + return NULL; + } + } if (CURLE_OK != curl_easy_setopt (eh, CURLOPT_URL, |