14#ifndef ZYPP_NG_MEDIA_CURL_PRIVATE_REQUEST_P_H_INCLUDED
15#define ZYPP_NG_MEDIA_CURL_PRIVATE_REQUEST_P_H_INCLUDED
17#include <zypp-core/zyppng/base/private/base_p.h>
19#include <zypp-media/MediaException>
20#include <zypp-core/zyppng/base/Timer>
21#include <zypp-core/base/Regex.h>
25#include <zypp-core/Digest.h>
26#include <zypp-core/AutoDispose.h>
28#include <boost/optional.hpp>
109 auto ret = curl_easy_setopt(
_easyHandle, opt, data );
137 static int curlProgressCallback (
void *clientp, curl_off_t dltotal, curl_off_t dlnow, curl_off_t ultotal, curl_off_t ulnow );
139 size_t writeCallback (
char *ptr,
size_t size,
size_t nmemb );
141 std::unique_ptr< curl_slist,
decltype (&curl_slist_free_all) >
_headers;
158 struct prepareNextRangeBatch_t;
214 std::vector<char>
peek_data_fd ( FILE *fd, off_t offset,
size_t count );
Store and operate with byte count.
The NetworkRequestError class Represents a error that occured in.
enum zyppng::NetworkRequestPrivate::ProtocolMode _protocolMode
const std::string _currentCookieFile
zypp::Pathname _targetFile
void resetActivityTimer()
bool parseContentTypeMultiRangeHeader(const std::string_view &line, std::string &boundary)
Signal< void(NetworkRequest &req, zypp::ByteCount count)> _sigBytesDownloaded
NetworkRequestDispatcher * _dispatcher
std::vector< NetworkRequest::Range > _requestedRanges
the requested ranges that need to be downloaded
static int curlProgressCallback(void *clientp, curl_off_t dltotal, curl_off_t dlnow, curl_off_t ultotal, curl_off_t ulnow)
std::string errorMessage() const
Signal< void(NetworkRequest &req)> _sigStarted
NetworkRequest::FileMode _fMode
std::variant< pending_t, running_t, prepareNextRangeBatch_t, finished_t > _runningMode
bool initialize(std::string &errBuf)
void validateRange(NetworkRequest::Range &rng)
void onActivityTimeout(Timer &)
Signal< void(NetworkRequest &req, off_t dltotal, off_t dlnow, off_t ultotal, off_t ulnow)> _sigProgress
size_t writeCallback(char *ptr, size_t size, size_t nmemb)
NetworkRequest::Priority _priority
std::string _lastRedirect
to log/report redirections
NetworkRequest::Options _options
static constexpr int _rangeAttempt[]
bool prepareToContinue(std::string &errBuf)
bool prepareNextRangeBatch(std::string &errBuf)
size_t headerCallback(char *ptr, size_t size, size_t nmemb)
void setResult(NetworkRequestError &&err)
std::array< char, CURL_ERROR_SIZE+1 > _errorBuf
virtual ~NetworkRequestPrivate()
bool setupHandle(std::string &errBuf)
TransferSettings _settings
void setCurlOption(CURLoption opt, T data)
zypp::ByteCount _expectedFileSize
Signal< void(NetworkRequest &req, const NetworkRequestError &err)> _sigFinished
std::unique_ptr< curl_slist, decltype(&curl_slist_free_all) > _headers
bool checkIfRangeChkSumIsValid(const NetworkRequest::Range &rng)
bool parseContentRangeHeader(const std::string_view &line, size_t &start, size_t &len)
std::vector< char > peek_data_fd(FILE *fd, off_t offset, size_t count)
AutoDispose<FILE*> calling ::fclose
NetworkRequestError _result
zypp::ByteCount _contentLenght
bool _requireStatusPartial
bool _gotContentRangeHeader
bool _gotMultiRangeHeader
zypp::ByteCount _contentLenght
std::optional< NetworkRequestError > _cachedResult
bool _requireStatusPartial
std::vector< char > _rangePrefaceBuffer
Here we buffer.
std::string _seperatorString
The seperator string for multipart responses as defined in RFC 7233 Section 4.1.
std::optional< NetworkRequest::Range > _currentSrvRange
Timer::Ptr _activityTimer
#define ZYPP_THROW(EXCPT)
Drops a logline and throws the Exception.