File: mirror.h

package info (click to toggle)
apt-cacher-ng 2-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 2,032 kB
  • ctags: 1,705
  • sloc: cpp: 16,869; sh: 536; ansic: 404; perl: 377; makefile: 124
file content (41 lines) | stat: -rw-r--r-- 863 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*
 * mirror.h
 *
 *  Created on: 25.11.2010
 *      Author: ed
 */

#ifndef MIRROR_H_
#define MIRROR_H_

#include "cacheman.h"

namespace acng
{
class pkgmirror: public cacheman
{
public:
	// XXX: for c++11... using tCacheOperation::tCacheOperation;
	inline pkgmirror(const tSpecialRequest::tRunParms& parms)
	: cacheman(parms) {};

	virtual ~pkgmirror() {};
	void Action() override;

protected:
	// FileHandler
	bool ProcessRegular(const mstring &sPath, const struct stat &) override;
	void HandlePkgEntry(const tRemoteFileInfo &entry);
	void _LoadKeyCache(const mstring & sFileName);

	bool m_bCalcSize=false, m_bDoDownload=false, m_bAsNeeded=false, m_bUseDelta=false;
	off_t m_totalSize=0, m_totalHave=0;
	tStrSet m_pathFilter;

	const tHttpUrl *m_pDeltaSrc=nullptr;
	tStrPos m_repCutLen=0;

	bool ConfigDelta(cmstring &sPathRel);
};
}
#endif /* MIRROR_H_ */