~ubuntu-branches/ubuntu/saucy/apt-cacher-ng/saucy

« back to all changes in this revision

Viewing changes to include/dlcon.h

  • Committer: Bazaar Package Importer
  • Author(s): Eduard Bloch
  • Date: 2011-08-07 17:53:21 UTC
  • mfrom: (24.2.14 sid)
  • Revision ID: james.westby@ubuntu.com-20110807175321-k80jrotzovldgu3c
* New upstream version
  + fixes various regressions
* removed dependency on libfuse2 (now used via dlopen, moved to Suggests)
* support new build-* targets in rules

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
#include "acfg.h"
18
18
#include "acbuf.h"
19
19
 
20
 
class tDlJob;
21
 
 
 
20
struct tDlJob;
 
21
typedef SHARED_PTR<tDlJob> tDlJobPtr;
 
22
typedef MYSTD::list<tDlJobPtr> tDljQueue;
22
23
 
23
24
class dlcon : public lockable
24
25
31
32
        void SignalStop();
32
33
 
33
34
            void AddJob(tFileItemPtr m_pItem, tHttpUrl hi);
34
 
        void AddJob(tFileItemPtr m_pItem, 
35
 
                        acfg::tRepoData *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
 
42
43
        //not to be copied
43
44
        dlcon & operator=(const dlcon&);
44
45
        dlcon(const dlcon&);
45
46
        
46
 
        friend class tDlJob;
 
47
        //friend class tDlJob;
47
48
        
48
 
        MYSTD::list<tDlJob*> m_qToReceive;
 
49
        tDljQueue m_qNewjobs;
 
50
 
49
51
        int m_wakepipe[2];
50
52
 
51
 
        acbuf m_InBuf;
52
 
        
53
53
        // flags and local copies for input parsing
54
54
        /// remember being attached to an fitem
55
55
 
56
 
        bool m_bStopWhenIdle;
57
 
 
58
 
        /// shared blacklist for bad hosts
59
 
        MYSTD::set<mstring> m_MirrorHostBlacklist;
60
 
 
61
 
        //! will establish the connection, keep its object pointer
62
 
        //! in m_pConnection and return its file descriptor (negative on failure)
63
 
//      int Connect(cmstring & sHostname, mstring &sErrOut);
 
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);
64
68
 
65
69
};
66
70
 
67
 
typedef MYSTD::list<tDlJob*>::iterator dljIter; 
68
 
 
69
71
#endif
70
72
 
71
73