libzypp 17.31.23
|
#include </home/abuild/rpmbuild/BUILD/libzypp-17.31.23/zypp-curl/ng/network/downloader.h>
Public Types | |
enum | State { InitialState , DetectMetaLink , DlMetaLinkInfo , PrepareMulti , DlMetalink , DlZChunkHead , DlZChunk , DlSimple , Finished } |
using | Ptr = DownloadRef |
using | WeakPtr = DownloadWeakRef |
Public Member Functions | |
virtual | ~Download () |
State | state () const |
NetworkRequestError | lastRequestError () const |
bool | hasError () const |
std::string | errorString () const |
void | start () |
void | prioritize () |
void | cancel () |
void | setStopOnMetalink (const bool set=true) |
bool | stoppedOnMetalink () const |
DownloadSpec & | spec () |
const DownloadSpec & | spec () const |
uint64_t | lastAuthTimestamp () const |
NetworkRequestDispatcher & | dispatcher () const |
SignalProxy< void(Download &req)> | sigStarted () |
SignalProxy< void(Download &req, State state)> | sigStateChanged () |
SignalProxy< void(Download &req, off_t dlnow)> | sigAlive () |
SignalProxy< void(Download &req, off_t dltotal, off_t dlnow)> | sigProgress () |
SignalProxy< void(Download &req)> | sigFinished () |
SignalProxy< void(Download &req, NetworkAuthData &auth, const std::string &availAuth)> | sigAuthRequired () |
Private Member Functions | |
Download (Downloader &parent, std::shared_ptr< NetworkRequestDispatcher > requestDispatcher, std::shared_ptr< MirrorControl > mirrors, DownloadSpec &&spec) | |
Friends | |
class | zyppng::Downloader |
The Download class represents a possibly multipart download.
The Download class is a more high level interface compared to
Definition at line 126 of file downloader.h.
using zyppng::Download::Ptr = DownloadRef |
Definition at line 132 of file downloader.h.
using zyppng::Download::WeakPtr = DownloadWeakRef |
Definition at line 133 of file downloader.h.
The states of the internal state machine. Each of them represents a different stage of the lifetime of a Download.
Enumerator | |
---|---|
InitialState | |
DetectMetaLink | |
DlMetaLinkInfo | |
PrepareMulti | |
DlMetalink | |
DlZChunkHead | |
DlZChunk | |
DlSimple | |
Finished |
Definition at line 139 of file downloader.h.
|
virtual |
Definition at line 205 of file downloader.cc.
|
private |
A download can only directly be created by the
Definition at line 199 of file downloader.cc.
Download::State zyppng::Download::state | ( | ) | const |
Returns the current internal state of the Download
Definition at line 211 of file downloader.cc.
NetworkRequestError zyppng::Download::lastRequestError | ( | ) | const |
Returns the last
Definition at line 219 of file downloader.cc.
bool zyppng::Download::hasError | ( | ) | const |
Returns true if lastRequestError would return a valid NetworkRequestError
Definition at line 227 of file downloader.cc.
std::string zyppng::Download::errorString | ( | ) | const |
Returns a readable reason why the download failed.
Definition at line 232 of file downloader.cc.
void zyppng::Download::start | ( | ) |
Triggers the start of the download, this needs to be called in order for the statemachine to advance.
Definition at line 242 of file downloader.cc.
void zyppng::Download::prioritize | ( | ) |
This will raise all requests currenty in pending state to have NetworkRequest::Critial priority, which means they will be started even before requests with NetworkRequest::High priority.
Definition at line 247 of file downloader.cc.
void zyppng::Download::cancel | ( | ) |
Aborts the current download
Definition at line 269 of file downloader.cc.
void zyppng::Download::setStopOnMetalink | ( | const bool | set = true | ) |
This will finalize the download once a metalink file was received. This is a special setting used if the metalink file should be processed outside of the Downloader.
Definition at line 275 of file downloader.cc.
bool zyppng::Download::stoppedOnMetalink | ( | ) | const |
Returns true if the download was stopped after receiving metalink data. The target file will contain the metalink description.
Definition at line 280 of file downloader.cc.
DownloadSpec & zyppng::Download::spec | ( | ) |
Returns a reference to the internally used download spec.
Definition at line 285 of file downloader.cc.
const DownloadSpec & zyppng::Download::spec | ( | ) | const |
Definition at line 290 of file downloader.cc.
uint64_t zyppng::Download::lastAuthTimestamp | ( | ) | const |
Returns the timestamp of the last auth credentials that were loaded from the CredentialManager. If no credentials were tried, this returns 0
Definition at line 295 of file downloader.cc.
zyppng::NetworkRequestDispatcher & zyppng::Download::dispatcher | ( | ) | const |
Returns a reference to the internally used
Definition at line 300 of file downloader.cc.
SignalProxy< void(Download &req)> zyppng::Download::sigStarted | ( | ) |
Signals that the dispatcher dequeued the request and actually starts downloading data
Definition at line 305 of file downloader.cc.
SignalProxy< void(Download &req, Download::State state)> zyppng::Download::sigStateChanged | ( | ) |
Signals that the state of the Download has changed
Definition at line 310 of file downloader.cc.
SignalProxy< void(zyppng::Download &req, off_t dlnow)> zyppng::Download::sigAlive | ( | ) |
Signals that the download is alive but still in initial stage ( trying to figure out if metalink / zsync )
Definition at line 315 of file downloader.cc.
SignalProxy< void(Download &req, off_t dltotal, off_t dlnow)> zyppng::Download::sigProgress | ( | ) |
Signals if there was data read from the download
Definition at line 320 of file downloader.cc.
SignalProxy< void(Download &req)> zyppng::Download::sigFinished | ( | ) |
Signals that the download finished.
Definition at line 325 of file downloader.cc.
SignalProxy< void(zyppng::Download &req, zyppng::NetworkAuthData &auth, const std::string &availAuth)> zyppng::Download::sigAuthRequired | ( | ) |
Is emitted when a request requires authentication and it was not given or if auth failed. A connected slot should fill in the auth information in order to provide login credentials.
Definition at line 330 of file downloader.cc.
|
friend |
Definition at line 265 of file downloader.h.