]> git.saurik.com Git - apt.git/blobdiff - methods/ftp.cc
Fixed up test dir WRT aliencode
[apt.git] / methods / ftp.cc
index a7fa8323303bb924608b8f29fe7ff4bff610877c..ac12d09131d20a1f61ffc7f0b978f2fa7e67e777 100644 (file)
@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description                                                         /*{{{*/
-// $Id: ftp.cc,v 1.17 1999/12/09 03:45:56 jgg Exp $
+// $Id: ftp.cc,v 1.19 2000/01/10 03:44:54 jgg Exp $
 /* ######################################################################
 
    HTTP Aquire Method - This is the FTP aquire method for APT.
@@ -498,18 +498,7 @@ bool FTPConn::ModTime(const char *Path, time_t &Time)
       return true;
    
    // Parse it
-   struct tm tm;
-   memset(&tm,0,sizeof(tm));   
-   if (sscanf(Msg.c_str(),"%4d%2d%2d%2d%2d%2d",&tm.tm_year,&tm.tm_mon,
-             &tm.tm_mday,&tm.tm_hour,&tm.tm_min,&tm.tm_sec) != 6)
-      return true;
-   
-   tm.tm_year -= 1900;
-   tm.tm_mon--;
-   
-   /* We use timegm from the GNU C library, libapt-pkg will provide this
-      symbol if it does not exist */
-   Time = timegm(&tm);
+   StrToTime(Msg,Time);
    return true;
 }
                                                                        /*}}}*/
@@ -825,6 +814,7 @@ bool FtpMethod::Fetch(FetchItem *Itm)
       {
         Res.Size = Buf.st_size;
         Res.LastModified = Buf.st_mtime;
+        Res.ResumePoint = Buf.st_size;
         URIDone(Res);
         return true;
       }
@@ -854,7 +844,6 @@ bool FtpMethod::Fetch(FetchItem *Itm)
         
         // Timestamp
         struct utimbuf UBuf;
-        time(&UBuf.actime);
         UBuf.actime = FailTime;
         UBuf.modtime = FailTime;
         utime(FailFile.c_str(),&UBuf);
@@ -874,7 +863,6 @@ bool FtpMethod::Fetch(FetchItem *Itm)
    
    // Timestamp
    struct utimbuf UBuf;
-   time(&UBuf.actime);
    UBuf.actime = FailTime;
    UBuf.modtime = FailTime;
    utime(Queue->DestFile.c_str(),&UBuf);