gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-merchant] branch master updated: also propage timeout into curl


From: gnunet
Subject: [taler-merchant] branch master updated: also propage timeout into curl
Date: Sat, 02 Nov 2019 17:58:45 +0100

This is an automated email from the git hooks/post-receive script.

grothoff pushed a commit to branch master
in repository merchant.

The following commit(s) were added to refs/heads/master by this push:
     new e62708f  also propage timeout into curl
e62708f is described below

commit e62708f09ff5a6bd70933be195c538d6751e088f
Author: Christian Grothoff <address@hidden>
AuthorDate: Sat Nov 2 17:58:43 2019 +0100

    also propage timeout into curl
---
 src/lib/merchant_api_poll_payment.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/src/lib/merchant_api_poll_payment.c 
b/src/lib/merchant_api_poll_payment.c
index 84da443..069c5b7 100644
--- a/src/lib/merchant_api_poll_payment.c
+++ b/src/lib/merchant_api_poll_payment.c
@@ -204,6 +204,7 @@ TALER_MERCHANT_poll_payment (struct GNUNET_CURL_Context 
*ctx,
   char *h_contract_s;
   char *timeout_s;
   unsigned int ts;
+  long tlong;
 
   GNUNET_assert (NULL != backend_url);
   GNUNET_assert (NULL != order_id);
@@ -211,6 +212,12 @@ TALER_MERCHANT_poll_payment (struct GNUNET_CURL_Context 
*ctx,
                                                       sizeof (*h_contract));
   ts = (unsigned int) (timeout.rel_value_us
                        / GNUNET_TIME_UNIT_SECONDS.rel_value_us);
+  /* set curl timeout to *our* long poll timeout plus one minute
+     (for network latency and processing delays) */
+  tlong = (long) (GNUNET_TIME_relative_add (timeout,
+                                            GNUNET_TIME_UNIT_MINUTES).
+                  rel_value_us
+                  / GNUNET_TIME_UNIT_MILLISECONDS.rel_value_us);
   GNUNET_asprintf (&timeout_s,
                    "%u",
                    ts);
@@ -236,6 +243,13 @@ TALER_MERCHANT_poll_payment (struct GNUNET_CURL_Context 
*ctx,
     GNUNET_break (0);
     return NULL;
   }
+  if (CURLE_OK != curl_easy_setopt (eh,
+                                    CURLOPT_TIMEOUT_MS,
+                                    tlong))
+  {
+    GNUNET_break (0);
+    return NULL;
+  }
 
   GNUNET_log (GNUNET_ERROR_TYPE_INFO,
               "polling payment from %s\n",

-- 
To stop receiving notification emails like this one, please contact
address@hidden.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]