20 MIL <<
"Entering DetectMetalinkState for url: " << parent.
_spec.
url() << std::endl;
28 auto &sm = stateMachine();
29 const auto &url = sm._spec.url();
31 MIL_MEDIA <<
"Detecting if metalink is available on " << url << std::endl;
36 _request->transferSettings() = sm._spec.settings();
37 _request->transferSettings().addHeader(
"Accept: */*, application/metalink+xml, application/metalink4+xml");
41 sm._requestDispatcher->enqueue(
_request );
54 stateMachine()._sigStarted.emit( *stateMachine().z_func() );
59 stateMachine()._sigAlive.emit( *stateMachine().z_func(), dlnow );
64 auto lck = stateMachine().z_func()->shared_from_this();
66 WAR << req.
nativeHandle() <<
" " <<
"Detecing if metalink is possible for url " << req.
url() <<
" failed with error " << err.
toString() <<
" falling back to download without metalink." << std::endl;
76 _gotMetalink = ( cType.find(
"application/metalink+xml") == 0 || cType.find(
"application/metalink4+xml") == 0 );
84 auto nState = std::make_shared<DlMetaLinkInfoState>( std::move(
_request ), stateMachine() );
91#if ENABLE_ZCHUNK_COMPRESSION
98#if ENABLE_ZCHUNK_COMPRESSION
99 bool DetectMetalinkState::toZckHeadDownloadGuard()
const
104 std::shared_ptr<DLZckHeadState> DetectMetalinkState::toDLZckHeadState()
108 return std::make_shared<DLZckHeadState>( std::vector<Url> { stateMachine()._spec.url() }, stateMachine() );
112 auto nstate = std::make_shared<DLZckHeadState>( std::vector<Url> { stateMachine()._spec.url() }, std::move(
_request), stateMachine() );
The NetworkRequestError class Represents a error that occured in.
std::string toString() const
toString Returns a string representation of the error
bool isError() const
isError Will return true if this is a actual error
std::string contentType() const
Returns the content type as reported from the server.
bool hasError() const
Checks if there was a error with the request.
void * nativeHandle() const
const std::string & lastRedirectInfo() const
Url clearQueryString(const Url &url)