~ubuntu-branches/debian/experimental/apt-cacher-ng/experimental

« back to all changes in this revision

Viewing changes to include/dlcon.h

  • Committer: Bazaar Package Importer
  • Author(s): Eduard Bloch
  • Date: 2011-08-01 23:40:11 UTC
  • mfrom: (1.1.29 upstream) (29.1.13 sid)
  • Revision ID: james.westby@ubuntu.com-20110801234011-2ouft5pay71773vs
Tags: 0.6.4-1
* New upstream version
  + fixes potential pipeline freeze (closes: #628995)
  + supports "soft" blacklisting of bad hosts when important files are
    missing (see keyfile in documentation, closes: #616091)

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
//#include <netinet/in.h>
11
11
//#include <netdb.h>
12
12
 
13
 
#include "tcpconnect.h"
 
13
//#include "tcpconnect.h"
14
14
 
15
15
#include "lockable.h"
16
16
#include "fileitem.h"
17
17
#include "acfg.h"
18
18
#include "acbuf.h"
19
19
 
20
 
class tDlJob;
21
 
 
22
 
 
23
 
class dlcon : public lockable, tcpconnect
 
20
struct tDlJob;
 
21
typedef SHARED_PTR<tDlJob> tDlJobPtr;
 
22
typedef MYSTD::list<tDlJobPtr> tDljQueue;
 
23
 
 
24
class dlcon : public lockable
24
25
25
26
    public:
26
27
        dlcon(bool bManualExecution, mstring *xff=NULL);
27
28
        ~dlcon();
28
 
                
 
29
 
29
30
        void WorkLoop();
30
31
        
31
32
        void SignalStop();
32
33
 
33
34
            void AddJob(tFileItemPtr m_pItem, tHttpUrl hi);
34
 
        void AddJob(tFileItemPtr m_pItem, 
35
 
                        acfg::tHostiVec *pBackends, const mstring & sPatSuffix);
 
35
        void AddJob(tFileItemPtr m_pItem, const acfg::tRepoData *pBackends,
 
36
                        const mstring & sPatSuffix);
36
37
        void EnqJob(tDlJob *);
37
38
 
38
39
        mstring m_sXForwardedFor;
39
 
        
 
40
 
40
41
    private:
41
 
        
42
 
        friend class tDlJob;
43
 
        
44
 
 
45
 
        MYSTD::list<tDlJob*> m_qToReceive;
 
42
 
 
43
        //not to be copied
 
44
        dlcon & operator=(const dlcon&);
 
45
        dlcon(const dlcon&);
 
46
        
 
47
        //friend class tDlJob;
 
48
        
 
49
        tDljQueue m_qNewjobs;
 
50
 
46
51
        int m_wakepipe[2];
47
 
        
48
 
        //mstring m_sConnectedHost; // used to remember to which host we are connected
49
52
 
50
 
        acbuf m_InBuf;
51
 
        
52
53
        // flags and local copies for input parsing
53
54
        /// remember being attached to an fitem
54
55
 
55
 
        bool m_bSingleRun;
56
 
            
57
 
        //MYSTD::set<tHttpUrl*> m_MirrorBlacklist;
58
 
        MYSTD::set<mstring> m_MirrorHostBlacklist;
59
 
 
60
 
        //not to be copied
61
 
        dlcon & operator=(const dlcon&);
62
 
        dlcon(const dlcon&);
 
56
        bool m_bStopASAP;
 
57
 
 
58
        UINT m_bManualMode;
 
59
 
 
60
        /// blacklist for permanently failing hosts, with error message
 
61
        MYSTD::map<MYSTD::pair<cmstring,cmstring>, mstring> m_blacklist;
 
62
        void BlacklistMirror(tDlJobPtr &failJob, cmstring &msg);
 
63
        bool SetupJobConfig(tDlJobPtr &job, mstring *pReasonMsg);
 
64
 
 
65
        tSS m_sendBuf, m_inBuf;
 
66
 
 
67
        UINT ExchangeData(mstring &sErrorMsg, int fd, tDljQueue &qActive);
 
68
 
63
69
};
64
70
 
65
 
typedef MYSTD::list<tDlJob*>::iterator dljIter; 
66
 
 
67
71
#endif
68
72
 
69
73