Imported Upstream version 17.20.0
[platform/upstream/libzypp.git] / zypp / media / MediaAccess.cc
index f119b00..265684e 100644 (file)
@@ -171,13 +171,12 @@ MediaAccess::open (const Url& o_url, const Pathname & preferred_attach_point)
        else
             curl = new MediaCurl (url,preferred_attach_point);
 
-        UrlResolverPlugin::HeaderList::const_iterator it;
-        for (it = custom_headers.begin();
-             it != custom_headers.end();
-             ++it) {
-            std::string header = it->first + ": " + it->second;
+        for ( const auto & el : custom_headers ) {
+            std::string header { el.first };
+           header += ": ";
+           header += el.second;
             MIL << "Added custom header -> " << header << endl;
-            curl->settings().addHeader(header);
+            curl->settings().addHeader( std::move(header) );
         }
         _handler = curl;
     }
@@ -337,13 +336,13 @@ MediaAccess::release( const std::string & ejectDev )
 // filename is interpreted relative to the attached url
 // and a path prefix is preserved to destination
 void
-MediaAccess::provideFile( const Pathname & filename ) const
+MediaAccess::provideFile(const Pathname & filename , const ByteCount &expectedFileSize) const
 {
   if ( !_handler ) {
     ZYPP_THROW(MediaNotOpenException("provideFile(" + filename.asString() + ")"));
   }
 
-  _handler->provideFile( filename );
+  _handler->provideFile( filename, expectedFileSize );
 }
 
 void
@@ -470,7 +469,7 @@ void MediaAccess::getFile( const Url &from, const Pathname &to )
   try {
     media.open( u );
     media.attach();
-    media._handler->provideFileCopy( base, to );
+    media._handler->provideFileCopy( base, to, 0 );
     media.release();
   }
   catch (const MediaException & excpt_r)