cURL / Mailing Lists / curl-library / Single Mail


Re: [ curl-Patches-831843 ] Add --head support for file: protocol

From: Daniel Stenberg <>
Date: Fri, 31 Oct 2003 22:40:18 +0100 (CET)

On Thu, 30 Oct 2003, David Hull wrote:

> According to some (non-definitive) information I found through google, the
> ftp MDTM command returns the time in UTC (and this is true of our ftp
> server).

Well, it certainly makes sense. Let's go with that assumption.

> I'm wrong, ftp.c is OK for "--head".
> The ftp_getfiletime gets the files modification time using MDTM, but
> calls curl_getdate without specifying a time zone, so apparently the
> local time zone is assumed. Then, in ftp_perform, localtime is used
> to convert into a struct tm, but the strftime format string specifies
> "GMT". The two "mistakes" cancel out.
> It seems to me like both ftp_getfiletime and ftp_perform should be
> changed to use UTC. However, I'm not sure if this would break the

Thanks for your clues, they matched my thinking pretty much.

I've changed both of them now. As keeping the former functionality was wrong,
and I think fixing it is the right thing to do even if it breaks someone's
existing time-condition.

 Daniel Stenberg -- curl: been grokking URLs since 1998
This email is sponsored by: Giveback Program.
Does help you be more productive?  Does it
help you create better code?   SHARE THE LOVE, and help us help
YOU!  Click Here:
Received on 2003-10-31