mirror not setting timestamps correctly

Albert Chin <[email protected]> Mon, 24 Jul 2006 08:36:34 -0500
Newsgroups gmane.network.lftp.devel
Message-ID <[email protected]>
We have a bug report from one of our customers. It seems lftp with the
mirror command does not set the timestamps of local files to match
those of the remote files. Both 3.3.4 and 3.5.1 seem to have this bug:
  These conditions must be:

  - the lftp client is configured to use an HTTP proxy (FTP over HTTP
    protocol), the configuration setup in ~/.lftp/rc:
      cache off
      debug
      set ftp:proxy http://my.http.proxy:3128
      set ftp:passive-mode true
      set http:cache false

  - the lftp client use the mirror command. The get command doesn't
    trigger the issue.

    lftp user@host:~> mirror -vvv -r --only-missing --continue \
                      --include-glob *.out
    Transferring file `itau20060201.out'
    ---- Connecting to proxy my.http.proxy (192.168.6.36) port 3128
    ---- Sending request...
    ---> GET ftp://user@remotehost/itau20060201.out;type=i HTTP/1.1
    ---> Host: remotehost
    ---> User-Agent: lftp/3.3.4
    ---> Authorization: Basic ZGw1NTYzODQ6OVc3SEJhUTY=
    ---> Connection: keep-alive
    --->
    <--- HTTP/1.0 200 OK
    <--- Mime-Version: 1.0
    <--- Date: Mon, 24 Jul 2006 12:38:33 GMT
    <--- Content-Type: application/octet-stream
    <--- Content-Length: 122967
    <--- Last-Modified: Mon, 24 Jul 2006 08:22:25 GMT

    This is the timestamp sent by the HTTP proxy, it is correct.

    ---- Http::HandleHeaderLine() Mon, 24 Jul 2006 08:22:25 GMT
    ---- Http::HandleHeaderLine() Mon Jul 24 08:22:25 2006

    This is extra debug I added. The first timestamp is the string passed
    to the strftime() conversion function, the second one is converted
    back from the UNIX epoch format. It's correct.

    <--- X-Cache: MISS from my.http.proxy
    <--- Proxy-Connection: keep-alive
    <---
    ---- Receiving body...
    ---- FileAccess::SetDate() Sat Jun 24 05:22:30 2006
    ---- Received all
    ---- FileAccess::SetDate() Sat Jun 24 05:22:30 2006

    This is also extra debug. As you can see, the SetDate() method is
    invoked with a modified timestamp. SetDate() sets the entity_date
    attribute of the FileAccess object.

    ---- LocalAccess::StoreStatus() Sat Jun 24 05:22:30 2006

    The final call, it sets the file mtime attribute by calling utime()
    with the entity_date as parameter.

-- 
albert chin ([email protected])