|
libzypp
17.35.12
|
#include <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 Types inherited from zyppng::Base | |
| using | Ptr = std::shared_ptr< Base > |
| using | WeakPtr = std::weak_ptr< Base > |
Public Member Functions | |
| ~Download () override | |
| 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 () |
Public Member Functions inherited from zyppng::Base | |
| Base () | |
| virtual | ~Base () |
| WeakPtr | parent () const |
| void | addChild (const Base::Ptr &child) |
| void | removeChild (const Ptr &child) |
| const std::unordered_set< Ptr > & | children () const |
| std::thread::id | threadId () const |
| template<typename T > | |
| std::vector< std::weak_ptr< T > > | findChildren () const |
| template<typename T > | |
| std::shared_ptr< T > | shared_this () const |
| template<typename T > | |
| std::shared_ptr< T > | shared_this () |
| template<typename T > | |
| std::weak_ptr< T > | weak_this () const |
| template<typename T > | |
| std::weak_ptr< T > | weak_this () |
| template<typename SenderFunc , typename ReceiverFunc > | |
| auto | connect (SenderFunc &&sFun, typename internal::MemberFunction< ReceiverFunc >::ClassType &recv, ReceiverFunc &&rFunc) |
| template<typename SenderFunc , typename ReceiverFunc , typename ... Tracker> | |
| std::enable_if_t< std::is_member_function_pointer_v< SenderFunc >, connection > | connectFunc (SenderFunc &&sFun, ReceiverFunc &&rFunc, const Tracker &...trackers) |
Private Member Functions | |
| Download (Downloader &parent, std::shared_ptr< NetworkRequestDispatcher > requestDispatcher, std::shared_ptr< MirrorControl > mirrors, DownloadSpec &&spec) | |
Friends | |
| class | zyppng::Downloader |
Additional Inherited Members | |
Static Public Member Functions inherited from zyppng::Base | |
| template<typename Obj , typename Functor > | |
| static decltype(auto) | make_base_slot (Obj *o, Functor &&f) |
| template<typename SenderFunc , typename ReceiverFunc > | |
| static auto | connect (typename internal::MemberFunction< SenderFunc >::ClassType &s, SenderFunc &&sFun, typename internal::MemberFunction< ReceiverFunc >::ClassType &recv, ReceiverFunc &&rFunc) |
| template<typename SenderFunc , typename ReceiverFunc , typename ... Tracker> | |
| static auto | connectFunc (typename internal::MemberFunction< SenderFunc >::ClassType &s, SenderFunc &&sFun, ReceiverFunc &&rFunc, const Tracker &...trackers) |
Protected Member Functions inherited from zyppng::Base | |
| Base (BasePrivate &dd) | |
Protected Attributes inherited from zyppng::Base | |
| std::unique_ptr< BasePrivate > | d_ptr |
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.
|
override |
Definition at line 206 of file downloader.cc.
|
private |
A download can only directly be created by the
Definition at line 200 of file downloader.cc.
| Download::State zyppng::Download::state | ( | ) | const |
Returns the current internal state of the Download
Definition at line 212 of file downloader.cc.
| NetworkRequestError zyppng::Download::lastRequestError | ( | ) | const |
Returns the last
Definition at line 220 of file downloader.cc.
| bool zyppng::Download::hasError | ( | ) | const |
Returns true if lastRequestError would return a valid NetworkRequestError
Definition at line 228 of file downloader.cc.
| std::string zyppng::Download::errorString | ( | ) | const |
Returns a readable reason why the download failed.
Definition at line 233 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 243 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 248 of file downloader.cc.
| void zyppng::Download::cancel | ( | ) |
Aborts the current download
Definition at line 270 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 276 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 281 of file downloader.cc.
| DownloadSpec & zyppng::Download::spec | ( | ) |
Returns a reference to the internally used download spec.
Definition at line 286 of file downloader.cc.
| const DownloadSpec & zyppng::Download::spec | ( | ) | const |
Definition at line 291 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 296 of file downloader.cc.
| zyppng::NetworkRequestDispatcher & zyppng::Download::dispatcher | ( | ) | const |
Returns a reference to the internally used
Definition at line 301 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 306 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 311 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 316 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 321 of file downloader.cc.
| SignalProxy< void(Download &req)> zyppng::Download::sigFinished | ( | ) |
Signals that the download finished.
Definition at line 326 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 331 of file downloader.cc.
|
friend |
Definition at line 265 of file downloader.h.