~mvo/apt/mvo

« back to all changes in this revision

Viewing changes to methods/ftp.h

  • Committer: Michael Vogt
  • Date: 2011-11-10 15:32:52 UTC
  • mfrom: (1561.70.60 debian-experimental2)
  • Revision ID: michael.vogt@ubuntu.com-20111110153252-1u9lc3lm2cgb6b1m
merged from http://bzr.debian.org/bzr/apt/apt/debian-experimental2

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
#ifndef APT_FTP_H
11
11
#define APT_FTP_H
12
12
 
 
13
#include <apt-pkg/strutl.h>
 
14
 
 
15
#include <string>
 
16
 
13
17
class FTPConn
14
18
{
15
19
   char Buffer[1024*10];
33
37
   socklen_t ServerAddrLen;
34
38
   
35
39
   // Private helper functions
36
 
   bool ReadLine(string &Text);      
 
40
   bool ReadLine(std::string &Text);
37
41
   bool Login();
38
42
   bool CreateDataFd();
39
43
   bool Finalize();
43
47
   bool Comp(URI Other) {return Other.Host == ServerName.Host && Other.Port == ServerName.Port && Other.User == ServerName.User && Other.Password == ServerName.Password; };
44
48
   
45
49
   // Raw connection IO
46
 
   bool ReadResp(unsigned int &Ret,string &Text);
47
 
   bool WriteMsg(unsigned int &Ret,string &Text,const char *Fmt,...);
 
50
   bool ReadResp(unsigned int &Ret,std::string &Text);
 
51
   bool WriteMsg(unsigned int &Ret,std::string &Text,const char *Fmt,...);
48
52
   
49
53
   // Connection control
50
54
   bool Open(pkgAcqMethod *Owner);
53
57
   bool ExtGoPasv();
54
58
   
55
59
   // Query
56
 
   bool Size(const char *Path,unsigned long &Size);
 
60
   bool Size(const char *Path,unsigned long long &Size);
57
61
   bool ModTime(const char *Path, time_t &Time);
58
 
   bool Get(const char *Path,FileFd &To,unsigned long Resume,
 
62
   bool Get(const char *Path,FileFd &To,unsigned long long Resume,
59
63
            Hashes &MD5,bool &Missing);
60
64
   
61
65
   FTPConn(URI Srv);
65
69
class FtpMethod : public pkgAcqMethod
66
70
{
67
71
   virtual bool Fetch(FetchItem *Itm);
68
 
   virtual bool Configuration(string Message);
 
72
   virtual bool Configuration(std::string Message);
69
73
   
70
74
   FTPConn *Server;
71
75
   
72
 
   static string FailFile;
 
76
   static std::string FailFile;
73
77
   static int FailFd;
74
78
   static time_t FailTime;
75
79
   static void SigTerm(int);