From 304fc9fb1fa908158c2795a69be102598af272cb Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sat, 19 Dec 2015 20:35:41 +0100 Subject: only reduce timeout, enable function to be called on existing values --- src/mint-lib/mint_api_context.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src') 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 */ -- cgit v1.2.3