cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Handling of timeouts on clock jump

From: Chad Monroe <cmonroe_at_occamnetworks.com>
Date: Wed, 05 May 2010 11:09:07 -0700

Dirk Manske wrote:
> On Wednesday 05 May 2010 19:26:59 Chad Monroe wrote:
>
>> I have an issue with libcurl 7.19.2 related to timeouts. At boot time my
>> device begins fetching files once networking is up. Another task which
>> runs in parallel is NTP. If NTP syncs during a file transfer this causes
>> a huge clock jump and libcurl immediately returns a timeout. Has this
>> been addressed in later versions of libcurl
>>
> I don't know, but ...
>
>> , and if not how do others
>> handle changes to the system clock?
>>
> .. I would say this not a problem of (lib)curl.
>
> Simply call ntpdate before starting fetching files.
>
> (Also you could save the current time with "hwclock --systohc" (maybe
> with --utc)at shutdown, than at next boot the time difference should
> be minimal otherwise your clock is badly broken)
> -------------------------------------------------------------------
> List admin: http://cool.haxx.se/list/listinfo/curl-library
> Etiquette: http://curl.haxx.se/mail/etiquette.html
>

I believe any app/library should handle a time of day jump without
issue. Note that our system does not have a hardware clock thus
synchronizing the hardware clock does nothing. The best we can do is set
the system clock to the build date at init time, then rely on NTP to get
our time of day clock.

As for calling NTP date and then fetching files, the config also comes
from a remote location. Once network connectivity is up the devices
fetches a config file. The config may have NTP information as well as
information on other configs to fetch. If the file contains both then
NTP may synchronize while the remaining configurations are fetched. Wed
can't pause execution of the entire system to wait for NTP to sync.

--
Chad Monroe
--
This email and any attachments thereto may contain private, 
confidential, and privileged material for the sole use of 
the intended recipient.  Any review, copying, or distribution 
of this email (or any attachments thereto) by others is strictly 
prohibited.  If you are not the intended recipient, please 
contact the sender immediately and permanently delete the 
original and any copies of this email and any attachments thereto.
Please consider the environment before printing this email

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