libzypp 17.31.23
zyppng::DownloadPrivateBase::Request Struct Reference

#include </home/abuild/rpmbuild/BUILD/libzypp-17.31.23/zypp-curl/ng/network/private/downloaderstates/base_p.h>

Inheritance diagram for zyppng::DownloadPrivateBase::Request:

Public Types

using Ptr = std::shared_ptr< Request >
 
using WeakPtr = std::shared_ptr< Request >
 
- Public Types inherited from zyppng::NetworkRequest
enum  State { Pending , Running , Finished , Error }
 
enum  Priority { Normal , High , Critical = 100 }
 
enum  FileMode { WriteExclusive , WriteShared }
 
enum  OptionBits { Default = 0x00 , HeadRequest = 0x01 , ConnectionTest = 0x02 }
 
using Ptr = std::shared_ptr< NetworkRequest >
 
using WeakPtr = std::weak_ptr< NetworkRequest >
 
using DigestPtr = std::shared_ptr< zypp::Digest >
 
using CheckSumBytes = UByteArray
 

Public Member Functions

template<typename Receiver >
void connectSignals (Receiver &dl)
 
void disconnectSignals ()
 
 NetworkRequest (Url url, zypp::Pathname targetFile, FileMode fMode=WriteExclusive)
 
- Public Member Functions inherited from zyppng::NetworkRequest
 ZYPP_DECLARE_FLAGS (Options, OptionBits)
 
 NetworkRequest (Url url, zypp::Pathname targetFile, FileMode fMode=WriteExclusive)
 
virtual ~NetworkRequest ()
 
void setExpectedFileSize (zypp::ByteCount expectedFileSize)
 
void setPriority (Priority prio, bool triggerReschedule=true)
 
Priority priority () const
 
void setOptions (Options opt)
 
Options options () const
 
void addRequestRange (size_t start, size_t len=0, DigestPtr digest=nullptr, CheckSumBytes expectedChkSum=CheckSumBytes(), std::any userData=std::any(), std::optional< size_t > digestCompareLen={}, std::optional< size_t > chksumpad={})
 
void addRequestRange (const Range &range)
 
void resetRequestRanges ()
 
std::vector< RangefailedRanges () const
 
const std::vector< Range > & requestedRanges () const
 
const std::string & lastRedirectInfo () const
 
void * nativeHandle () const
 
std::optional< Timingstimings () const
 After the request is finished query the timings that were collected during download.
 
std::vector< char > peekData (off_t offset, size_t count) const
 
Url url () const
 
void setUrl (const Url &url)
 This will change the URL of the request.
 
const zypp::PathnametargetFilePath () const
 Returns the target filename path.
 
void setTargetFilePath (const zypp::Pathname &path)
 Changes the target file path of the download.
 
FileMode fileOpenMode () const
 Returns the currently configured file open mode.
 
void setFileOpenMode (FileMode mode)
 Sets the file open mode to mode.
 
std::string contentType () const
 Returns the content type as reported from the server.
 
zypp::ByteCount reportedByteCount () const
 Returns the number of bytes that are reported from the backend as the full download size, those can be 0 even when the download is already running.
 
zypp::ByteCount downloadedByteCount () const
 Returns the number of already downloaded bytes as reported by the backend.
 
TransferSettingstransferSettings ()
 
State state () const
 Returns the current state the HttpDownloadRequest is in.
 
NetworkRequestError error () const
 Returns the last set Error.
 
std::string extendedErrorString () const
 In some cases, curl can provide extended error information collected at runtime.
 
bool hasError () const
 Checks if there was a error with the request.
 
bool addRequestHeader (const std::string &header)
 
SignalProxy< void(NetworkRequest &req)> sigStarted ()
 Signals that the dispatcher dequeued the request and actually starts downloading data.
 
SignalProxy< void(NetworkRequest &req, zypp::ByteCount count)> sigBytesDownloaded ()
 Signals that new data has been downloaded, this is only the payload and does not include control data bytes.
 
SignalProxy< void(NetworkRequest &req, off_t dltotal, off_t dlnow, off_t ultotal, off_t ulnow)> sigProgress ()
 Signals if there was data read from the download.
 
SignalProxy< void(NetworkRequest &req, const NetworkRequestError &err)> sigFinished ()
 Signals that the download finished.
 

Public Attributes

time_t _authTimestamp = 0
 
Url _originalUrl
 
MirrorControl::MirrorHandle _myMirror
 
connection _sigStartedConn
 
connection _sigProgressConn
 
connection _sigFinishedConn
 

Detailed Description

Definition at line 60 of file base_p.h.

Member Typedef Documentation

◆ Ptr

Definition at line 63 of file base_p.h.

◆ WeakPtr

Definition at line 64 of file base_p.h.

Member Function Documentation

◆ connectSignals()

template<typename Receiver >
void zyppng::DownloadPrivateBase::Request::connectSignals ( Receiver &  dl)
inline

Definition at line 67 of file base_p.h.

◆ disconnectSignals()

void zyppng::DownloadPrivateBase::Request::disconnectSignals ( )

Definition at line 104 of file downloader.cc.

◆ NetworkRequest()

zyppng::NetworkRequest::NetworkRequest ( Url  url,
zypp::Pathname  targetFile,
FileMode  fMode = WriteExclusive 
)
Parameters
urlThe source URL of the download
targetFileThe path where the file should be stored
fModeThe mode in which the file is opened in.

Definition at line 110 of file request.cc.

Member Data Documentation

◆ _authTimestamp

time_t zyppng::DownloadPrivateBase::Request::_authTimestamp = 0

Definition at line 74 of file base_p.h.

◆ _originalUrl

Url zyppng::DownloadPrivateBase::Request::_originalUrl

Definition at line 75 of file base_p.h.

◆ _myMirror

MirrorControl::MirrorHandle zyppng::DownloadPrivateBase::Request::_myMirror

Definition at line 76 of file base_p.h.

◆ _sigStartedConn

connection zyppng::DownloadPrivateBase::Request::_sigStartedConn

Definition at line 78 of file base_p.h.

◆ _sigProgressConn

connection zyppng::DownloadPrivateBase::Request::_sigProgressConn

Definition at line 79 of file base_p.h.

◆ _sigFinishedConn

connection zyppng::DownloadPrivateBase::Request::_sigFinishedConn

Definition at line 80 of file base_p.h.


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