libzypp 17.36.7

provideitem.cc
Go to the documentation of this file.
1/*---------------------------------------------------------------------\
2| ____ _ __ __ ___ |
3| |__ / \ / / . \ . \ |
4| / / \ V /| _/ _/ |
5| / /__ | | | | | | |
6| /_____||_| |_| |_| |
7| |
8\---------------------------------------------------------------------*/
9
10#include "private/providedbg_p.h"
11#include "private/provideitem_p.h"
12#include "private/provide_p.h"
13#include "private/providemessage_p.h"
14#include "private/provideres_p.h"
15#include "provide-configvars.h"
16#include <zypp-media/MediaException>
17#include <zypp-core/base/UserRequestException>
18#include "mediaverifier.h"
19#include <zypp-core/fs/PathInfo.h>
20
21 using namespace std::literals;
22
23 namespace zyppng {
24
25 static constexpr std::string_view DEFAULT_MEDIA_VERIFIER("SuseMediaV1");
26
27 expected<ProvideRequestRef> ProvideRequest::create(ProvideItem &owner, const std::vector<zypp::Url> &urls, const std::string &id, ProvideMediaSpec &spec )
28 {
29 if ( urls.empty() )
30 return expected<ProvideRequestRef>::error( ZYPP_EXCPT_PTR ( zypp::media::MediaException("List of URLs can not be empty") ) );
31
32 auto m = ProvideMessage::createAttach( ProvideQueue::InvalidId, urls.front(), id, spec.label() );
33 if ( !spec.mediaFile().empty() ) {
34 m.setValue( AttachMsgFields::VerifyType, std::string(DEFAULT_MEDIA_VERIFIER.data()) );
35 m.setValue( AttachMsgFields::VerifyData, spec.mediaFile().asString() );
36 m.setValue( AttachMsgFields::MediaNr, int32_t(spec.medianr()) );
37 }
38
39 const auto &cHeaders = spec.customHeaders();
40 for ( auto i = cHeaders.beginList (); i != cHeaders.endList(); i++) {
41 for ( const auto &val : i->second )
42 m.addValue( i->first, val );
43 }
44
45 return expected<ProvideRequestRef>::success( ProvideRequestRef( new ProvideRequest(&owner, urls, std::move(m))) );
46 }
47
48 expected<ProvideRequestRef> ProvideRequest::create( ProvideItem &owner, const std::vector<zypp::Url> &urls, ProvideFileSpec &spec )
49 {
50 if ( urls.empty() )
51 return expected<ProvideRequestRef>::error( ZYPP_EXCPT_PTR ( zypp::media::MediaException("List of URLs can not be empty") ) );
52
53 auto m = ProvideMessage::createProvide ( ProvideQueue::InvalidId, urls.front() );
54 const auto &destFile = spec.destFilenameHint();
55 const auto &deltaFile = spec.deltafile();
56 const int64_t fSize = spec.downloadSize();;
57
58 if ( !destFile.empty() )
59 m.setValue( ProvideMsgFields::Filename, destFile.asString() );
60 if ( !deltaFile.empty() )
61 m.setValue( ProvideMsgFields::DeltaFile, deltaFile.asString() );
62 if ( fSize )
63 m.setValue( ProvideMsgFields::ExpectedFilesize, fSize );
64 m.setValue( ProvideMsgFields::CheckExistOnly, spec.checkExistsOnly() );
65
66 const auto &cHeaders = spec.customHeaders();
67 for ( auto i = cHeaders.beginList (); i != cHeaders.endList(); i++) {
68 for ( const auto &val : i->second )
69 m.addValue( i->first, val );
70 }
71
72 return expected<ProvideRequestRef>::success( ProvideRequestRef( new ProvideRequest(&owner, urls, std::move(m)) ) );
73 }
74
75 expected<ProvideRequestRef> ProvideRequest::createDetach( const zypp::Url &url )
76 {
77 auto m = ProvideMessage::createDetach ( ProvideQueue::InvalidId , url );
78 return expected<ProvideRequestRef>::success( ProvideRequestRef( new ProvideRequest( nullptr, { url }, std::move(m) ) ) );
79 }
80
81 ZYPP_IMPL_PRIVATE(ProvideItem);
82
83 ProvideItem::ProvideItem( ProvidePrivate &parent )
84 : Base( *new ProvideItemPrivate( parent, *this ) )
85 { }
86
87 ProvideItem::~ProvideItem()
88 { }
89
90 ProvidePrivate &ProvideItem::provider()
91 {
92 return d_func()->_parent;
93 }
94
95 bool ProvideItem::safeRedirectTo( ProvideRequestRef startedReq, const zypp::Url &url )
96 {
97 if ( !canRedirectTo( startedReq, url ) )
98 return false;
99
100 redirectTo( startedReq, url );
101 return true;
102 }
103
104 void ProvideItem::redirectTo( ProvideRequestRef startedReq, const zypp::Url &url )
105 {
106 //@TODO strip irrelevant stuff from URL
107 startedReq->_pastRedirects.push_back ( url );
108 }
109
110 bool ProvideItem::canRedirectTo( ProvideRequestRef startedReq, const zypp::Url &url )
111 {
112 // make sure there is no redirect loop
113 if ( !startedReq->_pastRedirects.size() )
114 return true;
115
116 if ( std::find( startedReq->_pastRedirects.begin(), startedReq->_pastRedirects.end(), url ) != startedReq->_pastRedirects.end() )
117 return false;
118
119 return true;
120 }
121
122 const std::optional<ProvideItem::ItemStats> &ProvideItem::currentStats() const
123 {
124 return d_func()->_currStats;
125 }
126
127 const std::optional<ProvideItem::ItemStats> &ProvideItem::previousStats() const
128 {
129 return d_func()->_prevStats;
130 }
131
132 std::chrono::steady_clock::time_point ProvideItem::startTime() const
133 {
134 return d_func()->_itemStarted;
135 }
136
137 std::chrono::steady_clock::time_point ProvideItem::finishedTime() const {
138 return d_func()->_itemFinished;
139 }
140
141 void ProvideItem::pulse ()
142 {
143 Z_D();
144 if ( d->_currStats )
145 d->_prevStats = d->_currStats;
146
147 d->_currStats = makeStats();
148
149 // once the item is finished the pulse time is always the finish time
150 if ( d->_itemState == Finished )
151 d->_currStats->_pulseTime = d->_itemFinished;
152 }
153
154 zypp::ByteCount ProvideItem::bytesExpected () const
155 {
156 return 0;
157 }
158
159 ProvideItem::ItemStats ProvideItem::makeStats ()
160 {
161 return ItemStats {
162 ._pulseTime = std::chrono::steady_clock::now(),
163 ._runningRequests = _runningReq ? (uint)1 : (uint)0
164 };
165 }
166
167 void ProvideItem::informalMessage ( ProvideQueue &, ProvideRequestRef req, const ProvideMessage &msg )
168 {
169 if ( req != _runningReq ) {
170 WAR << "Received event for unknown request, ignoring" << std::endl;
171 return;
172 }
173
174 if ( msg.code() == ProvideMessage::Code::ProvideStarted ) {
175 MIL << "Request: "<< req->url() << " was started" << std::endl;
176 }
177
178 }
179
180 void ProvideItem::cacheMiss( ProvideRequestRef req )
181 {
182 if ( req != _runningReq ) {
183 WAR << "Received event for unknown request, ignoring" << std::endl;
184 return;
185 }
186
187 MIL << "Request: "<< req->url() << " CACHE MISS, request will be restarted by queue." << std::endl;
188 }
189
190 void ProvideItem::finishReq(ProvideQueue &, ProvideRequestRef finishedReq, const ProvideMessage &msg )
191 {
192 if ( finishedReq != _runningReq ) {
193 WAR << "Received event for unknown request, ignoring" << std::endl;
194 return;
195 }
196
197 auto log = provider().log();
198
199 // explicitely handled codes
200 const auto code = msg.code();
201 if ( code == ProvideMessage::Code::Redirect ) {
202
203 // remove the old request
204 _runningReq.reset();
205
206 try {
207
208 MIL << "Request finished with redirect." << std::endl;
209
210 zypp::Url newUrl( msg.value( RedirectMsgFields::NewUrl ).asString() );
211 if ( !safeRedirectTo( finishedReq, newUrl ) ) {
212 cancelWithError( ZYPP_EXCPT_PTR ( zypp::media::MediaException("Redirect Loop")) );
213 return;
214 }
215
216 MIL << "Request redirected to: " << newUrl << std::endl;
217
218 if ( log ) log->requestRedirect( *this, msg.requestId(), newUrl );
219
220 finishedReq->setUrl( newUrl );
221
222 if ( !enqueueRequest( finishedReq ) ) {
223 cancelWithError( ZYPP_EXCPT_PTR(zypp::media::MediaException("Failed to queue request")) );
224 }
225 } catch ( ... ) {
226 cancelWithError( std::current_exception() );
227 return;
228 }
229 return;
230
231 } else if ( code == ProvideMessage::Code::Metalink ) {
232
233 // remove the old request
234 _runningReq.reset();
235
236 MIL << "Request finished with mirrorlist from server." << std::endl;
237
238 //@TODO do we need to merge this with the mirrorlist we got from the user?
239 // or does a mirrorlist from d.o.o invalidate that?
240
241 std::vector<zypp::Url> urls;
242 const auto &mirrors = msg.values( MetalinkRedirectMsgFields::NewUrl );
243 for( auto i = mirrors.cbegin(); i != mirrors.cend(); i++ ) {
244 try {
245 zypp::Url newUrl( i->asString() );
246 if ( !canRedirectTo( finishedReq, newUrl ) )
247 continue;
248 urls.push_back ( newUrl );
249 } catch ( ... ) {
250 if ( i->isString() )
251 WAR << "Received invalid URL from worker: " << i->asString() << " ignoring!" << std::endl;
252 else
253 WAR << "Received invalid value for newUrl from worker ignoring!" << std::endl;
254 }
255 }
256
257 if ( urls.size () == 0 ) {
258 cancelWithError( ZYPP_EXCPT_PTR ( zypp::media::MediaException("No mirrors left to redirect to.")) );
259 return;
260 }
261
262 MIL << "Found usable nr of mirrors: " << urls.size () << std::endl;
263 finishedReq->setUrls( urls );
264
265 // disable metalink
266 finishedReq->provideMessage().setValue( ProvideMsgFields::MetalinkEnabled, false );
267
268 if ( log ) log->requestDone( *this, msg.requestId() );
269
270 if ( !enqueueRequest( finishedReq ) ) {
271 cancelWithError( ZYPP_EXCPT_PTR(zypp::media::MediaException("Failed to queue request")) );
272 }
273
274 MIL << "End of mirrorlist handling"<< std::endl;
275 return;
276
277 } else if ( code >= ProvideMessage::Code::FirstClientErrCode && code <= ProvideMessage::Code::LastSrvErrCode ) {
278
279 // remove the old request
280 _runningReq.reset();
281
282 std::exception_ptr errPtr;
283 try {
284 const auto reqUrl = finishedReq->activeUrl().value();
285 const auto reason = msg.value( ErrMsgFields::Reason ).asString();
286 switch ( code ) {
287 case ProvideMessage::Code::BadRequest:
288 errPtr = ZYPP_EXCPT_PTR( zypp::media::MediaException (zypp::str::Str() << "Bad request for URL: " << reqUrl << " " << reason ) );
289 break;
290 case ProvideMessage::Code::PeerCertificateInvalid:
291 errPtr = ZYPP_EXCPT_PTR( zypp::media::MediaException(zypp::str::Str() << "PeerCertificateInvalid Error for URL: " << reqUrl << " " << reason) );
292 break;
293 case ProvideMessage::Code::ConnectionFailed:
294 errPtr = ZYPP_EXCPT_PTR( zypp::media::MediaException(zypp::str::Str() << "ConnectionFailed Error for URL: " << reqUrl << " " << reason ) );
295 break;
296 case ProvideMessage::Code::ExpectedSizeExceeded: {
297
298 std::optional<int64_t> filesize;
299 const auto &hdrs = finishedReq->provideMessage ().headers ();
300 if ( hdrs.contains( ProvideMsgFields::ExpectedFilesize ) ) {
301 const auto &val = hdrs.value ( ProvideMsgFields::ExpectedFilesize );
302 if ( val.valid() )
303 filesize = val.asInt64();
304 }
305
306 if ( !filesize ) {
307 errPtr = ZYPP_EXCPT_PTR( zypp::media::MediaException( zypp::str::Str() << "ExceededExpectedSize Error for URL: " << reqUrl << " " << reason ) );
308 } else {
309 errPtr = ZYPP_EXCPT_PTR( zypp::media::MediaFileSizeExceededException(reqUrl, *filesize ) );
310 }
311 break;
312 }
313 case ProvideMessage::Code::Cancelled:
314 errPtr = ZYPP_EXCPT_PTR( zypp::media::MediaException( zypp::str::Str() << "Request was cancelled: " << reqUrl << " " << reason ) );
315 break;
316 case ProvideMessage::Code::InvalidChecksum:
317 errPtr = ZYPP_EXCPT_PTR( zypp::media::MediaException( zypp::str::Str() << "InvalidChecksum Error for URL: " << reqUrl << " " << reason ) );
318 break;
319 case ProvideMessage::Code::Timeout:
320 errPtr = ZYPP_EXCPT_PTR( zypp::media::MediaTimeoutException(reqUrl) );
321 break;
322 case ProvideMessage::Code::NotFound:
323 errPtr = ZYPP_EXCPT_PTR( zypp::media::MediaFileNotFoundException(reqUrl, "") );
324 break;
325 case ProvideMessage::Code::Forbidden:
326 case ProvideMessage::Code::Unauthorized: {
327
328 const auto &hintVal = msg.value( "authHint"sv );
329 std::string hint;
330 if ( hintVal.valid() && hintVal.isString() ) {
331 hint = hintVal.asString();
332 }
333
334 //@TODO retry here with timestamp from cred store check
335 // we let the request fail after it checked the store
336
337 errPtr = ZYPP_EXCPT_PTR ( zypp::media::MediaUnauthorizedException(
338 reqUrl, reason, "", hint
339 ));
340 break;
341
342 }
343 case ProvideMessage::Code::MountFailed:
344 errPtr = ZYPP_EXCPT_PTR( zypp::media::MediaException( zypp::str::Str() << "MountFailed Error for URL: " << reqUrl << " " << reason ) );
345 break;
346 case ProvideMessage::Code::Jammed:
347 errPtr = ZYPP_EXCPT_PTR( zypp::media::MediaJammedException() );
348 break;
349 case ProvideMessage::Code::MediaChangeSkip:
350 errPtr = ZYPP_EXCPT_PTR( zypp::SkipRequestException ( zypp::str::Str() << "User-requested skipping for URL: " << reqUrl << " " << reason ) );
351 break;
352 case ProvideMessage::Code::MediaChangeAbort:
353 errPtr = ZYPP_EXCPT_PTR( zypp::AbortRequestException( zypp::str::Str() <<"Aborting requested by user for URL: " << reqUrl << " " << reason ) );
354 break;
355 case ProvideMessage::Code::InternalError:
356 errPtr = ZYPP_EXCPT_PTR( zypp::media::MediaException( zypp::str::Str() << "WorkerSpecific Error for URL: " << reqUrl << " " << reason ) );
357 break;
358 case ProvideMessage::Code::NotAFile:
359 errPtr = ZYPP_EXCPT_PTR( zypp::media::MediaNotAFileException(reqUrl, "") );
360 break;
361 case ProvideMessage::Code::MediumNotDesired:
362 errPtr = ZYPP_EXCPT_PTR( zypp::media::MediaNotDesiredException(reqUrl) );
363 break;
364 default:
365 errPtr = ZYPP_EXCPT_PTR( zypp::media::MediaException( zypp::str::Str() << "Unknown Error for URL: " << reqUrl << " " << reason ) );
366 break;
367 }
368 } catch (...) {
369 errPtr = ZYPP_EXCPT_PTR( zypp::media::MediaException( zypp::str::Str() << "Invalid error message received for URL: " << *finishedReq->activeUrl() << " code: " << code ) );
370 }
371
372 if ( log ) log->requestFailed( *this, msg.requestId(), errPtr );
373 // finish the request
374 cancelWithError( errPtr );
375 return;
376 }
377
378 // if we reach here we don't know how to handle the message
379 _runningReq.reset();
380 cancelWithError( ZYPP_EXCPT_PTR (zypp::media::MediaException("Unhandled message received for ProvideFileItem")) );
381 }
382
383 void ProvideItem::finishReq(ProvideQueue *, ProvideRequestRef finishedReq , const std::exception_ptr excpt)
384 {
385 if ( finishedReq != _runningReq ) {
386 WAR << "Received event for unknown request, ignoring" << std::endl;
387 return;
388 }
389
390 if ( _runningReq ) {
391 auto log = provider().log();
392 if ( log ) log->requestFailed( *this, finishedReq->provideMessage().requestId(), excpt );
393 }
394
395 _runningReq.reset();
396 cancelWithError(excpt);
397 }
398
399 expected<zypp::media::AuthData> ProvideItem::authenticationRequired ( ProvideQueue &queue, ProvideRequestRef req, const zypp::Url &effectiveUrl, int64_t lastTimestamp, const std::map<std::string, std::string> &extraFields )
400 {
401
402 if ( req != _runningReq ) {
403 WAR << "Received authenticationRequired for unknown request, rejecting" << std::endl;
404 return expected<zypp::media::AuthData>::error( ZYPP_EXCPT_PTR( zypp::media::MediaException("Unknown request in authenticationRequired, this is a bug.") ) );
405 }
406
407 try {
408 zypp::media::CredentialManager mgr ( provider().credManagerOptions() );
409
410 MIL << "Looking for existing auth data for " << effectiveUrl << "more recent then " << lastTimestamp << std::endl;
411
412 auto credPtr = mgr.getCred( effectiveUrl );
413 if ( credPtr && credPtr->lastDatabaseUpdate() > lastTimestamp ) {
414 MIL << "Found existing auth data for " << effectiveUrl << "ts: " << credPtr->lastDatabaseUpdate() << std::endl;
415 return expected<zypp::media::AuthData>::success( *credPtr );
416 }
417
418 if ( credPtr ) MIL << "Found existing auth data for " << effectiveUrl << "but too old ts: " << credPtr->lastDatabaseUpdate() << std::endl;
419
420 std::string username;
421 if ( auto i = extraFields.find( std::string(AuthDataRequestMsgFields::LastUser) ); i != extraFields.end() ) {
422 username = i->second;
423 }
424
425
426 MIL << "NO Auth data found, asking user. Last tried username was: " << username << std::endl;
427
428 auto userAuth = provider()._sigAuthRequired.emit( effectiveUrl, username, extraFields );
429 if ( !userAuth || !userAuth->valid() ) {
430 MIL << "User rejected to give auth" << std::endl;
431 return expected<zypp::media::AuthData>::error( ZYPP_EXCPT_PTR( zypp::media::MediaException("No auth given by user." ) ) );
432 }
433
434 mgr.addCred( *userAuth );
435 mgr.save();
436
437 // rather ugly, but update the timestamp to the last mtime of the cred database our URL belongs to
438 // otherwise we'd need to reload the cred database
439 userAuth->setLastDatabaseUpdate( mgr.timestampForCredDatabase( effectiveUrl ) );
440
441 return expected<zypp::media::AuthData>::success(*userAuth);
442 } catch ( const zypp::Exception &e ) {
443 ZYPP_CAUGHT(e);
444 return expected<zypp::media::AuthData>::error( ZYPP_FWD_CURRENT_EXCPT() );
445 }
446 }
447
448 bool ProvideItem::enqueueRequest( ProvideRequestRef request )
449 {
450 // base item just supports one running request at a time
451 if ( _runningReq )
452 return ( _runningReq == request );
453
454 _runningReq = request;
455 return d_func()->_parent.queueRequest( request );
456 }
457
458 void ProvideItem::updateState( const State newState )
459 {
460 Z_D();
461 if ( d->_itemState != newState ) {
462
463 bool started = ( d->_itemState == Uninitialized && ( newState != Finished ));
464 auto log = provider().log();
465
466 const auto oldState = d->_itemState;
467 d->_itemState = newState;
468 d->_sigStateChanged( *this, oldState, d->_itemState );
469
470 if ( started ) {
471 d->_itemStarted = std::chrono::steady_clock::now();
472 pulse();
473 if ( log ) log->itemStart( *this );
474 }
475
476 if ( newState == Finished ) {
477 d->_itemFinished = std::chrono::steady_clock::now();
478 pulse();
479 if ( log) log->itemDone( *this );
480 d->_parent.dequeueItem(this);
481 }
482 // CAREFUL, 'this' might be invalid from here on
483 }
484 }
485
486 void ProvideItem::released()
487 {
488 if ( state() == Finished || state() == Finalizing )
489 return;
490
491 MIL << "Item Cleanup due to released Promise in state:" << state() << std::endl;
492 cancelWithError( ZYPP_EXCPT_PTR(zypp::media::MediaException("Cancelled by user.")) );
493 }
494
495 ProvideItem::State ProvideItem::state () const
496 {
497 return d_func()->_itemState;
498 }
499
500 void ProvideRequest::setCurrentQueue( ProvideQueueRef ref )
501 {
502 _myQueue = ref;
503 }
504
505 ProvideQueueRef ProvideRequest::currentQueue()
506 {
507 return _myQueue.lock();
508 }
509
510 const std::optional<zypp::Url> ProvideRequest::activeUrl() const
511 {
512 ProvideMessage::FieldVal url;
513 switch ( this->_message.code () ) {
514 case ProvideMessage::Code::Attach:
515 url = _message.value( AttachMsgFields::Url );
516 break;
517 case ProvideMessage::Code::Detach:
518 url = _message.value( DetachMsgFields::Url );
519 break;
520 case ProvideMessage::Code::Prov:
521 url = _message.value( ProvideMsgFields::Url );
522 break;
523 default:
524 // should never happen because we guard the constructor
525 throw std::logic_error("Invalid message type in ProvideRequest");
526 }
527 if ( !url.valid() ) {
528 return {};
529 }
530
531 try {
532 auto u = zypp::Url( url.asString() );
533 return u;
534 } catch ( const zypp::Exception &e ) {
535 ZYPP_CAUGHT(e);
536 }
537
538 return {};
539 }
540
541 void ProvideRequest::setActiveUrl(const zypp::Url &urlToUse) {
542
543 switch ( this->_message.code () ) {
544 case ProvideMessage::Code::Attach:
545 this->_message.setValue( AttachMsgFields::Url, urlToUse.asCompleteString() );
546 break;
547 case ProvideMessage::Code::Detach:
548 this->_message.setValue( DetachMsgFields::Url, urlToUse.asCompleteString() );
549 break;
550 case ProvideMessage::Code::Prov:
551 this->_message.setValue( ProvideMsgFields::Url, urlToUse.asCompleteString() );
552 break;
553 default:
554 // should never happen because we guard the constructor
555 throw std::logic_error("Invalid message type in ProvideRequest");
556 }
557 }
558
559 ProvideFileItem::ProvideFileItem(const std::vector<zypp::Url> &urls, const ProvideFileSpec &request, ProvidePrivate &parent)
560 : ProvideItem( parent )
561 , _mirrorList ( urls )
562 , _initialSpec ( request )
563 { }
564
565 ProvideFileItemRef ProvideFileItem::create(const std::vector<zypp::Url> &urls, const ProvideFileSpec &request, ProvidePrivate &parent )
566 {
567 return ProvideFileItemRef( new ProvideFileItem( urls, request, parent ) );
568 }
569
570 void ProvideFileItem::initialize()
571 {
572 if ( state() != Uninitialized || _runningReq ) {
573 WAR << "Double init of ProvideFileItem!" << std::endl;
574 return;
575 }
576
577 auto req = ProvideRequest::create( *this, _mirrorList, _initialSpec );
578 if ( !req ){
579 cancelWithError( req.error() );
580 return ;
581 }
582
583 if ( enqueueRequest( *req ) ) {
584 _expectedBytes = _initialSpec.downloadSize();
585 updateState( Pending );
586 } else {
587 cancelWithError( ZYPP_EXCPT_PTR(zypp::media::MediaException("Failed to queue request")) );
588 return ;
589 }
590 }
591
592 ProvidePromiseRef<ProvideRes> ProvideFileItem::promise()
593 {
594 if ( !_promiseCreated ) {
595 _promiseCreated = true;
596 auto promiseRef = std::make_shared<ProvidePromise<ProvideRes>>( shared_this<ProvideItem>() );
597 _promise = promiseRef;
598 return promiseRef;
599 }
600 return _promise.lock();
601 }
602
603 void ProvideFileItem::setMediaRef ( Provide::MediaHandle &&hdl )
604 {
605 _handleRef = std::move(hdl);
606 }
607
608 Provide::MediaHandle &ProvideFileItem::mediaRef ()
609 {
610 return _handleRef;
611 }
612
613 void ProvideFileItem::informalMessage ( ProvideQueue &, ProvideRequestRef req, const ProvideMessage &msg )
614 {
615 if ( req != _runningReq ) {
616 WAR << "Received event for unknown request, ignoring" << std::endl;
617 return;
618 }
619
620 if ( msg.code() == ProvideMessage::Code::ProvideStarted ) {
621 MIL << "Provide File Request: "<< req->url() << " was started" << std::endl;
622 auto log = provider().log();
623
624 auto locPath = msg.value( ProvideStartedMsgFields::LocalFilename, std::string() ).asString();
625 if ( !locPath.empty() )
626 _targetFile = zypp::Pathname(locPath);
627
628 locPath = msg.value( ProvideStartedMsgFields::StagingFilename, std::string() ).asString();
629 if ( !locPath.empty() )
630 _stagingFile = zypp::Pathname(locPath);
631
632 if ( log ) {
633 auto effUrl = req->activeUrl().value_or( zypp::Url() );
634 try {
635 effUrl = zypp::Url( msg.value( ProvideStartedMsgFields::Url).asString() );
636 } catch( const zypp::Exception &e ) {
637 ZYPP_CAUGHT(e);
638 }
639
640 AnyMap m;
641 m["spec"] = _initialSpec;
642 if ( log ) log->requestStart( *this, msg.requestId(), effUrl, m );
643 updateState( Downloading );
644 }
645 }
646 }
647
648 void zyppng::ProvideFileItem::ProvideFileItem::finishReq( zyppng::ProvideQueue &queue, ProvideRequestRef finishedReq, const ProvideMessage &msg )
649 {
650 if ( finishedReq != _runningReq ) {
651 WAR << "Received event for unknown request, ignoring" << std::endl;
652 return;
653 }
654
655 if ( msg.code () == ProvideMessage::Code::ProvideFinished ) {
656
657 auto log = provider().log();
658 if ( log ) {
659 AnyMap m;
660 m["spec"] = _initialSpec;
661 if ( log ) log->requestDone( *this, msg.requestId(), m );
662 }
663
664 MIL << "Request was successfully finished!" << std::endl;
665 // request is def done
666 _runningReq.reset();
667
668 std::optional<zypp::ManagedFile> resFile;
669
670 try {
671 const auto locFilename = msg.value( ProvideFinishedMsgFields::LocalFilename ).asString();
672 const auto cacheHit = msg.value( ProvideFinishedMsgFields::CacheHit ).asBool();
673 const auto &wConf = queue.workerConfig();
674
675 const bool checkExistsOnly = _initialSpec.checkExistsOnly();
676 const bool doesDownload = wConf.worker_type() == ProvideQueue::Config::Downloading;
677 const bool fileNeedsCleanup = doesDownload || ( wConf.worker_type() == ProvideQueue::Config::CPUBound && wConf.cfg_flags() & ProvideQueue::Config::FileArtifacts );
678
679 if ( doesDownload && !checkExistsOnly ) {
680
681 resFile = provider().addToFileCache ( locFilename );
682 if ( !resFile ) {
683 if ( cacheHit ) {
684 MIL << "CACHE MISS, file " << locFilename << " was already removed, queueing again" << std::endl;
685 cacheMiss ( finishedReq );
686 finishedReq->clearForRestart();
687 enqueueRequest( finishedReq );
688 return;
689 } else {
690 // if we reach here it seems that a new file, that was not in cache before, vanished between
691 // providing it and receiving the finished message.
692 // unlikely this can happen but better be safe than sorry
693 cancelWithError( ZYPP_EXCPT_PTR( zypp::media::MediaException("File vanished between downloading and adding it to cache.")) );
694 return;
695 }
696 }
697
698 } else {
699 resFile = zypp::ManagedFile( zypp::filesystem::Pathname(locFilename) );
700 if ( fileNeedsCleanup && !checkExistsOnly )
701 resFile->setDispose( zypp::filesystem::unlink );
702 else
703 resFile->resetDispose();
704 }
705
706 _targetFile = locFilename;
707
708 } catch ( const zypp::Exception &e ) {
709 ZYPP_CAUGHT(e);
710 cancelWithError( std::current_exception() );
711 } catch ( const std::exception &e ) {
712 ZYPP_CAUGHT(e);
713 cancelWithError( std::current_exception() );
714 } catch ( ...) {
715 cancelWithError( std::current_exception() );
716 }
717
718 // keep the media handle around as long as the file is used by the code
719 auto resObj = std::make_shared<ProvideResourceData>();
720 resObj->_mediaHandle = this->_handleRef;
721 resObj->_myFile = *resFile;
722 resObj->_resourceUrl = *(finishedReq->activeUrl());
723 resObj->_responseHeaders = msg.headers();
724
725 // if there is a exception escaping the pipeline we need to rethrow it after cleaning up
726 std::exception_ptr excpt;
727 auto p = promise();
728 if ( p ) {
729 try {
730 p->setReady( expected<ProvideRes>::success( ProvideRes( resObj )) );
731 } catch( const zypp::Exception &e ) {
732 ERR << "Caught unhandled pipline exception:" << e << std::endl;
733 ZYPP_CAUGHT(e);
734 excpt = std::current_exception ();
735 } catch ( const std::exception &e ) {
736 ERR << "Caught unhandled pipline exception:" << e.what() << std::endl;
737 ZYPP_CAUGHT(e);
738 excpt = std::current_exception ();
739 } catch ( ...) {
740 ERR << "Caught unhandled unknown exception:" << std::endl;
741 excpt = std::current_exception ();
742 }
743 }
744
745 updateState( Finished );
746
747 if ( excpt ) {
748 ERR << "Rethrowing pipeline exception, this is a BUG!" << std::endl;
749 std::rethrow_exception ( excpt );
750 }
751
752 } else {
753 ProvideItem::finishReq ( queue, finishedReq, msg );
754 }
755 }
756
757
758 void zyppng::ProvideFileItem::cancelWithError( std::exception_ptr error )
759 {
760 if ( _runningReq ) {
761 auto weakThis = weak_from_this ();
762 provider().dequeueRequest ( _runningReq, error );
763 if ( weakThis.expired () )
764 return;
765 }
766
767 // if we reach this place for some reason finishReq was not called, lets clean up manually
768 _runningReq.reset();
769 auto p = promise();
770 if ( p ) {
771 try {
772 p->setReady( expected<ProvideRes>::error( error ) );
773 } catch( const zypp::Exception &e ) {
774 ZYPP_CAUGHT(e);
775 }
776 }
777 updateState( Finished );
778 }
779
780 expected<zypp::media::AuthData> ProvideFileItem::authenticationRequired ( ProvideQueue &queue, ProvideRequestRef req, const zypp::Url &effectiveUrl, int64_t lastTimestamp, const std::map<std::string, std::string> &extraFields )
781 {
782 zypp::Url urlToUse = effectiveUrl;
783 if ( _handleRef.isValid() ) {
784 // if we have a attached medium this overrules the URL we are going to ask the user about... this is how the old media backend did handle this
785 // i guess there were never password protected repositories that have different credentials on the redirection targets
786 auto &attachedMedia = provider().attachedMediaInfos();
787 if ( std::find( attachedMedia.begin(), attachedMedia.end(), _handleRef.mediaInfo() ) == attachedMedia.end() )
788 return expected<zypp::media::AuthData>::error( ZYPP_EXCPT_PTR( zypp::media::MediaException("Attachment handle vanished during request.") ) );
789 urlToUse = _handleRef.mediaInfo()->_attachedUrl;
790 }
791 return ProvideItem::authenticationRequired( queue, req, urlToUse, lastTimestamp, extraFields );
792 }
793
794 ProvideFileItem::ItemStats ProvideFileItem::makeStats ()
795 {
796 zypp::ByteCount providedByNow;
797
798 bool checkStaging = false;
799 if ( !_targetFile.empty() ) {
800 zypp::PathInfo inf( _targetFile );
801 if ( inf.isExist() && inf.isFile() )
802 providedByNow = zypp::ByteCount( inf.size() );
803 else
804 checkStaging = true;
805 }
806
807 if ( checkStaging && !_stagingFile.empty() ) {
808 zypp::PathInfo inf( _stagingFile );
809 if ( inf.isExist() && inf.isFile() )
810 providedByNow = zypp::ByteCount( inf.size() );
811 }
812
813 auto baseStats = ProvideItem::makeStats();
814 baseStats._bytesExpected = bytesExpected();
815 baseStats._bytesProvided = providedByNow;
816 return baseStats;
817 }
818
819 zypp::ByteCount ProvideFileItem::bytesExpected () const
820 {
821 return (_initialSpec.checkExistsOnly() ? zypp::ByteCount(0) : _expectedBytes);
822 }
823
824 AttachMediaItem::AttachMediaItem( const std::vector<zypp::Url> &urls, const ProvideMediaSpec &request, ProvidePrivate &parent )
825 : ProvideItem ( parent )
826 , _mirrorList ( urls )
827 , _initialSpec ( request )
828 { }
829
830 AttachMediaItem::~AttachMediaItem()
831 {
832 MIL << "Killing the AttachMediaItem" << std::endl;
833 }
834
835 ProvidePromiseRef<Provide::MediaHandle> AttachMediaItem::promise()
836 {
837 if ( !_promiseCreated ) {
838 _promiseCreated = true;
839 auto promiseRef = std::make_shared<ProvidePromise<Provide::MediaHandle>>( shared_this<ProvideItem>() );
840 _promise = promiseRef;
841 return promiseRef;
842 }
843 return _promise.lock();
844 }
845
846 void AttachMediaItem::initialize()
847 {
848 if ( state() != Uninitialized ) {
849 WAR << "Double init of AttachMediaItem!" << std::endl;
850 return;
851 }
852 updateState(Processing);
853
854 if ( _mirrorList.empty() ) {
855 cancelWithError( ZYPP_EXCPT_PTR( zypp::media::MediaException("No usable mirrors in mirrorlist.")) );
856 return;
857 }
858
859 // shortcut to the provider instance
860 auto &prov= provider();
861
862 // sanitize the mirrors to contain only URLs that have same worker types
863 std::vector<zypp::Url> usableMirrs;
864 std::optional<ProvideQueue::Config> scheme;
865
866 for ( auto mirrIt = _mirrorList.begin() ; mirrIt != _mirrorList.end(); mirrIt++ ) {
867 const auto &s = prov.schemeConfig( prov.effectiveScheme( mirrIt->getScheme() ) );
868 if ( !s ) {
869 WAR << "URL: " << *mirrIt << " is not supported, ignoring!" << std::endl;
870 continue;
871 }
872 if ( !scheme ) {
873 scheme = *s;
874 usableMirrs.push_back ( *mirrIt );
875 } else {
876 if ( scheme->worker_type () == s->worker_type () ) {
877 usableMirrs.push_back( *mirrIt );
878 } else {
879 WAR << "URL: " << *mirrIt << " has different worker type than the primary URL: "<< usableMirrs.front() <<", ignoring!" << std::endl;
880 }
881 }
882 }
883
884 // save the sanitized mirrors
885 _mirrorList = usableMirrs;
886
887 if ( !scheme || _mirrorList.empty() ) {
888 auto prom = promise();
889 if ( prom ) {
890 try {
891 prom->setReady( expected<Provide::MediaHandle>::error( ZYPP_EXCPT_PTR ( zypp::media::MediaException("No valid mirrors available") )) );
892 } catch( const zypp::Exception &e ) {
893 ZYPP_CAUGHT(e);
894 }
895 }
896 updateState( Finished );
897 return;
898 }
899
900 // first check if there is a already attached medium we can use as well
901 auto &attachedMedia = prov.attachedMediaInfos ();
902
903 for ( auto &medium : attachedMedia ) {
904 if ( medium->isSameMedium ( _mirrorList, _initialSpec ) ) {
905 finishWithSuccess ( medium );
906 return;
907 }
908 }
909
910 for ( auto &otherItem : prov.items() ) {
911 auto attachIt = std::dynamic_pointer_cast<AttachMediaItem>(otherItem);
912 if ( !attachIt // not the right type
913 || attachIt.get() == this // do not attach to ourselves
914 || attachIt->state () == Uninitialized // item was not initialized
915 || attachIt->state () == Finalizing // item cleaning up
916 || attachIt->state () == Finished ) // item done
917 continue;
918
919 // does this Item attach the same medium?
920 const auto sameMedium = attachIt->_initialSpec.isSameMedium( _initialSpec);
921 if ( zypp::indeterminate(sameMedium) ) {
922 // check the primary URLs ( should we do a full list compare? )
923 if ( attachIt->_mirrorList.front() != _mirrorList.front() )
924 continue;
925 }
926 else if ( !(bool)sameMedium )
927 continue;
928
929 MIL << "Found item providing the same medium, attaching to finished signal and waiting for it to be finished" << std::endl;
930
931 // it does, connect to its ready signal and just wait
932 _masterItemConn = connect( *attachIt, &AttachMediaItem::sigReady, *this, &AttachMediaItem::onMasterItemReady );
933 return;
934 }
935
936 _workerType = scheme->worker_type();
937
938 switch( _workerType ) {
939 case ProvideQueue::Config::Downloading: {
940
941 // if the media file is empty in the spec we can not do anything
942 // simply pretend attach worked
943 if( _initialSpec.mediaFile().empty() ) {
944 finishWithSuccess( prov.addMedium( zypp::make_intrusive<AttachedMediaInfo>( provider().nextMediaId(), _workerType, _mirrorList.front(), _initialSpec ) ) );
945 return;
946 }
947
948 // prepare the verifier with the data
949 auto smvDataLocal = MediaDataVerifier::createVerifier("SuseMediaV1");
950 if ( !smvDataLocal ) {
951 cancelWithError( ZYPP_EXCPT_PTR( zypp::media::MediaException("Unable to verify the medium, no verifier instance was returned.")) );
952 return;
953 }
954
955 if ( !smvDataLocal->load( _initialSpec.mediaFile() ) ) {
956 cancelWithError( ZYPP_EXCPT_PTR( zypp::media::MediaException("Unable to verify the medium, unable to load local verify data.")) );
957 return;
958 }
959
960 _verifier = smvDataLocal;
961
962 std::vector<zypp::Url> urls;
963 urls.reserve( _mirrorList.size () );
964
965 for ( zypp::Url url : _mirrorList ) {
966 url.appendPathName ( ( zypp::str::Format("/media.%d/media") % _initialSpec.medianr() ).asString() );
967 urls.push_back(url);
968 }
969
970 // for downloading schemes we ask for the /media.x/media file and check the data manually
971 ProvideFileSpec spec;
972 spec.customHeaders() = _initialSpec.customHeaders();
973
974 // disable metalink
975 spec.customHeaders().set( std::string(NETWORK_METALINK_ENABLED), false );
976
977 auto req = ProvideRequest::create( *this, urls, spec );
978 if ( !req ) {
979 cancelWithError( req.error() );
980 return;
981 }
982 if ( !enqueueRequest( *req ) ) {
983 cancelWithError( ZYPP_EXCPT_PTR(zypp::media::MediaException("Failed to queue request")) );
984 return;
985 }
986 updateState ( Downloading );
987 break;
988 }
989 case ProvideQueue::Config::VolatileMount:
990 case ProvideQueue::Config::SimpleMount: {
991
992 const auto &newId = provider().nextMediaId();
993 auto req = ProvideRequest::create( *this, _mirrorList, newId, _initialSpec );
994 if ( !req ) {
995 cancelWithError( req.error() );
996 return;
997 }
998 if ( !enqueueRequest( *req ) ) {
999 ERR << "Failed to queue request" << std::endl;
1000 cancelWithError( ZYPP_EXCPT_PTR(zypp::media::MediaException("Failed to queue request")) );
1001 return;
1002 }
1003 break;
1004 }
1005 default: {
1006 auto prom = promise();
1007 if ( prom ) {
1008 try {
1009 prom->setReady( expected<Provide::MediaHandle>::error( ZYPP_EXCPT_PTR ( zypp::media::MediaException("URL scheme does not support attaching.") )) );
1010 } catch( const zypp::Exception &e ) {
1011 ZYPP_CAUGHT(e);
1012 }
1013 }
1014 updateState( Finished );
1015 return;
1016 }
1017 }
1018 }
1019
1020 void AttachMediaItem::finishWithSuccess( AttachedMediaInfo_Ptr medium )
1021 {
1022
1023 updateState(Finalizing);
1024
1025 auto prom = promise();
1026 try {
1027 if ( prom ) {
1028 try {
1029 prom->setReady( expected<Provide::MediaHandle>::success( Provide::MediaHandle( *static_cast<Provide*>( provider().z_func() ), medium ) ) );
1030 } catch( const zypp::Exception &e ) {
1031 ZYPP_CAUGHT(e);
1032 }
1033 }
1034 } catch ( const std::exception &e ) {
1035 ERR << "WTF " << e.what () << std::endl;
1036 } catch ( ... ) {
1037 ERR << "WTF " << std::endl;
1038 }
1039
1040 // tell others as well
1041 _sigReady.emit( zyppng::expected<AttachedMediaInfo *>::success(medium.get()) );
1042
1043 prom->isReady ();
1044
1045 MIL << "Before setFinished" << std::endl;
1046 updateState( Finished );
1047 return;
1048 }
1049
1050 void AttachMediaItem::cancelWithError( std::exception_ptr error )
1051 {
1052 MIL << "Cancelling Item with error" << std::endl;
1053 updateState(Finalizing);
1054
1055 // tell children
1056 _sigReady.emit( expected<AttachedMediaInfo *>::error(error) );
1057
1058 if ( _runningReq ) {
1059 // we might get deleted when calling dequeueRequest
1060 auto weakThis = weak_from_this ();
1061 provider().dequeueRequest ( _runningReq, error );
1062 if ( weakThis.expired () )
1063 return;
1064 }
1065
1066 // if we reach this place we had no runningReq, clean up manually
1067 _runningReq.reset();
1068 _masterItemConn.disconnect();
1069
1070 auto p = promise();
1071 if ( p ) {
1072 try {
1073 p->setReady( expected<zyppng::Provide::MediaHandle>::error( error ) );
1074 } catch( const zypp::Exception &e ) {
1075 ZYPP_CAUGHT(e);
1076 }
1077 }
1078 updateState( Finished );
1079 }
1080
1081 void AttachMediaItem::onMasterItemReady( const zyppng::expected<AttachedMediaInfo *> &result )
1082 {
1083
1084 _masterItemConn.disconnect();
1085
1086 if ( result ) {
1087 finishWithSuccess( AttachedMediaInfo_Ptr(result.get()) );
1088 } else {
1089 try {
1090 std::rethrow_exception ( result.error() );
1091 } catch ( const zypp::media::MediaRequestCancelledException & e) {
1092 // in case a item was cancelled, we revert to Pending state and trigger the scheduler.
1093 // This will make sure that all our sibilings that also depend on the master
1094 // can revert to pending state and we only get one new master in the next schedule run
1095 MIL_PRV << "Master item was cancelled, reverting to Uninitialized state and waiting for scheduler to run again" << std::endl;
1096 updateState (Uninitialized);
1097 provider().schedule( ProvidePrivate::RestartAttach );
1098
1099 } catch ( ... ) {
1100 cancelWithError( std::current_exception() );
1101 }
1102 }
1103 }
1104
1105 AttachMediaItemRef AttachMediaItem::create( const std::vector<zypp::Url> &urls, const ProvideMediaSpec &request, ProvidePrivate &parent )
1106 {
1107 return AttachMediaItemRef( new AttachMediaItem(urls, request, parent) );
1108 }
1109
1110 SignalProxy<void (const zyppng::expected<AttachedMediaInfo *> &)> AttachMediaItem::sigReady()
1111 {
1112 return _sigReady;
1113 }
1114
1115 void AttachMediaItem::finishReq ( ProvideQueue &queue, ProvideRequestRef finishedReq, const ProvideMessage &msg )
1116 {
1117 if ( finishedReq != _runningReq ) {
1118 WAR << "Received event for unknown request, ignoring" << std::endl;
1119 return;
1120 }
1121
1122 if( _workerType == ProvideQueue::Config::Downloading ) {
1123 // success
1124 if ( msg.code() == ProvideMessage::Code::ProvideFinished ) {
1125
1126 updateState(Finalizing);
1127
1128 zypp::Url baseUrl = *finishedReq->activeUrl();
1129 // remove /media.n/media
1130 baseUrl.setPathName( zypp::Pathname(baseUrl.getPathName()).dirname().dirname() );
1131
1132 // we got the file, lets parse it
1133 auto smvDataRemote = MediaDataVerifier::createVerifier("SuseMediaV1");
1134 if ( !smvDataRemote ) {
1135 return cancelWithError( ZYPP_EXCPT_PTR( zypp::media::MediaException("Unable to verify the medium, no verifier instance was returned.")) );
1136 }
1137
1138 if ( !smvDataRemote->load( msg.value( ProvideFinishedMsgFields::LocalFilename ).asString() ) ) {
1139 return cancelWithError( ZYPP_EXCPT_PTR( zypp::media::MediaException("Unable to verify the medium, unable to load remote verify data.")) );
1140 }
1141
1142 // check if we got a valid media file
1143 if ( !smvDataRemote->valid () ) {
1144 return cancelWithError( ZYPP_EXCPT_PTR( zypp::media::MediaException("Unable to verify the medium, unable to load local verify data.")) );
1145 }
1146
1147 // check if the received file matches with the one we have in the spec
1148 if (! _verifier->matches( smvDataRemote ) ) {
1149 DBG << "expect: " << _verifier << " medium " << _initialSpec.medianr() << std::endl;
1150 DBG << "remote: " << smvDataRemote << std::endl;
1151 return cancelWithError( ZYPP_EXCPT_PTR( zypp::media::MediaNotDesiredException( *finishedReq->activeUrl() ) ) );
1152 }
1153
1154 // all good, register the medium and tell all child items
1155 _runningReq.reset();
1156 return finishWithSuccess( provider().addMedium( zypp::make_intrusive<AttachedMediaInfo>( provider().nextMediaId(), _workerType, baseUrl, _initialSpec) ) );
1157
1158 } else if ( msg.code() == ProvideMessage::Code::NotFound ) {
1159
1160 // simple downloading attachment we need to check the media file contents
1161 // in case of a error we might tolerate a file not found error in certain situations
1162 if ( _verifier->totalMedia () == 1 ) {
1163 // relaxed , tolerate a vanished media file
1164 _runningReq.reset();
1165
1166 return finishWithSuccess( provider().addMedium( zypp::make_intrusive<AttachedMediaInfo>( provider().nextMediaId(), _workerType, _mirrorList.front(), _initialSpec ) ) );
1167 } else {
1168 return ProvideItem::finishReq ( queue, finishedReq, msg );
1169 }
1170 } else {
1171 return ProvideItem::finishReq ( queue, finishedReq, msg );
1172 }
1173 } else {
1174 // real device attach
1175 if ( msg.code() == ProvideMessage::Code::AttachFinished ) {
1176
1177 std::optional<zypp::Pathname> mntPoint;
1178 auto mountPtVal = msg.value( zyppng::AttachFinishedMsgFields::LocalMountPoint );
1179 if ( mountPtVal.valid() && mountPtVal.isString() ) {
1180 mntPoint = zypp::Pathname(mountPtVal.asString());
1181 }
1182
1183 _runningReq.reset();
1184 return finishWithSuccess( provider().addMedium( zypp::make_intrusive<AttachedMediaInfo>(
1185 finishedReq->provideMessage().value( AttachMsgFields::AttachId ).asString()
1186 , queue.weak_this<ProvideQueue>()
1187 , _workerType
1188 , *finishedReq->activeUrl()
1189 , _initialSpec
1190 , mntPoint ) ) );
1191 }
1192 }
1193
1194 // unhandled message , let the base impl do it
1195 return ProvideItem::finishReq ( queue, finishedReq, msg );
1196 }
1197
1198 expected<zypp::media::AuthData> AttachMediaItem::authenticationRequired ( ProvideQueue &queue, ProvideRequestRef req, const zypp::Url &effectiveUrl, int64_t lastTimestamp, const std::map<std::string, std::string> &extraFields )
1199 {
1200 zypp::Url baseUrl = effectiveUrl;
1201 if( _workerType == ProvideQueue::Config::Downloading ) {
1202 // remove /media.n/media
1203 baseUrl.setPathName( zypp::Pathname(baseUrl.getPathName()).dirname().dirname() );
1204 }
1205 return ProvideItem::authenticationRequired( queue, req, baseUrl, lastTimestamp, extraFields );
1206 }
1207
1208}
zypp::ByteCount
Store and operate with byte count.
Definition ByteCount.h:32
zypp::Exception
Base class for Exception.
Definition Exception.h:147
zypp::Url
Url manipulation class.
Definition Url.h:93
zypp::Url::asCompleteString
std::string asCompleteString() const
Returns a complete string representation of the Url object.
Definition Url.cc:523
zypp::Url::getPathName
std::string getPathName(EEncoding eflag=zypp::url::E_DECODED) const
Returns the path name from the URL.
Definition Url.cc:622
zypp::Url::setPathName
void setPathName(const std::string &path, EEncoding eflag=zypp::url::E_DECODED)
Set the path name.
Definition Url.cc:782
zypp::filesystem::PathInfo
Wrapper class for stat/lstat.
Definition PathInfo.h:226
zypp::filesystem::PathInfo::isFile
bool isFile() const
Definition PathInfo.h:295
zypp::filesystem::PathInfo::size
off_t size() const
Definition PathInfo.h:376
zypp::filesystem::PathInfo::isExist
bool isExist() const
Return whether valid stat info exists.
Definition PathInfo.h:286
zypp::filesystem::Pathname
Pathname.
Definition Pathname.h:47
zypp::filesystem::Pathname::dirname
Pathname dirname() const
Return all but the last component od this path.
Definition Pathname.h:126
zypp::filesystem::Pathname::asString
const std::string & asString() const
String representation.
Definition Pathname.h:93
zypp::filesystem::Pathname::empty
bool empty() const
Test for an empty path.
Definition Pathname.h:116
zypp::media::CredentialManager
Definition credentialmanager.h:64
zypp::media::CredentialManager::save
void save()
Saves any unsaved credentials added via addUserCred() or addGlobalCred() methods.
Definition credentialmanager.cc:414
zypp::media::CredentialManager::timestampForCredDatabase
time_t timestampForCredDatabase(const zypp::Url &url)
Definition credentialmanager.cc:359
zypp::media::CredentialManager::getCred
AuthData_Ptr getCred(const Url &url)
Get credentials for the specified url.
Definition credentialmanager.cc:333
zypp::media::CredentialManager::addCred
void addCred(const AuthData &cred)
Add new credentials with user callbacks.
Definition credentialmanager.cc:346
zypp::media::MediaException
Just inherits Exception to separate media exceptions.
Definition mediaexception.h:37
zypp::media::MediaFileNotFoundException
Definition mediaexception.h:164
zypp::media::MediaFileSizeExceededException
Definition mediaexception.h:509
zypp::media::MediaJammedException
Definition mediaexception.h:118
zypp::media::MediaNotAFileException
Definition mediaexception.h:254
zypp::media::MediaNotDesiredException
Definition mediaexception.h:396
zypp::media::MediaRequestCancelledException
Definition mediaexception.h:564
zypp::media::MediaTimeoutException
Definition mediaexception.h:495
zypp::media::MediaUnauthorizedException
Definition mediaexception.h:446
zyppng::AttachMediaItem::initialize
void initialize() override
Definition provideitem.cc:846
zyppng::AttachMediaItem::_sigReady
Signal< void(const zyppng::expected< AttachedMediaInfo * > &)> _sigReady
Definition provideitem_p.h:195
zyppng::AttachMediaItem::_promiseCreated
bool _promiseCreated
Definition provideitem_p.h:196
zyppng::AttachMediaItem::finishReq
void finishReq(ProvideQueue &queue, ProvideRequestRef finishedReq, const ProvideMessage &msg) override
Definition provideitem.cc:1115
zyppng::AttachMediaItem::promise
ProvidePromiseRef< Provide::MediaHandle > promise()
Definition provideitem.cc:835
zyppng::AttachMediaItem::sigReady
SignalProxy< void(const zyppng::expected< AttachedMediaInfo * > &) > sigReady()
Definition provideitem.cc:1110
zyppng::AttachMediaItem::finishWithSuccess
void finishWithSuccess(AttachedMediaInfo_Ptr medium)
Definition provideitem.cc:1020
zyppng::AttachMediaItem::_verifier
MediaDataVerifierRef _verifier
Definition provideitem_p.h:202
zyppng::AttachMediaItem::_promise
ProvidePromiseWeakRef< Provide::MediaHandle > _promise
Definition provideitem_p.h:201
zyppng::AttachMediaItem::AttachMediaItem
AttachMediaItem(const std::vector< zypp::Url > &urls, const ProvideMediaSpec &request, ProvidePrivate &parent)
Definition provideitem.cc:824
zyppng::AttachMediaItem::_workerType
ProvideQueue::Config::WorkerType _workerType
Definition provideitem_p.h:200
zyppng::AttachMediaItem::~AttachMediaItem
~AttachMediaItem()
Definition provideitem.cc:830
zyppng::AttachMediaItem::_initialSpec
ProvideMediaSpec _initialSpec
Definition provideitem_p.h:199
zyppng::AttachMediaItem::create
static AttachMediaItemRef create(const std::vector< zypp::Url > &urls, const ProvideMediaSpec &request, ProvidePrivate &parent)
Definition provideitem.cc:1105
zyppng::AttachMediaItem::_masterItemConn
connection _masterItemConn
Definition provideitem_p.h:197
zyppng::AttachMediaItem::_mirrorList
std::vector< zypp::Url > _mirrorList
Definition provideitem_p.h:198
zyppng::AttachMediaItem::cancelWithError
void cancelWithError(std::exception_ptr error) override
Definition provideitem.cc:1050
zyppng::AttachMediaItem::authenticationRequired
expected< zypp::media::AuthData > authenticationRequired(ProvideQueue &queue, ProvideRequestRef req, const zypp::Url &effectiveUrl, int64_t lastTimestamp, const std::map< std::string, std::string > &extraFields) override
Definition provideitem.cc:1198
zyppng::AttachMediaItem::onMasterItemReady
void onMasterItemReady(const zyppng::expected< AttachedMediaInfo * > &result)
Definition provideitem.cc:1081
zyppng::Base::shared_this
std::shared_ptr< T > shared_this() const
Definition base.h:113
zyppng::Base::parent
WeakPtr parent() const
Definition base.cc:26
zyppng::Base::connect
static auto connect(typename internal::MemberFunction< SenderFunc >::ClassType &s, SenderFunc &&sFun, typename internal::MemberFunction< ReceiverFunc >::ClassType &recv, ReceiverFunc &&rFunc)
Definition base.h:142
zyppng::Base::weak_this
std::weak_ptr< T > weak_this() const
Definition base.h:123
zyppng::Base::Base
Base()
Definition base.cc:20
zyppng::HeaderValueMap::set
void set(const std::string &key, Value val)
Definition headervaluemap.cc:152
zyppng::HeaderValue::asString
const std::string & asString() const
Definition headervaluemap.cc:69
zyppng::HeaderValue::asBool
bool asBool() const
Definition headervaluemap.cc:86
zyppng::MediaDataVerifier::createVerifier
static MediaDataVerifierRef createVerifier(const std::string &verifierType)
Definition mediaverifier.cc:122
zyppng::ProvideFileItem::authenticationRequired
expected< zypp::media::AuthData > authenticationRequired(ProvideQueue &queue, ProvideRequestRef req, const zypp::Url &effectiveUrl, int64_t lastTimestamp, const std::map< std::string, std::string > &extraFields) override
Definition provideitem.cc:780
zyppng::ProvideFileItem::_stagingFile
zypp::Pathname _stagingFile
Definition provideitem_p.h:162
zyppng::ProvideFileItem::cancelWithError
void cancelWithError(std::exception_ptr error) override
Definition provideitem.cc:758
zyppng::ProvideFileItem::bytesExpected
zypp::ByteCount bytesExpected() const override
Definition provideitem.cc:819
zyppng::ProvideFileItem::setMediaRef
void setMediaRef(Provide::MediaHandle &&hdl)
Definition provideitem.cc:603
zyppng::ProvideFileItem::mediaRef
Provide::MediaHandle & mediaRef()
Definition provideitem.cc:608
zyppng::ProvideFileItem::_promiseCreated
bool _promiseCreated
Definition provideitem_p.h:158
zyppng::ProvideFileItem::_handleRef
Provide::MediaHandle _handleRef
Definition provideitem_p.h:157
zyppng::ProvideFileItem::initialize
void initialize() override
Definition provideitem.cc:570
zyppng::ProvideFileItem::create
static ProvideFileItemRef create(const std::vector< zypp::Url > &urls, const ProvideFileSpec &request, ProvidePrivate &parent)
Definition provideitem.cc:565
zyppng::ProvideFileItem::ProvideFileItem
ProvideFileItem(const std::vector< zypp::Url > &urls, const ProvideFileSpec &request, ProvidePrivate &parent)
Definition provideitem.cc:559
zyppng::ProvideFileItem::_initialSpec
ProvideFileSpec _initialSpec
Definition provideitem_p.h:160
zyppng::ProvideFileItem::promise
ProvidePromiseRef< ProvideRes > promise()
Definition provideitem.cc:592
zyppng::ProvideFileItem::_mirrorList
std::vector< zypp::Url > _mirrorList
Definition provideitem_p.h:159
zyppng::ProvideFileItem::_expectedBytes
zypp::ByteCount _expectedBytes
Definition provideitem_p.h:163
zyppng::ProvideFileItem::_targetFile
zypp::Pathname _targetFile
Definition provideitem_p.h:161
zyppng::ProvideFileItem::makeStats
ItemStats makeStats() override
Definition provideitem.cc:794
zyppng::ProvideFileItem::informalMessage
void informalMessage(ProvideQueue &, ProvideRequestRef req, const ProvideMessage &msg) override
Definition provideitem.cc:613
zyppng::ProvideFileItem::_promise
ProvidePromiseWeakRef< ProvideRes > _promise
Definition provideitem_p.h:164
zyppng::ProvideFileSpec
Definition providespec.h:92
zyppng::ProvideFileSpec::customHeaders
HeaderValueMap & customHeaders()
Definition providespec.cc:251
zyppng::ProvideFileSpec::destFilenameHint
const zypp::Pathname & destFilenameHint() const
Definition providespec.cc:191
zyppng::ProvideFileSpec::downloadSize
const zypp::ByteCount & downloadSize() const
The size of the resource on the server.
Definition providespec.cc:209
zyppng::ProvideFileSpec::deltafile
const zypp::Pathname & deltafile() const
The existing deltafile that can be used to reduce download size ( zchunk or metalink )
Definition providespec.cc:245
zyppng::ProvideFileSpec::checkExistsOnly
bool checkExistsOnly() const
Definition providespec.cc:197
zyppng::ProvideItemPrivate
Definition provideitem_p.h:91
zyppng::ProvideItem
Definition provideitem.h:29
zyppng::ProvideItem::pulse
void pulse()
Definition provideitem.cc:141
zyppng::ProvideItem::safeRedirectTo
bool safeRedirectTo(ProvideRequestRef startedReq, const zypp::Url &url)
Definition provideitem.cc:95
zyppng::ProvideItem::startTime
virtual std::chrono::steady_clock::time_point startTime() const
Definition provideitem.cc:132
zyppng::ProvideItem::cacheMiss
virtual void cacheMiss(ProvideRequestRef req)
Definition provideitem.cc:180
zyppng::ProvideItem::ProvideItem
ProvideItem(ProvidePrivate &parent)
Definition provideitem.cc:83
zyppng::ProvideItem::provider
ProvidePrivate & provider()
Definition provideitem.cc:90
zyppng::ProvideItem::~ProvideItem
~ProvideItem()
Definition provideitem.cc:87
zyppng::ProvideItem::authenticationRequired
virtual expected< zypp::media::AuthData > authenticationRequired(ProvideQueue &queue, ProvideRequestRef req, const zypp::Url &effectiveUrl, int64_t lastTimestamp, const std::map< std::string, std::string > &extraFields)
Definition provideitem.cc:399
zyppng::ProvideItem::makeStats
virtual ItemStats makeStats()
Definition provideitem.cc:159
zyppng::ProvideItem::Provide
friend class Provide
Definition provideitem.h:31
zyppng::ProvideItem::canRedirectTo
virtual bool canRedirectTo(ProvideRequestRef startedReq, const zypp::Url &url)
Definition provideitem.cc:110
zyppng::ProvideItem::finishedTime
virtual std::chrono::steady_clock::time_point finishedTime() const
Definition provideitem.cc:137
zyppng::ProvideItem::bytesExpected
virtual zypp::ByteCount bytesExpected() const
Definition provideitem.cc:154
zyppng::ProvideItem::_runningReq
ProvideRequestRef _runningReq
Definition provideitem.h:189
zyppng::ProvideItem::redirectTo
void redirectTo(ProvideRequestRef startedReq, const zypp::Url &url)
Definition provideitem.cc:104
zyppng::ProvideItem::state
State state() const
Definition provideitem.cc:495
zyppng::ProvideItem::State
State
Definition provideitem.h:35
zyppng::ProvideItem::Downloading
@ Downloading
Definition provideitem.h:38
zyppng::ProvideItem::Uninitialized
@ Uninitialized
Definition provideitem.h:36
zyppng::ProvideItem::Processing
@ Processing
Definition provideitem.h:39
zyppng::ProvideItem::Finalizing
@ Finalizing
Definition provideitem.h:41
zyppng::ProvideItem::Pending
@ Pending
Definition provideitem.h:37
zyppng::ProvideItem::Finished
@ Finished
Definition provideitem.h:42
zyppng::ProvideItem::informalMessage
virtual void informalMessage(ProvideQueue &, ProvideRequestRef req, const ProvideMessage &msg)
Definition provideitem.cc:167
zyppng::ProvideItem::previousStats
const std::optional< ItemStats > & previousStats() const
Definition provideitem.cc:127
zyppng::ProvideItem::ProvidePrivate
friend class ProvidePrivate
Definition provideitem.h:32
zyppng::ProvideItem::released
virtual void released()
Definition provideitem.cc:486
zyppng::ProvideItem::finishReq
virtual void finishReq(ProvideQueue &queue, ProvideRequestRef finishedReq, const ProvideMessage &msg)
Definition provideitem.cc:190
zyppng::ProvideItem::cancelWithError
virtual void cancelWithError(std::exception_ptr error)=0
zyppng::ProvideItem::currentStats
const std::optional< ItemStats > & currentStats() const
Definition provideitem.cc:122
zyppng::ProvideItem::updateState
void updateState(const State newState)
Definition provideitem.cc:458
zyppng::ProvideItem::ProvideQueue
friend class ProvideQueue
Definition provideitem.h:33
zyppng::ProvideItem::enqueueRequest
virtual bool enqueueRequest(ProvideRequestRef request)
Definition provideitem.cc:448
zyppng::ProvideMediaSpec
Definition providespec.h:29
zyppng::ProvideMediaSpec::customHeaders
HeaderValueMap & customHeaders()
Definition providespec.cc:127
zyppng::ProvideMediaSpec::medianr
unsigned medianr() const
Definition providespec.cc:109
zyppng::ProvideMediaSpec::mediaFile
zypp::Pathname mediaFile() const
Definition providespec.cc:118
zyppng::ProvideMediaSpec::label
const std::string & label() const
Definition providespec.cc:100
zyppng::ProvideMessage
Definition providemessage_p.h:521
zyppng::ProvideMessage::FieldVal
HeaderValue FieldVal
Definition providemessage_p.h:529
zyppng::ProvideMessage::headers
const HeaderValueMap & headers() const
Definition providemessage.cc:682
zyppng::ProvideMessage::requestId
uint requestId() const
Definition providemessage.cc:647
zyppng::ProvideMessage::value
FieldVal value(const std::string_view &str, const FieldVal &defaultVal=FieldVal()) const
Definition providemessage.cc:677
zyppng::ProvideMessage::values
const std::vector< ProvideMessage::FieldVal > & values(const std::string_view &str) const
Definition providemessage.cc:667
zyppng::ProvideMessage::createProvide
static ProvideMessage createProvide(const uint32_t reqId, const zypp::Url &url, const std::optional< std::string > &filename={}, const std::optional< std::string > &deltaFile={}, const std::optional< int64_t > &expFilesize={}, bool checkExistOnly=false)
Definition providemessage.cc:560
zyppng::ProvideMessage::code
Code code() const
Definition providemessage.cc:657
zyppng::ProvideMessage::createDetach
static ProvideMessage createDetach(const uint32_t reqId, const zypp::Url &attachUrl)
Definition providemessage.cc:608
zyppng::ProvideMessage::createAttach
static ProvideMessage createAttach(const uint32_t reqId, const zypp::Url &url, const std::string attachId, const std::string &label, const std::optional< std::string > &verifyType={}, const std::optional< std::string > &verifyData={}, const std::optional< int32_t > &mediaNr={})
Definition providemessage.cc:587
zyppng::ProvidePrivate::dequeueRequest
bool dequeueRequest(ProvideRequestRef req, std::exception_ptr error)
Definition provide.cc:837
zyppng::ProvidePrivate::nextMediaId
std::string nextMediaId() const
Definition provide.cc:803
zyppng::ProvidePrivate::_sigAuthRequired
Signal< std::optional< zypp::media::AuthData >(const zypp::Url &reqUrl, const std::string &triedUsername, const std::map< std::string, std::string > &extraValues) > _sigAuthRequired
Definition provide_p.h:97
zyppng::ProvidePrivate::attachedMediaInfos
std::vector< AttachedMediaInfo_Ptr > & attachedMediaInfos()
Definition provide.cc:739
zyppng::ProvidePrivate::schedule
void schedule(ScheduleReason reason)
Definition provide.cc:38
zyppng::ProvidePrivate::log
ProvideStatusRef log()
Definition provide_p.h:90
zyppng::ProvidePrivate::RestartAttach
@ RestartAttach
Definition provide_p.h:53
zyppng::ProvideQueue
Definition providequeue_p.h:31
zyppng::ProvideQueue::workerConfig
const Config & workerConfig() const
Definition providequeue.cc:307
zyppng::ProvideQueue::InvalidId
static constexpr uint32_t InvalidId
Definition providequeue_p.h:35
zyppng::ProvideRequest::setActiveUrl
void setActiveUrl(const zypp::Url &urlToUse)
Definition provideitem.cc:541
zyppng::ProvideRequest::_myQueue
ProvideQueueWeakRef _myQueue
Definition provideitem_p.h:87
zyppng::ProvideRequest::urls
const std::vector< zypp::Url > & urls() const
Definition provideitem_p.h:62
zyppng::ProvideRequest::createDetach
static expected< ProvideRequestRef > createDetach(const zypp::Url &url)
Definition provideitem.cc:75
zyppng::ProvideRequest::create
static expected< ProvideRequestRef > create(ProvideItem &owner, const std::vector< zypp::Url > &urls, const std::string &id, ProvideMediaSpec &spec)
Definition provideitem.cc:27
zyppng::ProvideRequest::_message
ProvideMessage _message
Definition provideitem_p.h:83
zyppng::ProvideRequest::url
zypp::Url url() const
Definition provideitem_p.h:66
zyppng::ProvideRequest::setCurrentQueue
void setCurrentQueue(ProvideQueueRef ref)
Definition provideitem.cc:500
zyppng::ProvideRequest::owner
ProvideItem * owner()
Definition provideitem_p.h:45
zyppng::ProvideRequest::currentQueue
ProvideQueueRef currentQueue()
Definition provideitem.cc:505
zyppng::ProvideRequest::ProvideItem
friend class ProvideItem
Definition provideitem_p.h:39
zyppng::ProvideRequest::activeUrl
const std::optional< zypp::Url > activeUrl() const
Definition provideitem.cc:510
zyppng::ProvideRequest::ProvideRequest
ProvideRequest(ProvideItem *owner, const std::vector< zypp::Url > &urls, ProvideMessage &&msg)
Definition provideitem_p.h:81
zyppng::ProvideRes
A ProvideRes object is a reference counted ownership of a resource in the cache provided by a Provide...
Definition provideres.h:36
zyppng::Provide::MediaHandle
ProvideMediaHandle MediaHandle
Definition provide.h:120
zyppng::SignalProxy
Definition signals.h:325
zyppng::WorkerCaps::Downloading
@ Downloading
Definition providemessage_p.h:381
zyppng::WorkerCaps::SimpleMount
@ SimpleMount
Definition providemessage_p.h:382
zyppng::WorkerCaps::CPUBound
@ CPUBound
Definition providemessage_p.h:384
zyppng::WorkerCaps::VolatileMount
@ VolatileMount
Definition providemessage_p.h:383
zyppng::WorkerCaps::worker_type
WorkerType worker_type() const
Definition providemessage.cc:61
zyppng::WorkerCaps::FileArtifacts
@ FileArtifacts
Definition providemessage_p.h:392
zyppng::expected
Definition expected.h:27
zyppng::expected::success
static expected success(ConsParams &&...params)
Definition expected.h:115
zyppng::expected::get
T & get()
Definition expected.h:152
zyppng::expected::error
static expected error(ConsParams &&...params)
Definition expected.h:126
zyppng::expected::error
E & error()
Definition expected.h:225
mediaverifier.h
zypp::filesystem::unlink
int unlink(const Pathname &path)
Like 'unlink'.
Definition PathInfo.cc:705
zypp::log
Definition LogControl.cc:362
zypp::url
Url details namespace.
Definition UrlBase.cc:58
zypp::ManagedFile
AutoDispose< const Pathname > ManagedFile
A Pathname plus associated cleanup code to be executed when path is no longer needed.
Definition ManagedFile.h:27
zypp::make_intrusive
intrusive_ptr< T > make_intrusive(Args &&... __args)
Definition PtrTypes.h:103
zyppng::AttachFinishedMsgFields::LocalMountPoint
constexpr std::string_view LocalMountPoint("local_mountpoint")
zyppng::AttachMsgFields::AttachId
constexpr std::string_view AttachId("attach_id")
zyppng::AttachMsgFields::VerifyData
constexpr std::string_view VerifyData("verify_data")
zyppng::AttachMsgFields::VerifyType
constexpr std::string_view VerifyType("verify_type")
zyppng::AttachMsgFields::MediaNr
constexpr std::string_view MediaNr("media_nr")
zyppng::AttachMsgFields::Url
constexpr std::string_view Url("url")
zyppng::AuthDataRequestMsgFields::LastUser
constexpr std::string_view LastUser("username")
zyppng::DetachMsgFields::Url
constexpr std::string_view Url("url")
zyppng::ErrMsgFields::Reason
constexpr std::string_view Reason("reason")
zyppng::MetalinkRedirectMsgFields::NewUrl
constexpr std::string_view NewUrl("new_url")
zyppng::ProvideFinishedMsgFields::LocalFilename
constexpr std::string_view LocalFilename("local_filename")
zyppng::ProvideFinishedMsgFields::CacheHit
constexpr std::string_view CacheHit("cacheHit")
zyppng::ProvideMsgFields::Url
constexpr std::string_view Url("url")
zyppng::ProvideMsgFields::MetalinkEnabled
constexpr std::string_view MetalinkEnabled("metalink_enabled")
zyppng::ProvideMsgFields::ExpectedFilesize
constexpr std::string_view ExpectedFilesize("expected_filesize")
zyppng::ProvideMsgFields::DeltaFile
constexpr std::string_view DeltaFile("delta_file")
zyppng::ProvideMsgFields::CheckExistOnly
constexpr std::string_view CheckExistOnly("check_existance_only")
zyppng::ProvideMsgFields::Filename
constexpr std::string_view Filename("filename")
zyppng::ProvideStartedMsgFields::StagingFilename
constexpr std::string_view StagingFilename("staging_filename")
zyppng::ProvideStartedMsgFields::Url
constexpr std::string_view Url("url")
zyppng::ProvideStartedMsgFields::LocalFilename
constexpr std::string_view LocalFilename("local_filename")
zyppng::RedirectMsgFields::NewUrl
constexpr std::string_view NewUrl("new_url")
zyppng
Definition MediaCurl2.h:22
zyppng::NETWORK_METALINK_ENABLED
constexpr std::string_view NETWORK_METALINK_ENABLED("zypp-nw-metalink-enabled")
zyppng::DEFAULT_MEDIA_VERIFIER
static constexpr std::string_view DEFAULT_MEDIA_VERIFIER("SuseMediaV1")
zyppng::ProvidePromiseRef
std::shared_ptr< ProvidePromise< T > > ProvidePromiseRef
Definition providefwd_p.h:31
zyppng::AnyMap
std::unordered_map< std::string, boost::any > AnyMap
Definition provide.h:45
provide-configvars.h
provide_p.h
providedbg_p.h
MIL_PRV
#define MIL_PRV
Definition providedbg_p.h:35
provideitem_p.h
providemessage_p.h
provideres_p.h
zypp::str::Format
Convenient building of std::string with boost::format.
Definition String.h:253
zypp::str::Str
Convenient building of std::string via std::ostringstream Basically a std::ostringstream autoconverti...
Definition String.h:212
zyppng::ProvideItem::ItemStats
Definition provideitem.h:45
ZYPP_CAUGHT
#define ZYPP_CAUGHT(EXCPT)
Drops a logline telling the Exception was caught (in order to handle it).
Definition Exception.h:440
ZYPP_EXCPT_PTR
#define ZYPP_EXCPT_PTR(EXCPT)
Drops a logline and returns Exception as a std::exception_ptr.
Definition Exception.h:428
ZYPP_FWD_CURRENT_EXCPT
#define ZYPP_FWD_CURRENT_EXCPT()
Drops a logline and returns the current Exception as a std::exception_ptr.
Definition Exception.h:436
DBG
#define DBG
Definition Logger.h:99
MIL
#define MIL
Definition Logger.h:100
ERR
#define ERR
Definition Logger.h:102
WAR
#define WAR
Definition Logger.h:101
PathInfo.h
ZYPP_IMPL_PRIVATE
#define ZYPP_IMPL_PRIVATE(Class)
Definition zyppglobal.h:92
Z_D
#define Z_D()
Definition zyppglobal.h:105