summaryrefslogtreecommitdiff
path: root/methods/ftp.cc
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2011-11-10 16:56:21 +0100
committerMichael Vogt <michael.vogt@ubuntu.com>2011-11-10 16:56:21 +0100
commit7cb543fb742a837c4931513674febaec5e4c1401 (patch)
treeddefe5b9329907818aa6eb3b593f555b29ccb869 /methods/ftp.cc
parentf6cb0880a4b5d31e398cceb2e2577b6b82f4fffb (diff)
parent71ecaad29d8066a494f516efc5efd80860653fe2 (diff)
merged from lp:~mvo/apt/mvo (that has all the changes from debian-experimental2) and resolved a bunch of conflicts
Diffstat (limited to 'methods/ftp.cc')
-rw-r--r--methods/ftp.cc17
1 files changed, 10 insertions, 7 deletions
diff --git a/methods/ftp.cc b/methods/ftp.cc
index eb7fedd85..2ca0ac6f7 100644
--- a/methods/ftp.cc
+++ b/methods/ftp.cc
@@ -15,11 +15,14 @@
##################################################################### */
/*}}}*/
// Include Files /*{{{*/
+#include <config.h>
+
#include <apt-pkg/fileutl.h>
#include <apt-pkg/acquire-method.h>
#include <apt-pkg/error.h>
#include <apt-pkg/hashes.h>
#include <apt-pkg/netrc.h>
+#include <apt-pkg/configuration.h>
#include <sys/stat.h>
#include <sys/time.h>
@@ -30,7 +33,6 @@
#include <errno.h>
#include <stdarg.h>
#include <iostream>
-#include <apti18n.h>
// Internet stuff
#include <netinet/in.h>
@@ -41,6 +43,7 @@
#include "rfc2553emu.h"
#include "connect.h"
#include "ftp.h"
+#include <apti18n.h>
/*}}}*/
using namespace std;
@@ -628,7 +631,7 @@ bool FTPConn::ExtGoPasv()
// FTPConn::Size - Return the size of a file /*{{{*/
// ---------------------------------------------------------------------
/* Grab the file size from the server, 0 means no size or empty file */
-bool FTPConn::Size(const char *Path,unsigned long &Size)
+bool FTPConn::Size(const char *Path,unsigned long long &Size)
{
// Query the size
unsigned int Tag;
@@ -638,7 +641,7 @@ bool FTPConn::Size(const char *Path,unsigned long &Size)
return false;
char *End;
- Size = strtol(Msg.c_str(),&End,10);
+ Size = strtoull(Msg.c_str(),&End,10);
if (Tag >= 400 || End == Msg.c_str())
Size = 0;
return true;
@@ -840,7 +843,7 @@ bool FTPConn::Finalize()
// ---------------------------------------------------------------------
/* This opens a data connection, sends REST and RETR and then
transfers the file over. */
-bool FTPConn::Get(const char *Path,FileFd &To,unsigned long Resume,
+bool FTPConn::Get(const char *Path,FileFd &To,unsigned long long Resume,
Hashes &Hash,bool &Missing)
{
Missing = false;
@@ -1003,7 +1006,7 @@ bool FtpMethod::Fetch(FetchItem *Itm)
// Get the files information
Status(_("Query"));
- unsigned long Size;
+ unsigned long long Size;
if (Server->Size(File,Size) == false ||
Server->ModTime(File,FailTime) == false)
{
@@ -1025,7 +1028,7 @@ bool FtpMethod::Fetch(FetchItem *Itm)
struct stat Buf;
if (stat(Itm->DestFile.c_str(),&Buf) == 0)
{
- if (Size == (unsigned)Buf.st_size && FailTime == Buf.st_mtime)
+ if (Size == (unsigned long long)Buf.st_size && FailTime == Buf.st_mtime)
{
Res.Size = Buf.st_size;
Res.LastModified = Buf.st_mtime;
@@ -1035,7 +1038,7 @@ bool FtpMethod::Fetch(FetchItem *Itm)
}
// Resume?
- if (FailTime == Buf.st_mtime && Size > (unsigned)Buf.st_size)
+ if (FailTime == Buf.st_mtime && Size > (unsigned long long)Buf.st_size)
Res.ResumePoint = Buf.st_size;
}