From 67807423f505381d025be890918180b15e3ecda2 Mon Sep 17 00:00:00 2001 From: DongHun Kwak Date: Mon, 2 Sep 2019 16:16:14 +0900 Subject: [PATCH] Imported Upstream version 17.6.2 --- VERSION.cmake | 4 ++-- package/libzypp.changes | 8 ++++++++ zypp/media/MediaMultiCurl.cc | 13 +++++++++---- 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/VERSION.cmake b/VERSION.cmake index 306b4ac..f652d7a 100644 --- a/VERSION.cmake +++ b/VERSION.cmake @@ -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) #======= diff --git a/package/libzypp.changes b/package/libzypp.changes index f12e438..2e3f85c 100644 --- a/package/libzypp.changes +++ b/package/libzypp.changes @@ -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 diff --git a/zypp/media/MediaMultiCurl.cc b/zypp/media/MediaMultiCurl.cc index f01dabe..670a4f3 100644 --- a/zypp/media/MediaMultiCurl.cc +++ b/zypp/media/MediaMultiCurl.cc @@ -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; -- 2.7.4