cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: "Server response timeout" after connected to FTP server

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Mon, 14 Nov 2011 11:16:01 -0800

On Mon, Nov 14, 2011 at 04:55:57PM +0100, Marcin Adamski wrote:
> I'm attaching simple program that reproduces this issue. This is 100% reproducable on Linux working on ARM platform (built with uclibc). I could not repeat it on Intel.

I'm able to repeat this using your code. The problem is related to the
CURLOPT_TIMEOUT option overflowing. Internally, this timeout is converted
to milliseconds so the timeout value in the code (1E+9, or 31.7 years)
overflows its 32 bit variable. On ARM, it becomes negative whereas on x86
it seems to overflow more conveniently.

Changing OP_TIMEOUT to 1000000 (11 days) fixes the problem.

This probably warrants some mention in the documentation; I suspect most of
the timeouts that accept seconds could overflow in the same way.

>>> Dan
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2011-11-14