Note that there are some explanatory texts on larger screens.

plurals
  1. POCurl not timing out properly
    primarykey
    data
    text
    <p>I have CURLOPT_CONNECTTIMEOUT_MS = 200 and CURLOPT_TIMEOUT_MS = 70 ms set. But my I am seeing CURLINFO_TOTAL_TIME to be around 220 ms. </p> <p>As per the libcurl doc, CURLOPT_TIMEOUT_MS includes connect timeout also. So basically my curl call total time should not take more than 70 ms. But why is it taking more return back the control?</p> <p>Can someone please explain this behavior.</p> <p>I am using curl 7.19_02 C++ library.</p> <p>Here is my code</p> <pre><code>CURL * curl; curl = curl_easy_init(); curl_easy_setopt(curl, CURLOPT_URL, url); curl_easy_setopt(curl,CURLOPT_CONNECTTIMEOUT_MS,200); curl_easy_setopt(curl,CURLOPT_TIMEOUT_MS,70); curl_easy_setopt(curl, CURLOPT_HEADER, 0); curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, writer); curl_easy_setopt(curl, CURLOPT_WRITEDATA, &amp;response); curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L); double tt = 0.0; double ns = 0.0; double ct = 0.0; double pt = 0.0; double st = 0.0; curl_easy_perform(curl); int curlRC = curl_easy_getinfo(curl, CURLINFO_TOTAL_TIME, &amp;tt); curlRC = curl_easy_getinfo(curl, CURLINFO_NAMELOOKUP_TIME, &amp;ns); curlRC = curl_easy_getinfo(curl, CURLINFO_CONNECT_TIME, &amp;ct); curlRC = curl_easy_getinfo(curl, CURLINFO_PRETRANSFER_TIME, &amp;pt); curlRC = curl_easy_getinfo(curl, CURLINFO_STARTTRANSFER_TIME, &amp;st); cout &lt;&lt; "Curl timing info: Total: " &lt;&lt; tt &lt;&lt; endl &lt;&lt; " Lookup: "&lt;&lt; ns &lt;&lt; endl &lt;&lt; " Connect: " &lt;&lt; ct &lt;&lt; "\n" &lt;&lt; "pre transfer: " &lt;&lt; pt &lt;&lt; endl &lt;&lt; "start transfer: " &lt;&lt; st &lt;&lt;endl; </code></pre> <p>The timing info I got is as below. Please check this out</p> <p>Curl timing info: Total: 0.216793 </p> <p>Lookup: 0.000999 </p> <p>Connect: 0.023199</p> <p>pre transfer: 0.023213</p> <p>start transfer: 0.216667</p> <p>So the point is, what is happening between pre transfer and start transfer? </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload