libzypp 17.35.9
zyppng::DetectMetalinkState Struct Reference

#include <zypp-curl/ng/network/private/downloaderstates/detectmeta_p.h>

Inheritance diagram for zyppng::DetectMetalinkState:

Public Types

using Request = DownloadPrivateBase::Request
 
- Public Types inherited from zyppng::Base
using Ptr = std::shared_ptr<Base>
 
using WeakPtr = std::weak_ptr<Base>
 

Public Member Functions

 DetectMetalinkState (DownloadPrivate &parent)
 
void enter ()
 
void exit ()
 
void onRequestStarted (NetworkRequest &)
 
void onRequestProgress (NetworkRequest &, off_t, off_t dlnow, off_t, off_t)
 
void onRequestFinished (NetworkRequest &req, const NetworkRequestError &err)
 
const NetworkRequestErrorerror () const
 
SignalProxy< void() > sigFinished ()
 
bool toMetalinkGuard () const
 
std::shared_ptr< DlMetaLinkInfoStatetoDlMetaLinkInfoState ()
 
bool toSimpleDownloadGuard () const
 
- Public Member Functions inherited from zyppng::BasicState< StatemachineType, isFin >
 BasicState (StatemachineType &sm)
 
 ~BasicState () override
 
 BasicState (BasicState &&) noexcept=default
 
BasicStateoperator= (BasicState &&) noexcept=default
 
StatemachineType & stateMachine ()
 
const StatemachineType & stateMachine () const
 
- 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 >, connectionconnectFunc (SenderFunc &&sFun, ReceiverFunc &&rFunc, const Tracker &...trackers)
 

Public Attributes

std::shared_ptr< Request_request
 

Private Attributes

NetworkRequestError _error
 
bool _gotMetalink = false
 
Signal< void() > _sigFinished
 

Additional Inherited Members

- Static Public Member Functions inherited from zyppng::Base
template<typename Obj , typename Functor >
static decltype(automake_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)
 
- Static Public Attributes inherited from zyppng::SimpleState< DownloadPrivate, Download::DetectMetaLink, false >
static constexpr auto stateId
 
- Static Public Attributes inherited from zyppng::BasicState< StatemachineType, isFin >
static constexpr bool isFinal = isFin
 
- Protected Member Functions inherited from zyppng::Base
 Base (BasePrivate &dd)
 
- Protected Attributes inherited from zyppng::Base
std::unique_ptr< BasePrivated_ptr
 

Detailed Description

State implementation for the metalink detection phase, this state issues a HEAD request while setting the magic "Accept: *\/\*, application/metalink+xml, application/metalink4+xml" header in the request to figure out if a metalink file is available or not.

In order to use metalink support the server needs to correctly return the metalink file content type, otherwise we proceed to not downloading a metalink file

Definition at line 37 of file detectmeta_p.h.

Member Typedef Documentation

◆ Request

Constructor & Destructor Documentation

◆ DetectMetalinkState()

zyppng::DetectMetalinkState::DetectMetalinkState ( DownloadPrivate & parent)

Definition at line 19 of file detectmeta_p.cc.

Member Function Documentation

◆ enter()

void zyppng::DetectMetalinkState::enter ( )

Definition at line 23 of file detectmeta_p.cc.

◆ exit()

void zyppng::DetectMetalinkState::exit ( )

Definition at line 44 of file detectmeta_p.cc.

◆ onRequestStarted()

void zyppng::DetectMetalinkState::onRequestStarted ( NetworkRequest & )

Definition at line 52 of file detectmeta_p.cc.

◆ onRequestProgress()

void zyppng::DetectMetalinkState::onRequestProgress ( NetworkRequest & ,
off_t ,
off_t dlnow,
off_t ,
off_t  )

Definition at line 57 of file detectmeta_p.cc.

◆ onRequestFinished()

void zyppng::DetectMetalinkState::onRequestFinished ( NetworkRequest & req,
const NetworkRequestError & err )

Definition at line 62 of file detectmeta_p.cc.

◆ error()

const NetworkRequestError & zyppng::DetectMetalinkState::error ( ) const
inline

Definition at line 51 of file detectmeta_p.h.

◆ sigFinished()

SignalProxy< void() > zyppng::DetectMetalinkState::sigFinished ( )
inline

Definition at line 55 of file detectmeta_p.h.

◆ toMetalinkGuard()

bool zyppng::DetectMetalinkState::toMetalinkGuard ( ) const
inline

Definition at line 59 of file detectmeta_p.h.

◆ toDlMetaLinkInfoState()

std::shared_ptr< DlMetaLinkInfoState > zyppng::DetectMetalinkState::toDlMetaLinkInfoState ( )

Definition at line 81 of file detectmeta_p.cc.

◆ toSimpleDownloadGuard()

bool zyppng::DetectMetalinkState::toSimpleDownloadGuard ( ) const

Definition at line 89 of file detectmeta_p.cc.

Member Data Documentation

◆ _request

std::shared_ptr<Request> zyppng::DetectMetalinkState::_request

Definition at line 71 of file detectmeta_p.h.

◆ _error

NetworkRequestError zyppng::DetectMetalinkState::_error
private

Definition at line 74 of file detectmeta_p.h.

◆ _gotMetalink

bool zyppng::DetectMetalinkState::_gotMetalink = false
private

Definition at line 75 of file detectmeta_p.h.

◆ _sigFinished

Signal< void () > zyppng::DetectMetalinkState::_sigFinished
private

Definition at line 76 of file detectmeta_p.h.


The documentation for this struct was generated from the following files: