libzypp
17.35.16
|
#include <zypp-curl/ng/network/private/downloaderstates/rangedownloader_p.h>
Public Types | |
using | Request = DownloadPrivateBase::Request |
using | Block = DownloadPrivateBase::Block |
![]() | |
enum | PrepareResult { Failed, Ok, Delayed } |
![]() | |
using | Ptr = std::shared_ptr< Base > |
using | WeakPtr = std::weak_ptr< Base > |
Public Member Functions | |
RangeDownloaderBaseState (std::vector< Url > &&mirrors, DownloadPrivate &parent) | |
void | ensureDownloadsRunning () |
void | reschedule () |
const NetworkRequestError & | error () const |
void | setFailed (NetworkRequestError &&err) |
void | setFailed (std::string &&reason) |
virtual void | setFinished () |
void | cancelAll (const NetworkRequestError &err) |
void | onRequestStarted (NetworkRequest &) |
void | onRequestProgress (NetworkRequest &, off_t, off_t, off_t, off_t) |
void | onRequestFinished (NetworkRequest &req, const NetworkRequestError &err) |
void | mirrorReceived (MirrorControl::MirrorPick mirror) override |
void | failedToPrepare () override |
![]() | |
MirrorHandlingStateBase (DownloadPrivate &parent) | |
~MirrorHandlingStateBase () override | |
PrepareResult | prepareNextMirror () |
NetworkRequestError | setupMirror (const MirrorControl::MirrorPick &pick, Url &url, TransferSettings &set) |
![]() | |
BasicState (DownloadPrivate &sm) | |
BasicState (BasicState &&) noexcept=default | |
~BasicState () override | |
BasicState & | operator= (BasicState &&) noexcept=default |
DownloadPrivate & | stateMachine () |
const DownloadPrivate & | stateMachine () const |
![]() | |
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) |
Static Public Member Functions | |
static zypp::ByteCount | makeBlksize (size_t filesize) |
![]() | |
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 Attributes | |
NetworkRequestError | _error |
bool | _inEnsureDownloadsRunning = false |
size_t | _fileSize = 0 |
zypp::ByteCount | _preferredChunkSize = 0 |
std::list< Block > | _ranges |
std::list< Block > | _failedRanges |
off_t | _downloadedMultiByteCount = 0 |
std::vector< std::shared_ptr< Request > > | _runningRequests |
Signal< void() > | _sigFinished |
Signal< void() > | _sigFailed |
![]() | |
std::unique_ptr< BasePrivate > | d_ptr |
Private Member Functions | |
void | handleRequestError (std::shared_ptr< Request > req, const zyppng::NetworkRequestError &err) |
bool | addBlockRanges (const std::shared_ptr< Request > &req, const std::vector< Block > &blocks) const |
Just initialize the requests ranges from the internal blocklist. More... | |
void | addNewRequest (const std::shared_ptr< Request > &req, const bool connectSignals=true) |
bool | assertExpectedFilesize (off_t currentFilesize) |
std::vector< Block > | getNextBlocks (const std::string &urlScheme) |
std::vector< Block > | getNextFailedBlocks (const std::string &urlScheme) |
Additional Inherited Members | |
![]() | |
std::vector< Url > | _fileMirrors |
![]() | |
static constexpr bool | isFinal |
![]() | |
Base (BasePrivate &dd) | |
Generic state implementation for all states that download a file in blocks from a fixed set of mirrors.
Definition at line 27 of file rangedownloader_p.h.
Definition at line 29 of file rangedownloader_p.h.
Definition at line 30 of file rangedownloader_p.h.
|
inline |
Definition at line 32 of file rangedownloader_p.h.
void zyppng::RangeDownloaderBaseState::ensureDownloadsRunning | ( | ) |
Definition at line 164 of file rangedownloader_p.cc.
void zyppng::RangeDownloaderBaseState::reschedule | ( | ) |
Definition at line 274 of file rangedownloader_p.cc.
|
inline |
Definition at line 40 of file rangedownloader_p.h.
void zyppng::RangeDownloaderBaseState::setFailed | ( | NetworkRequestError && | err | ) |
Definition at line 336 of file rangedownloader_p.cc.
void zyppng::RangeDownloaderBaseState::setFailed | ( | std::string && | reason | ) |
Definition at line 344 of file rangedownloader_p.cc.
|
virtual |
Reimplemented in zyppng::DlMetalinkState.
Definition at line 349 of file rangedownloader_p.cc.
void zyppng::RangeDownloaderBaseState::cancelAll | ( | const NetworkRequestError & | err | ) |
Definition at line 355 of file rangedownloader_p.cc.
void zyppng::RangeDownloaderBaseState::onRequestStarted | ( | NetworkRequest & | ) |
Definition at line 21 of file rangedownloader_p.cc.
void zyppng::RangeDownloaderBaseState::onRequestProgress | ( | NetworkRequest & | , |
off_t | , | ||
off_t | , | ||
off_t | , | ||
off_t | |||
) |
Definition at line 24 of file rangedownloader_p.cc.
void zyppng::RangeDownloaderBaseState::onRequestFinished | ( | NetworkRequest & | req, |
const NetworkRequestError & | err | ||
) |
Definition at line 37 of file rangedownloader_p.cc.
|
overridevirtual |
This is called once a mirror became ready, either directly if a mirror is ready or it was delayed and called asynchronously
Implements zyppng::MirrorHandlingStateBase.
Definition at line 209 of file rangedownloader_p.cc.
|
overridevirtual |
Gets called in case a mirror failed to prepare, probably because none of the mirrors in _fileMirrors is known by MirrorControl
Reimplemented from zyppng::MirrorHandlingStateBase.
Definition at line 265 of file rangedownloader_p.cc.
|
static |
Definition at line 431 of file rangedownloader_p.cc.
|
private |
Definition at line 107 of file rangedownloader_p.cc.
|
private |
Just initialize the requests ranges from the internal blocklist.
Definition at line 312 of file rangedownloader_p.cc.
|
private |
Definition at line 287 of file rangedownloader_p.cc.
|
private |
Definition at line 299 of file rangedownloader_p.cc.
|
private |
Definition at line 367 of file rangedownloader_p.cc.
|
private |
Definition at line 395 of file rangedownloader_p.cc.
|
protected |
Definition at line 60 of file rangedownloader_p.h.
|
protected |
Definition at line 61 of file rangedownloader_p.h.
|
protected |
Definition at line 63 of file rangedownloader_p.h.
|
protected |
Definition at line 64 of file rangedownloader_p.h.
|
protected |
Definition at line 65 of file rangedownloader_p.h.
|
protected |
Definition at line 69 of file rangedownloader_p.h.
|
protected |
Definition at line 71 of file rangedownloader_p.h.
|
protected |
Definition at line 73 of file rangedownloader_p.h.
|
protected |
Definition at line 77 of file rangedownloader_p.h.
|
protected |
Definition at line 78 of file rangedownloader_p.h.