Imported Upstream version 17.6.0
[platform/upstream/libzypp.git] / zypp / repo / MediaInfoDownloader.cc
index 4974fe6..e1c37ca 100644 (file)
@@ -27,7 +27,10 @@ void downloadMediaInfo( const Pathname &dest_dir,
                         const ProgressData::ReceiverFnc & progressrcv )
 {
   Fetcher fetcher;
-  fetcher.enqueue( OnMediaLocation("/media.1/media").setOptional(true) );
+
+  //hardcode the max filesize to 20MB, to prevent unlimited data downloads but this limit will
+  //never be reached in a sane setup
+  fetcher.enqueue( OnMediaLocation("/media.1/media").setOptional(true).setDownloadSize( ByteCount(20, ByteCount::MB ) ) );
   fetcher.start( dest_dir, media, progressrcv );
   // ready, go!
   fetcher.reset();