cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: intermittent http put issue

From: Bill Hoffman <bill.hoffman_at_kitware.com>
Date: Sun, 14 Jun 2009 21:05:55 -0400

Daniel Stenberg wrote:
> On Thu, 11 Jun 2009, Bill Hoffman wrote:
>
>> Now, this works 99.9% of the time. However, once in a while curl just
>> hangs forever and the process does not stop. Any ideas on what would
>> cause that? If I add a global timeout it will stop it. However, since
>> I do not know how long it should take to send a file to the server, I
>> am hesitant to pick a number. Any ideas on how to debug would be helpful?
>
> I would start with doing strace or gdb -p to figure out exactly what
> libcurl does at the moment when it seems to hang.
>

I did catch it in gdb once, and put in some print statements.
Here is the code with the extra prints:

http://crab-lab.zool.ohiou.edu/kevin/transfer.c

It stays forever in this while loop:

while(!done) {
...
}

It prints this out:

timeout
readable descriptors
result = 0 done = 0
fd_write = CURL_SOCKET_BAD;
fd_read = conn->sockfd;
k->keepon &= ~KEEP_READ_HOLD;
timeout
readable descriptors
result = 0 done = 0
fd_write = CURL_SOCKET_BAD;
fd_read = conn->sockfd;
k->keepon &= ~KEEP_READ_HOLD;
timeout
readable descriptors
result = 0 done = 0
fd_write = CURL_SOCKET_BAD;
fd_read = conn->sockfd;
k->keepon &= ~KEEP_READ_HOLD;
timeout

>> Is there some sort of timeout based on response from the server?
>
> CURLOPT_LOW_SPEED_LIMIT and CURLOPT_LOW_SPEED_TIME perhaps?
>
Given the above, do you think these would help?

Thanks.

-Bill
Received on 2009-06-15