summaryrefslogtreecommitdiffstats
path: root/src/libs/kdtools/filedownloader.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Disable http2 protocolKatja Marttila2023-09-251-0/+1
| | | | | | | | | | | | By default, installer build with Qt6 enables http2 protocol. Disabling http2 protocol for now so that the behavior is the same when building with Qt5. Currently some cdn's response with "GOAWAY received, cannot start a request" -messages, the problem needs to be solved first before http2 protocol can be enabled. Change-Id: I0cad5fef4fe299d21ee66489583cd4411f6bd7c8 Reviewed-by: Iikka Eklund <iikka.eklund@qt.io> Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Adapt to QNetworkAccessManager redirect changes in Qt 6Arttu Tarkiainen2023-09-211-1/+5
| | | | | | | | | | | | Redirect policy has changed from manual to "QNetworkRequest::NoLessSafe RedirectPolicy" in Qt 6, which broke the redirects for Downloader class. As we do manual redirect handling, change the attribute for the requests to "QNetworkRequest::ManualRedirectPolicy" in Downloader and HttpDownloader classes. Task-number: QTIFW-3163 Change-Id: Ic86c34fe404a99e6d2068109d9afe6753c5e76cb Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Fix deprecated QCryptographichHash function callKatja Marttila2023-09-051-11/+3
| | | | | | | | | | Function QCryptographichHash::addData(const char *data, qsizetype length) has been deprecated since 6.x. Task-number: QTIFW-3077 Change-Id: I5c36d52d7e8fe4c1724072b33c1ff19e9f2fb846 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Fix deprecated QMessageBox::setButtonText() callKatja Marttila2023-06-151-1/+1
| | | | | | Task-number: QTIFW-3077 Change-Id: Id8b1947efbc6a2cdf33e080f01024170820617b9 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Fix missing include from header fileKatja Marttila2023-05-291-4/+0
| | | | | Change-Id: Iea4f51eca7d2029b6ff818f06d0487b9cd313b69 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Adapt to QNetworkAccessManager differences in Qt6Christian Stenger2023-04-271-6/+30
| | | | | | Task-number: QTIFW-1829 Change-Id: Ieded786fc608e10fd9068e8f79227e43c5ff3717 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* HttpDownloader: fix nullptr dereferenceArttu Tarkiainen2023-04-241-1/+1
| | | | | | | | | The HttpDownloader::Private::shutdown() deletes and sets the pointer to the destination file device to null, and the code tried access its members still afterwards. Changed the order of the calls to fix. Change-Id: I494edfa4af1e112119475c2999ad78e07800194e Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Add more verbose when archive download failsKatja Marttila2023-03-231-9/+24
| | | | | | | | | | | Occasionally installer might throw "Cannot download archive" messages for unknown reason. Adding more detailed verbose to catch the root cause. Also trying to create a parent folder when starting to download an reopening the file just in case. Task-number: QTBUG-110684 Change-Id: I8bc4fc31371043e1f9eae8f7d9779ab434221ff3 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Add total remaining download time estimation for archivesArttu Tarkiainen2021-08-191-0/+8
| | | | | | Task-number: QTIFW-2207 Change-Id: Ia4ccc5f71a489a1663cdbf66a69f442366e65fc9 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Cppcheck: Initialize uninitialized member variablesKatja Marttila2021-03-031-1/+1
| | | | | Change-Id: I38c52e2412f50e0aba41876112a66956b9de2920 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Restructure logging utilitiesArttu Tarkiainen2021-02-041-1/+3
| | | | | | | | | | | | | | Create a singleton-pattern class as an encapsulation unit for holding and altering the state of debug printing attributes. Move related code from various places under a single umbrella header file for logging utilities, with some minor stylistic changes & cleanup. This acts as a preparatory change for providing non-blocking headless CLI runs when there is no TTY attached - that will be fixed in a follow-up change. Change-Id: Ib7f72cf75362c3ea6713058e92eda997d6df55c3 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Merge remote-tracking branch 'origin/4.0' into masterKatja Marttila2020-11-241-5/+5
|\ | | | | | | Change-Id: If5205ff6ef2c8989520e24d41595c04d5920d207
| * Fix segfault on file download error properlyMartin Kampas2020-11-041-5/+5
| | | | | | | | | | | | | | | | | | | | | | The onError function destroys instances required later during the error message construction. This improves over the fix introduced with commit 6a93f37440a3dcc72bb5e496dac90a8f95d63eab. Change-Id: I54c4064eb225d3e3913ce5073706a5ce5717d234 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* | CLI: Print extra archive information with higher verbosity levelArttu Tarkiainen2020-11-051-1/+4
|/ | | | | | | | | | Also rework verbosity level handling to use predefined and range constrained enumeration list values. Task-number: QTIFW-1998 Change-Id: Iaf15ca638411e6842d3d502c4d7ff11d28d06658 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Doc: Fix documentation warningsTopi Reinio2020-09-161-20/+20
| | | | | | | | | These changes fix many of the documentation warnings when building with a recent version of (Clang-integrated) QDoc. Change-Id: I5714635a25707cd7ab7bec209fa043a95f0b9832 Reviewed-by: Katja Marttila <katja.marttila@qt.io> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* Add verbose levels and cleanup log categoriesKatja Marttila2020-08-241-2/+2
| | | | | | | | | Setting several verbose switches enables more logging and performs component checking. Also cleanup some logging categories and unify the rules. Task-number: QTIFW-1914 Change-Id: I9195f4bb02affaa87e66cf9023a3512e65e0645b Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Add possibility to auto accept or reject IFW queries from CLIKatja Marttila2020-04-151-1/+1
| | | | | | | | | | | | | | | Added new command line switches accept-messages and reject-messages to automatically accept or reject installer message queries. Also removed Retry option in CLI when archive or hash download failed. With GUI it is possible to try Retry in case either is missing but without GUI Retry will cause infinite loop. Added unit tests for accept-messages and reject-messages using CLI. Task-number: QTIFW-1736 Change-Id: Ie87d2d8157be772b790415c96e5b94fc882d4be7 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* CLI: decrease the amount of default debug printsKatja Marttila2020-02-201-1/+1
| | | | | | | | | | Debug prints can be suppressed or extended with logging rules. Make the default usage so that only relevant information will be shown to user, such as uninstall/install progress, server information, warning messages and package name, version and displayname. Change-Id: I09be754a36dd97530d75cdea3edb5fc77e67a856 Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* Use of QLoggingCategoryKatja Marttila2020-02-131-1/+1
| | | | | | | | The change enables easier filtering of log messages Change-Id: I769f7c163e20f34c37fa0fe2b0729867ffca5bcb Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io> Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* Documentation fixesKatja Marttila2019-12-171-5/+15
| | | | | Change-Id: Ibffb5470d374c8d612791f48c951deddd00f3121 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* Fix tmp file removalKatja Marttila2019-01-221-14/+0
| | | | | | | | | | | | | | | Tmp files were not removed when all or these were met: 1. Using Linux 2. Installing to a folder which needs authorization 3. Installing a component which has no metadata Tmp 'remoterepo-XXXXXX' is created before acquiring authorization. In previous version if above list was met, a tmp folder was created inside remoterepo-XXXXX after authorization leading to permission error when deleting the folder. Task-id: QTIFW-1268 Change-Id: I937fe3ce13440c817d1264c80ad060dfc966e456 Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* Decrease metadata dowload amountKatja Marttila2018-06-011-0/+13
| | | | | | | | | | If there are no Script, Translations, Licenses nor UserInterfaces -tags in Updates.xml, there is no metadata. In such case, do not download the empty metadata to decrease the time used in downloading metadata. Task-number: QTIFW-975 Change-Id: I1b81a07b5ad43677e190fb058ece8b06382d215b Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* Fix infinite wait if downloadable package is missingKatja Marttila2018-03-161-1/+1
| | | | | | | | | | Instead of waiting for a package that is missing, show error message and abort installation Task-number: QTIFW-1064 Change-Id: I021e7ece9e4020a85380318185cdb6a424dc26fa Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io> Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* Avoid another null pointer dereferenceVille Voutilainen2017-12-121-1/+1
| | | | | | Task-number: QTIFW-1064 Change-Id: I053071292ef8786f6d829b57e45091e881ce3d4d Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Do not retry a download immediately after an errorVille Voutilainen2017-12-121-2/+1
| | | | | Change-Id: I1751b5274b3f2f6c69482d98c8beb2c1ef77ae70 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Fix crash when httpReadyRead is signaled after shutdownVille Voutilainen2017-12-111-0/+2
| | | | | | Task-number: QTIFW-1064 Change-Id: Id300f5838fb5f7e72a5e77415ac1832faa2d7c84 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Implement package download resumeVille Voutilainen2017-11-031-23/+209
| | | | | | | | | This doesn't implement a resume for checksum files and resource files; there's no pressing need for those. Task-number: QTIFW-5 Change-Id: Id14a3d9b46f2e16a15f52ae536d060d505b2f4f0 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Merge remote-tracking branch 'origin/2.0'Katja Marttila2017-01-301-16/+11
| | | | | | | | | | | | | | | | | | | | | | | Conflicts: Changelog dist/config/config.xml dist/packages/org.qtproject.ifw.binaries/meta/package.xml dist/packages/org.qtproject.ifw/meta/package.xml installerfw.pri src/libs/installer/lib7z_create.h src/libs/kdtools/kdgenericfactory.cpp src/libs/kdtools/kdgenericfactory.h src/libs/kdtools/kdupdaterapplication.cpp src/libs/kdtools/kdupdaterapplication.h src/libs/kdtools/kdupdaterupdatesourcesinfo.cpp src/libs/kdtools/kdupdaterupdatesourcesinfo.h src/libs/kdtools/localpackagehub.cpp src/libs/kdtools/localpackagehub.h src/libs/kdtools/updatefinder.cpp src/libs/kdtools/updatefinder.h tools/binarycreator/resources/mkdmg.sh Change-Id: Iab2513f549832d2e750e77131c673457ab265af4
* Add a logging category and debug for http downloadKatja Marttila2016-04-071-1/+16
| | | | | | | | | | | Sometimes installing fails due to a problem in server. Since downloading can happen from mirror, it is hard to detect where the problem is. Print the IP address where the download actually happens to ease the problem solving. Change-Id: I31e15c2b1926745c251093cd1663d1ca1c65bff6 Task-number: QTIFW-813 Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
* Merge remote-tracking branch 'origin/2.0'Iikka Eklund2016-01-201-3/+2
| | | | | | | | | | | | | | Conflicts: installerfw.pri src/libs/kdtools/kdgenericfactory.cpp src/libs/kdtools/kdgenericfactory.h src/libs/kdtools/kdupdaterapplication.cpp src/libs/kdtools/kdupdaterapplication.h src/libs/kdtools/kdupdaterupdatesourcesinfo.cpp src/libs/kdtools/kdupdaterupdatesourcesinfo.h sync.profile Change-Id: Ifdc8b065f89b7e241bd3788ed79768e21888161f
* Rename files. Remove {kd} prefix. Remove {kdupdater} prefix.Karsten Heimrich2015-07-141-0/+1407
Change-Id: I88c93cab718f4659296d5f7f562beefd747a366f Reviewed-by: Jarek Kobus <jaroslaw.kobus@theqtcompany.com>