Imported Upstream version 17.6.2 upstream/17.6.2
authorDongHun Kwak <dh0128.kwak@samsung.com>
Mon, 2 Sep 2019 07:16:14 +0000 (16:16 +0900)
committerDongHun Kwak <dh0128.kwak@samsung.com>
Mon, 2 Sep 2019 07:16:14 +0000 (16:16 +0900)
VERSION.cmake
package/libzypp.changes
zypp/media/MediaMultiCurl.cc

index 306b4ac..f652d7a 100644 (file)
@@ -61,8 +61,8 @@
 SET(LIBZYPP_MAJOR "17")
 SET(LIBZYPP_COMPATMINOR "2")
 SET(LIBZYPP_MINOR "6")
-SET(LIBZYPP_PATCH "1")
+SET(LIBZYPP_PATCH "2")
 #
-# LAST RELEASED: 17.6.1 (2)
+# LAST RELEASED: 17.6.2 (2)
 # (The number in parenthesis is LIBZYPP_COMPATMINOR)
 #=======
index f12e438..2e3f85c 100644 (file)
@@ -1,4 +1,12 @@
 -------------------------------------------------------------------
+Tue Aug 21 18:46:35 CEST 2018 - ma@suse.de
+
+- fixup! Add filesize check for downloads with known size (bsc#408814)
+  Fix detetction of metalink downloads and prevent aborting if
+  a metalink file is larger than the expected data file.
+- version 17.6.2 (2)
+
+-------------------------------------------------------------------
 Fri Aug 17 14:52:14 CEST 2018 - ma@suse.de
 
 - Adapt to changes in libgpgme11-11.1.0 breaking the signature
index f01dabe..670a4f3 100644 (file)
@@ -1249,7 +1249,15 @@ int MediaMultiCurl::progressCallback( void *clientp, double dltotal, double dlno
   if (!_curl)
     return MediaCurl::aliveCallback(clientp, dltotal, dlnow, ultotal, ulnow);
 
-
+  // bsc#408814: Don't report any sizes before we don't have data on disk. Data reported
+  // due to redirection etc. are not interesting, but may disturb filesize checks.
+  FILE *fp = 0;
+  if ( curl_easy_getinfo( _curl, CURLINFO_PRIVATE, &fp ) != CURLE_OK || !fp )
+    return MediaCurl::aliveCallback( clientp, dltotal, dlnow, ultotal, ulnow );
+  if ( ftell( fp ) == 0 )
+    return MediaCurl::aliveCallback( clientp, dltotal, 0.0, ultotal, ulnow );
+
+  // (no longer needed due to the filesize check above?)
   // work around curl bug that gives us old data
   long httpReturnCode = 0;
   if (curl_easy_getinfo(_curl, CURLINFO_RESPONSE_CODE, &httpReturnCode ) != CURLE_OK || httpReturnCode == 0)
@@ -1270,9 +1278,6 @@ int MediaMultiCurl::progressCallback( void *clientp, double dltotal, double dlno
     }
   if (!ismetalink)
     {
-      FILE *fp = 0;
-      if (curl_easy_getinfo(_curl, CURLINFO_PRIVATE, &fp) != CURLE_OK || !fp)
-       return MediaCurl::aliveCallback(clientp, dltotal, dlnow, ultotal, ulnow);
       fflush(fp);
       ismetalink = looks_like_metalink_fd(fileno(fp));
       DBG << "looks_like_metalink_fd: " << ismetalink << endl;