summaryrefslogtreecommitdiff
path: root/src/mint-lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/mint-lib')
-rw-r--r--src/mint-lib/mint_api_context.c10
-rw-r--r--src/mint-lib/mint_api_deposit.c33
-rw-r--r--src/mint-lib/mint_api_handle.c4
-rw-r--r--src/mint-lib/mint_api_wire.c1
-rw-r--r--src/mint-lib/test_mint_api.c1
5 files changed, 15 insertions, 34 deletions
diff --git a/src/mint-lib/mint_api_context.c b/src/mint-lib/mint_api_context.c
index 4ab46e4ee..be3df7c21 100644
--- a/src/mint-lib/mint_api_context.c
+++ b/src/mint-lib/mint_api_context.c
@@ -333,15 +333,23 @@ TALER_MINT_get_select_info (struct TALER_MINT_Context *ctx,
int *max_fd,
long *timeout)
{
+ long to;
+
GNUNET_assert (CURLM_OK ==
curl_multi_fdset (ctx->multi,
read_fd_set,
write_fd_set,
except_fd_set,
max_fd));
+ to = *timeout;
GNUNET_assert (CURLM_OK ==
curl_multi_timeout (ctx->multi,
- timeout));
+ &to));
+ /* Only if what we got back from curl is smaller than what we
+ already had (-1 == infinity!), then update timeout */
+ if ( (to < *timeout) &&
+ (-1 != to) )
+ *timeout = to;
if ( (-1 == (*timeout)) &&
(NULL != ctx->jobs_head) )
*timeout = 1000 * 60 * 5; /* curl is not always good about giving timeouts */
diff --git a/src/mint-lib/mint_api_deposit.c b/src/mint-lib/mint_api_deposit.c
index bf00ffa28..541317763 100644
--- a/src/mint-lib/mint_api_deposit.c
+++ b/src/mint-lib/mint_api_deposit.c
@@ -312,39 +312,6 @@ verify_signatures (const struct TALER_MINT_DenomPublicKey *dki,
&dki->fee_deposit);
dr.merchant = *merchant_pub;
dr.coin_pub = *coin_pub;
-
- char *contract_str = GNUNET_STRINGS_data_to_string_alloc (h_contract,
- sizeof (struct GNUNET_HashCode));
- char *wire_str = GNUNET_STRINGS_data_to_string_alloc (h_wire,
- sizeof (struct GNUNET_HashCode));
- char *merchant_pub_str = GNUNET_STRINGS_data_to_string_alloc (merchant_pub,
- sizeof (struct TALER_MerchantPublicKeyP));
- char *coin_pub_str = GNUNET_STRINGS_data_to_string_alloc (coin_pub,
- sizeof (struct TALER_CoinSpendPublicKeyP));
- printf ("verifying:\ncontract [%s]\nwire [%s]\n"
- "timestamp [%llu]\nrefund deadline [%llu]\n"
- "transaction id [%llu]\namount [%s %llu.%lu]\n"
- "fee deposit [%s %llu.%lu]\nmerch pub [%s]\n"
- "coin pub [%s]\n",
- contract_str,
- wire_str,
- timestamp.abs_value_us,
- refund_deadline.abs_value_us,
- transaction_id,
- amount->currency,
- amount->value,
- amount->fraction,
- dki->fee_deposit.currency,
- dki->fee_deposit.value,
- dki->fee_deposit.fraction,
- merchant_pub_str,
- coin_pub_str);
-
- GNUNET_free (contract_str);
- GNUNET_free (wire_str);
- GNUNET_free (merchant_pub_str);
- GNUNET_free (coin_pub_str);
-
if (GNUNET_OK !=
GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_WALLET_COIN_DEPOSIT,
&dr.purpose,
diff --git a/src/mint-lib/mint_api_handle.c b/src/mint-lib/mint_api_handle.c
index ef3da60ec..0ee24123f 100644
--- a/src/mint-lib/mint_api_handle.c
+++ b/src/mint-lib/mint_api_handle.c
@@ -695,6 +695,10 @@ MAH_path_to_url (struct TALER_MINT_Handle *h,
{
char *url;
+ if ( ('/' == path[0]) &&
+ (0 < strlen (h->url)) &&
+ ('/' == h->url[strlen (h->url) - 1]) )
+ path++; /* avoid generating URL with "//" from concat */
GNUNET_asprintf (&url,
"%s%s",
h->url,
diff --git a/src/mint-lib/mint_api_wire.c b/src/mint-lib/mint_api_wire.c
index 2af9e6ed0..5fc82f72d 100644
--- a/src/mint-lib/mint_api_wire.c
+++ b/src/mint-lib/mint_api_wire.c
@@ -358,6 +358,7 @@ request_wire_method (struct TALER_MINT_WireHandle *wh)
GNUNET_YES,
&handle_wire_method_finished,
wh);
+ TALER_MINT_perform (ctx);
}
diff --git a/src/mint-lib/test_mint_api.c b/src/mint-lib/test_mint_api.c
index 5f465363e..024e080fc 100644
--- a/src/mint-lib/test_mint_api.c
+++ b/src/mint-lib/test_mint_api.c
@@ -1524,6 +1524,7 @@ interpreter_run (void *cls,
fail (is);
return;
}
+ json_decref (wire);
trigger_context_task ();
return;
}