cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: timeout_ms not working on iphone

From: Goncalo Leal <gonleal_at_gmail.com>
Date: Sat, 25 Aug 2012 00:45:42 +0100

Sorry for so few details on the problem.

I'm using the libcurl 7.27.0 and i'm using the curl_easy_perform to do a
HTTP GET.

I've written a servlet in which i have a sleep of 30 seconds, so i can test
if the TIMEOUT_MS is currectly working in the client. I've collected the
verbose from both cases:

Here is available the verbose from a request which didn't timed out
(TIMEOUT_MS was set to 9000ms):

"HTTPClient | About to connect() to 172.18.0.56 port 8080 (#0)
HTTPClient | Trying 172.18.0.56...
HTTPClient | Connected to 172.18.0.56 (172.18.0.56) port 8080 (#0)
HTTPClient | Connected to 172.18.0.56 (172.18.0.56) port 8080 (#0)
HTTPClient | POST /Someservlet/SomeServlet HTTP/1.1

Host: 172.18.0.56:8080

User-Agent: Thinktwice UA

Content-Type: application/x-www-form-urlencoded

Accept: */*

Content-Length: 89

HTTPClient | Login=jackiechan&Pwd=6D24B0EE6EBE7C"

And here is available a verbose in which the timeout worked correctly
(TIMEOUT_MS set to 8000ms):

"HTTPClient | About to connect() to 172.18.0.56 port 8080 (#0)
HTTPClient | Trying 172.18.0.56...
HTTPClient | Connected to 172.18.0.56 (172.18.0.56) port 8080 (#0)
HTTPClient | Connected to 172.18.0.56 (172.18.0.56) port 8080 (#0)
HTTPClient | POST /Someservlet/SomeServlet HTTP/1.1

Host: 172.18.0.56:8080

User-Agent: Thinktwice UA

Content-Type: application/x-www-form-urlencoded

Accept: */*

Content-Length: 89

HTTPClient | Login=jackiechan&Pwd=6D24B0EE6EBE7C"

HTTPClient | Operation timed out after 8387 milliseconds with 0 out of -1
bytes received
HTTPClient | Closing connection #0

I don't think that the issue is related to the name resolver, since
this always work fine for values smaller than 8000ms.

Thanks,
Gonçalo

On 24 August 2012 22:39, Daniel Stenberg <daniel_at_haxx.se> wrote:

> On Fri, 24 Aug 2012, Goncalo Leal wrote:
>
> I'm using cURL in my iphone app and everything works perfectly except for
>> the CURL_TIMEOUT_MS, in fact a strange behavior is noticeable:
>>
>> If i set values <= 8000ms, it works perfectly, but if i set bigger
>> values, the timeout just doesn't occur.
>>
>> I've also set other types of Timeout such as CURL_CONNECTIONTIMEOUT_MS
>> and LOW_SPEED_TIME which work just fine.
>>
>> Any ideas why this is happening? I've thought that could be related to
>> IOS once i've not found any similar issue on the web.
>>
>
> You're leaving out so many details that would be next to impossible to
> tell. Like:
>
> Which libcurl version? What libcurl interface/function are you using?
>
> What's libcurl doing at the point (8000ms) into the transfer? (a verbose
> output would tell)
>
> Which protocol are you transferring at the time?
>
> Downloading or Uploading?
>
> I don't know iOS at all. I figure it is built to use the stock synchronous
> name resolver? Could it be a very slow name resolve that's going on?
>
> --
>
> / daniel.haxx.se
> ------------------------------**------------------------------**-------
> List admin: http://cool.haxx.se/list/**listinfo/curl-library<http://cool.haxx.se/list/listinfo/curl-library>
> Etiquette: http://curl.haxx.se/mail/**etiquette.html<http://curl.haxx.se/mail/etiquette.html>
>

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2012-08-25