25 MIL <<
"Downloading metalink/zsync on " << parent.
_spec.
url() << std::endl;
31 MIL <<
"Downloading metalink/zsync on " << parent.
_spec.
url() << std::endl;
36 MIL <<
"Downloading on " << stateMachine()._spec.url() <<
" transition to final state. " << std::endl;
37 return std::make_shared<FinishedState>( std::move(
_error), stateMachine() );
44 auto nState = std::make_shared<PrepareMultiState>( std::move(
_request ), prepareMode, stateMachine() );
51 MIL <<
"Requesting Metadata info from server!" << std::endl;
52 r->transferSettings().addHeader(
"Accept: */*, application/x-zsync, application/metalink+xml, application/metalink4+xml");
64 MIL <<
"Downloading on " << stateMachine()._spec.url() <<
" was successful, no metalink/zsync data. " << std::endl;
68 auto &sm = stateMachine();
69 if ( sm._stopOnMetalink ) {
70 MIL <<
"Stopping after receiving MetaData as requested" << std::endl;
71 sm._stoppedOnMetalink =
true;
77 MIL <<
"Downloading on " << sm._spec.url() <<
" returned a Zsync file " << std::endl;
79 MIL <<
"Downloading on " << sm._spec.url() <<
" returned a Metalink file" << std::endl;
85 auto &sm = stateMachine();
89 return sm._sigAlive.emit( *sm.z_func(), dlnow );
94 if ( cType.find(
"application/x-zsync") == 0 )
96 else if ( cType.find(
"application/metalink+xml") == 0 || cType.find(
"application/metalink4+xml") == 0 )
107 WAR <<
"Metadata file exceeds 2MB in filesize, aborting."<<std::endl;
112 return sm._sigAlive.emit( *sm.z_func(), dlnow );
Store and operate with byte count.
zypp::ByteCount downloadedByteCount() const
Returns the number of already downloaded bytes as reported by the backend.
NetworkRequestError _error
static const Unit MB
1000^2 Byte
virtual void gotFinished()
std::vector< char > peekData(off_t offset, size_t count) const
std::shared_ptr< Request > _request
virtual void handleRequestProgress(NetworkRequest &req, off_t dltotal, off_t dlnow)
virtual bool initializeRequest(std::shared_ptr< Request > &r)
std::string contentType() const
Returns the content type as reported from the server.
static zyppng::NetworkRequestError customError(NetworkRequestError::Type t, std::string &&errorMsg="", std::map< std::string, boost::any > &&extraInfo={})