14 : _evDispatcher(
zyppng::ThreadData::current().ensureDispatcher() )
15 , _nwDispatcher(
std::make_shared<
zyppng::NetworkRequestDispatcher>() )
26 bool firstAuth =
true;
28 int maxTries = req->transferSettings().maxSilentTries();
31 std::optional<internal::ProgressTracker> progTracker;
33 std::vector<zyppng::connection> signalConnections {
39 if ( !report || !progTracker )
42 progTracker->updateStats( dlTotal, dlNow );
43 if ( !(*report)->progress( progTracker->_dnlPercent, req.
url(), progTracker-> _drateTotal, progTracker->_drateLast ) )
54 std::for_each( signalConnections.begin(), signalConnections.end(), [](
auto &conn ) { conn.disconnect(); });
55 signalConnections.clear();
71 if ( req->hasError() ) {
73 std::exception_ptr excp;
74 const auto &error = req->error();
75 switch ( error.type() ) {
117 std::string authHint = error.extraInfoValue(
"authHint", std::string());
119 bool canContinue =
false;
120 _sigAuthRequired.emit( req->url(), req->transferSettings(), authHint, firstAuth, canContinue );
133 DBG <<
"BUG: Download error flag is set , but Error code is NoError" << std::endl;
143 if ( !retry && ( maxTries - 1 ) > 0 ) {
149 if ( report ) (*report)->finish( req->url(), errCode, error.toString() );
150 std::rethrow_exception( excp );
#define ZYPP_THROW(EXCPT)
Drops a logline and throws the Exception.
#define ZYPP_EXCPT_PTR(EXCPT)
Drops a logline and returns Exception as a std::exception_ptr.
The NetworkRequestError class Represents a error that occured in.
const zypp::Pathname & targetFilePath() const
Returns the target filename path.
Base class for Exception.
SignalProxy< void(NetworkRequest &req, const NetworkRequestError &err)> sigFinished()
Signals that the download finished.
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.