cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: Timeout & crash Issue

From: <Gunn_Fergal_at_emc.com>
Date: Tue, 23 Mar 2004 12:47:05 -0000

Daniel, I am after noticing what is happenning. I put a loop in the
CURLOPT_WRITEFUNCTION - curl_write_hook() method. What I am seeing is that
the code is executing right through and not interrupting it
once the timeout is reached. On return from the curl_write_hook() method it
is returning with an error stating that there had been a timeout, see my log
file timings and error at the end, my timeout is 4 seconds.

CNN 12:35:30 C T T 40404 (15.27 MB) [Agent] => before curl_easy_perform
CNN 12:35:30 C T T 40404 (15.27 MB) [Agent] => before loop in
curl_write_hook()
CNN 12:35:38 C T T 40404 (15.27 MB) [Agent] => after loop in
curl_write_hook()
CNN 12:35:38 C T T 40404 (15.27 MB) [Agent] => after curl_easy_perform
CNN 12:35:38 C T T 40404 (15.27 MB) [Agent] => GetXmlData Error
occurred in the curl_easy_perform - >
         - Operation timed out with 858 out of 858 bytes received

Basically, it seems unable to interrupt outside the libcurl code but it
knows that there had been a timeout and returns an error to state as much.
It might now
be up to me to write my own timeout code in the curl_write_hook() callback.
Can you think of another way around this??

Fergal.

 

On Tue, 23 Mar 2004 Gunn_Fergal_at_emc.com
<mailto:Gunn_Fergal_at_emc.com?Subject=RE:%20Timeout%20&%20crash%20Issue>
wrote:

> My OS version is Windows 2000 Pro

Ah, then I guess my strace/gdb suggestions were in vain. I have no idea if
or
how you can figure out what a hanging process is doing on Windows.

> The problem is very hard to reproduce, therefore debug, as it is dependent

> on another service, I have no control over, not behaving correctly. I am
> going to try and dummy a timeout by putting looping code or a wait in the
> curl_write_hook() method.

If the code "hangs" in a callback called from libcurl, then libcurl won't
timeout properly. It only times out its own operations.

> Will curl_easy_perform return after "timeout" seconds if it is in a wait
or
> looping?

The CURLOPT_TIMEOUT is unconditional and should return after the given time
no
matter what it is currently doing.

-- 
Received on 2004-03-23