libzypp  11.13.5
zypp::media::multifetchworker Class Reference
Inheritance diagram for zypp::media::multifetchworker:

List of all members.

Public Member Functions

 multifetchworker (int no, multifetchrequest &request, const Url &url)
 ~multifetchworker ()
void nextjob ()
void run ()
bool checkChecksum ()
bool recheckChecksum ()
void disableCompetition ()
void checkdns ()
void adddnsfd (fd_set &rset, int &maxfd)
void dnsevent (fd_set &rset)

Public Attributes

int _workerno
int _state
bool _competing
size_t _blkno
off_t _blkstart
size_t _blksize
bool _noendrange
double _blkstarttime
size_t _blkreceived
off_t _received
double _avgspeed
double _maxspeed
double _sleepuntil

Private Member Functions

void stealjob ()
size_t writefunction (void *ptr, size_t size)
size_t headerfunction (char *ptr, size_t size)
- Private Member Functions inherited from zypp::media::MediaCurl
 ZYPP_DECLARE_FLAGS (RequestOptions, RequestOption)
 MediaCurl (const Url &url_r, const Pathname &attach_point_hint_r)
virtual ~MediaCurl ()
TransferSettingssettings ()
Url clearQueryString (const Url &url) const
virtual void attachTo (bool next=false)
 Call concrete handler to attach the media.
virtual void releaseFrom (const std::string &ejectDev)
 Call concrete handler to release the media.
virtual void getFile (const Pathname &filename) const
 Call concrete handler to provide file below attach point.
virtual void getDir (const Pathname &dirname, bool recurse_r) const
 Call concrete handler to provide directory content (not recursive!) below attach point.
virtual void getDirInfo (std::list< std::string > &retlist, const Pathname &dirname, bool dots=true) const
 Call concrete handler to provide a content list of directory on media via retlist.
virtual void getDirInfo (filesystem::DirContent &retlist, const Pathname &dirname, bool dots=true) const
 Basically the same as getDirInfo above.
virtual bool getDoesFileExist (const Pathname &filename) const
 Repeatedly calls doGetDoesFileExist() until it successfully returns, fails unexpectedly, or user cancels the operation.
virtual bool doGetDoesFileExist (const Pathname &filename) const
virtual void disconnectFrom ()
virtual void getFileCopy (const Pathname &srcFilename, const Pathname &targetFilename) const
virtual void doGetFileCopy (const Pathname &srcFilename, const Pathname &targetFilename, callback::SendReport< DownloadProgressReport > &_report, RequestOptions options=OPTION_NONE) const
virtual bool checkAttachPoint (const Pathname &apoint) const
 Verify if the specified directory as attach point (root) as requires by the particular media handler implementation.
void checkProtocol (const Url &url) const
 check the url is supported by the curl library
virtual void setupEasy ()
 initializes the curl easy handle with the data from the url
Url getFileUrl (const Pathname &filename) const
 concatenate the attach url and the filename to a complete download url
void evaluateCurlCode (const zypp::Pathname &filename, CURLcode code, bool timeout) const
 Evaluates a curl return code and throws the right MediaException filename Filename being downloaded code Code curl returnes timeout Whether we reached timeout, which we need to differentiate in case the codes aborted-by-callback or timeout are returned by curl Otherwise we can't differentiate abort from timeout.
void doGetFileCopyFile (const Pathname &srcFilename, const Pathname &dest, FILE *file, callback::SendReport< DownloadProgressReport > &_report, RequestOptions options=OPTION_NONE) const
- Private Member Functions inherited from zypp::media::MediaHandler
 MediaHandler (const Url &url_r, const Pathname &attach_point_r, const Pathname &urlpath_below_attachpoint_r, const bool does_download_r)
 If the concrete media handler provides a nonempty attach_point, it must be an existing directory.
virtual ~MediaHandler ()
 Contolling MediaAccess takes care, that attached media is released prior to deleting this.
bool downloads () const
 Hint if files are downloaded or not.
std::string protocol () const
 Protocol hint for MediaAccess.
Url url () const
 Url used.
void attach (bool next)
 Use concrete handler to attach the media.
virtual bool isAttached () const
 True if media is attached.
Pathname localRoot () const
 Return the local directory that corresponds to medias url, no matter if media isAttached or not.
Pathname localPath (const Pathname &pathname) const
 Files provided will be available at 'localPath(filename)'.
void disconnect ()
 Use concrete handler to isconnect media.
void release (const std::string &ejectDev="")
 Use concrete handler to release the media.
void provideFile (Pathname filename) const
 Use concrete handler to provide file denoted by path below 'localRoot'.
void provideFileCopy (Pathname srcFilename, Pathname targetFilename) const
 Call concrete handler to provide a copy of a file under a different place in the file system (usually not under attach point) as a copy.
void provideDir (Pathname dirname) const
 Use concrete handler to provide directory denoted by path below 'localRoot' (not recursive!).
void provideDirTree (Pathname dirname) const
 Use concrete handler to provide directory tree denoted by path below 'localRoot' (recursive!!).
void releaseFile (const Pathname &filename) const
 Remove filename below localRoot IFF handler downloads files to the local filesystem.
void releaseDir (const Pathname &dirname) const
 Remove directory tree below localRoot IFF handler downloads files to the local filesystem.
void releasePath (Pathname pathname) const
 Remove pathname below localRoot IFF handler downloads files to the local filesystem.
void setDeltafile (const Pathname &filename=Pathname()) const
Pathname deltafile () const
void dirInfo (std::list< std::string > &retlist, const Pathname &dirname, bool dots=true) const
 Return content of directory on media via retlist.
void dirInfo (filesystem::DirContent &retlist, const Pathname &dirname, bool dots=true) const
 Basically the same as dirInfo above.
bool doesFileExist (const Pathname &filename) const
 check if a file exists
virtual bool hasMoreDevices ()
 Check if the media has one more device available for attach(true).
virtual void getDetectedDevices (std::vector< std::string > &devices, unsigned int &index) const
 Fill in a vector of detected ejectable devices and the index of the currently attached device within the vector.

Static Private Member Functions

static size_t _writefunction (void *ptr, size_t size, size_t nmemb, void *stream)
static size_t _headerfunction (void *ptr, size_t size, size_t nmemb, void *stream)
- Static Private Member Functions inherited from zypp::media::MediaCurl
static void setCookieFile (const Pathname &)
static int progressCallback (void *clientp, double dltotal, double dlnow, double ultotal, double ulnow)
- Static Private Member Functions inherited from zypp::media::MediaHandler
static bool setAttachPrefix (const Pathname &attach_prefix)
static std::string getRealPath (const std::string &path)
static Pathname getRealPath (const Pathname &path)

Private Attributes

multifetchrequest_request
int _pass
string _urlbuf
off_t _off
size_t _size
Digest _dig
pid_t _pid
int _dnspipe

Friends

class multifetchrequest

Additional Inherited Members

- Private Types inherited from zypp::media::MediaCurl
enum  RequestOption {
  OPTION_NONE = 0x0, OPTION_RANGE = 0x1, OPTION_HEAD = 0x02, OPTION_NO_IFMODSINCE = 0x04,
  OPTION_NO_REPORT_START = 0x08
}
- Private Types inherited from zypp::media::MediaHandler
typedef shared_ptr< MediaHandlerPtr
typedef shared_ptr< const
MediaHandler
constPtr

Detailed Description

Definition at line 48 of file MediaMultiCurl.cc.


Constructor & Destructor Documentation

zypp::media::multifetchworker::multifetchworker ( int  no,
multifetchrequest request,
const Url url 
)

Definition at line 298 of file MediaMultiCurl.cc.

zypp::media::multifetchworker::~multifetchworker ( )

Definition at line 377 of file MediaMultiCurl.cc.


Member Function Documentation

void zypp::media::multifetchworker::nextjob ( )

Definition at line 695 of file MediaMultiCurl.cc.

void zypp::media::multifetchworker::run ( )

Definition at line 744 of file MediaMultiCurl.cc.

bool zypp::media::multifetchworker::checkChecksum ( )

Definition at line 551 of file MediaMultiCurl.cc.

bool zypp::media::multifetchworker::recheckChecksum ( )

Definition at line 560 of file MediaMultiCurl.cc.

void zypp::media::multifetchworker::disableCompetition ( )

Definition at line 676 of file MediaMultiCurl.cc.

void zypp::media::multifetchworker::checkdns ( )

Definition at line 425 of file MediaMultiCurl.cc.

void zypp::media::multifetchworker::adddnsfd ( fd_set &  rset,
int &  maxfd 
)

Definition at line 503 of file MediaMultiCurl.cc.

void zypp::media::multifetchworker::dnsevent ( fd_set &  rset)

Definition at line 513 of file MediaMultiCurl.cc.

void zypp::media::multifetchworker::stealjob ( )
private

Definition at line 583 of file MediaMultiCurl.cc.

size_t zypp::media::multifetchworker::writefunction ( void *  ptr,
size_t  size 
)
private

Definition at line 179 of file MediaMultiCurl.cc.

size_t zypp::media::multifetchworker::_writefunction ( void *  ptr,
size_t  size,
size_t  nmemb,
void *  stream 
)
staticprivate

Definition at line 241 of file MediaMultiCurl.cc.

size_t zypp::media::multifetchworker::headerfunction ( char *  ptr,
size_t  size 
)
private

Definition at line 248 of file MediaMultiCurl.cc.

size_t zypp::media::multifetchworker::_headerfunction ( void *  ptr,
size_t  size,
size_t  nmemb,
void *  stream 
)
staticprivate

Definition at line 292 of file MediaMultiCurl.cc.


Friends And Related Function Documentation

friend class multifetchrequest
friend

Definition at line 49 of file MediaMultiCurl.cc.


Member Data Documentation

int zypp::media::multifetchworker::_workerno

Definition at line 64 of file MediaMultiCurl.cc.

int zypp::media::multifetchworker::_state

Definition at line 66 of file MediaMultiCurl.cc.

bool zypp::media::multifetchworker::_competing

Definition at line 67 of file MediaMultiCurl.cc.

size_t zypp::media::multifetchworker::_blkno

Definition at line 69 of file MediaMultiCurl.cc.

off_t zypp::media::multifetchworker::_blkstart

Definition at line 70 of file MediaMultiCurl.cc.

size_t zypp::media::multifetchworker::_blksize

Definition at line 71 of file MediaMultiCurl.cc.

bool zypp::media::multifetchworker::_noendrange

Definition at line 72 of file MediaMultiCurl.cc.

double zypp::media::multifetchworker::_blkstarttime

Definition at line 74 of file MediaMultiCurl.cc.

size_t zypp::media::multifetchworker::_blkreceived

Definition at line 75 of file MediaMultiCurl.cc.

off_t zypp::media::multifetchworker::_received

Definition at line 76 of file MediaMultiCurl.cc.

double zypp::media::multifetchworker::_avgspeed

Definition at line 78 of file MediaMultiCurl.cc.

double zypp::media::multifetchworker::_maxspeed

Definition at line 79 of file MediaMultiCurl.cc.

double zypp::media::multifetchworker::_sleepuntil

Definition at line 81 of file MediaMultiCurl.cc.

multifetchrequest* zypp::media::multifetchworker::_request
private

Definition at line 92 of file MediaMultiCurl.cc.

int zypp::media::multifetchworker::_pass
private

Definition at line 93 of file MediaMultiCurl.cc.

string zypp::media::multifetchworker::_urlbuf
private

Definition at line 94 of file MediaMultiCurl.cc.

off_t zypp::media::multifetchworker::_off
private

Definition at line 95 of file MediaMultiCurl.cc.

size_t zypp::media::multifetchworker::_size
private

Definition at line 96 of file MediaMultiCurl.cc.

Digest zypp::media::multifetchworker::_dig
private

Definition at line 97 of file MediaMultiCurl.cc.

pid_t zypp::media::multifetchworker::_pid
private

Definition at line 99 of file MediaMultiCurl.cc.

int zypp::media::multifetchworker::_dnspipe
private

Definition at line 100 of file MediaMultiCurl.cc.


The documentation for this class was generated from the following file: