aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2015-12-19 20:35:41 +0100
committerChristian Grothoff <christian@grothoff.org>2015-12-19 20:35:41 +0100
commit304fc9fb1fa908158c2795a69be102598af272cb (patch)
tree14ba151c623c0299ee4cfac732775a6ebd90d95d /src
parent263fd77738a8b1749ecac0748328a72bdee4a5b5 (diff)
only reduce timeout, enable function to be called on existing values
Diffstat (limited to 'src')
-rw-r--r--src/mint-lib/mint_api_context.c10
1 files changed, 9 insertions, 1 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 */