summaryrefslogtreecommitdiffstats
path: root/rbutil/rbutilqt/base/httpget.cpp
AgeCommit message (Collapse)AuthorFilesLines
2020-11-07rbutil: Modernize HttpGet implementation.Dominik Riebeling1-20/+24
- Change signal-slot connections to new style, and fix renamed signal for Qt6. - Make more use of RAII. Change-Id: I14e52eb6bfdbb89bccafb33e4988af25b5d82713
2020-08-06rbutil: Fix deprecation warnings.Dominik Riebeling1-1/+1
Change-Id: Ia7e24a5fee2b6e858abcec318d13775ad23b4469
2016-01-17Fix building with Qt 4.7.Dominik Riebeling1-1/+1
QUrl::isLocalFile() is available starting with Qt 4.8. We can safely check for a file:// url instead. Qt 4.8 dropped support for OS X 10.4 / 10.5. Since we're still supporting those we need to keep using Qt 4.7 on OS X. We might want to consider requiring at least 10.6 on OS X with the next major release of Rockbox Utility. Change-Id: I18998fe3c7a38773479bc7a1c32ca6e4966359e9
2015-12-18Add documentation to HttpGet and remove unnecessary return value.Dominik Riebeling1-5/+32
HttpGet::getFile() always returns the same value. Remove the return value since it isn't necessary. Add some missing function documentation comments. Change-Id: I1cee242211272a996437b10dbc8de791b3fc3d67
2015-12-18Add support file:// URLs in HttpGet.Dominik Riebeling1-2/+4
QNetworkAccessManager can handle file:// URLs without additional work. Make HttpGet aware of that so you can now also use it to retrieve file:// URLs. Add a unit test for it as well. Change-Id: If64b57453460b70bca9e5b0c725bb78344617bcd
2013-11-04Use cutelogger for Rockbox Utility internal trace.Dominik Riebeling1-10/+10
Change tracing from qDebug() to use cutelogger, which is available under the LGPL2.1. This allows to automatically add filename and line number to the log, and also provides multiple log levels. Change-Id: I5dbdaf902ba54ea99f07ae10a07467c52fdac910
2013-01-27Rewrite HttpGet based on QNetworkAccessManager.Dominik Riebeling1-328/+116
HttpGet used to use QHttp which has been deprecated since a while and has been removed from Qt5. Rewrite the class based on QNetworkAccessManager which is the recommended way these days. Change-Id: I4902309c433a85ec18e157ef3a9f5e60fd0f4b1f
2013-01-22Remove support for RFC850 timestamps.Dominik Riebeling1-3/+1
RFC850 timeformat isn't y2k compliant. Furthermore, parsing turned out to be broken and it doesn't seem supporting the format is necessary anyway. Change-Id: I062e636a9e016ff1ac49d2a55f00adb1af182576
2013-01-22Avoid unnecessary HEAD request on uncached file.Dominik Riebeling1-27/+27
If a file is not available in the cache immediately sent a GET request. Using a HEAD request to retrieve the file timestamp on the server is not necessary and only creates an unnecessary network request. Change-Id: I358507dcc0c6b837ff47e5fd710b5262d03cb7b0
2013-01-13Remove Rockbox Utility Offline Mode.Dominik Riebeling1-3/+1
Offline Mode was intended to allow performing an installation without network access. However, to get the required files cached the same installation has to be performed with network access, which is a rather strange prerequisite. A better way would be a way to direct Rockbox Utility to some local "repository" that holds the required files. Furthermore, Offline Mode hasn't been tested since long and is likely to be broken since the caching mechanism has been extended. For now remove this functionality. As far as I know it's been rarely used (if at all) anyway. Change-Id: Ib2af4892708e0440bd0a7940c131f04182ddb39a
2013-01-13Remove HttpGet::error() function.Dominik Riebeling1-9/+0
This function returns an internal enum value of QHttp (which is also deprecated). It was only used for showing an error to the user / showing it in the system trace. Since it is an enum value it doesn't have much value. Log / show the error string instead. Change-Id: I54b9b6026969f8108f779b02a04477f0ad9201ab
2011-10-19Remove svn keyword lines from sources.Dominik Riebeling1-1/+0
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30806 a1c6a512-1295-4272-9138-f99709370657
2010-01-20Make parsing the server date locale independent also for asctime and RFC850 ↵Dominik Riebeling1-2/+2
representation. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24302 a1c6a512-1295-4272-9138-f99709370657
2009-12-15Use QLocale::toDateTime() for parsing the date instead of ↵Dominik Riebeling1-1/+1
QDateTime::fromString(). Fixes server timestamps not parsed correctly on systems with a non-english locale. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24017 a1c6a512-1295-4272-9138-f99709370657
2009-10-14Add cache index file to HttpGet class to maintain a list of hash - file ↵Dominik Riebeling1-0/+18
origin mappings. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23174 a1c6a512-1295-4272-9138-f99709370657
2009-09-19rbutil: dont output a error if rbutil follows a http redirect.Dominik Wenger1-4/+6
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22739 a1c6a512-1295-4272-9138-f99709370657
2009-05-19RFC2616 requires requests made to proxies to use the absoluteURI form while ↵Dominik Riebeling1-6/+21
HTTP/1.1 clients shall only create it when sending a request to a proxy. Fixes proxy support not working correctly (most noticably on theme installation). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20992 a1c6a512-1295-4272-9138-f99709370657
2009-04-17Simplify a debug output case and fix a gcc warning (as reported in FS#10124, ↵Dominik Riebeling1-4/+5
only appears on new gcc versions). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20725 a1c6a512-1295-4272-9138-f99709370657
2009-03-22Don't connect the headerFinished slot during each get. Fixes the header ↵Dominik Riebeling1-5/+9
result getting evaluated more than once if a HttpGet object is reused. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20447 a1c6a512-1295-4272-9138-f99709370657
2009-03-21Cleanup HttpGet debugging output: make it somewhat more silent and ↵Dominik Riebeling1-30/+25
streamline the messages in general. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20438 a1c6a512-1295-4272-9138-f99709370657
2009-03-21Don't ignore errors when finishing a HTTP request for cached request as that ↵Dominik Riebeling1-5/+1
is already done. Fixes a wrong status reported when an error occured. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20435 a1c6a512-1295-4272-9138-f99709370657
2009-03-21HttpGet: if downloaded data should be written to output buffer make sure the ↵Dominik Riebeling1-0/+5
buffer empty. This prevents old data available to the caller if a HttpGet object is reused and the new request fails. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20432 a1c6a512-1295-4272-9138-f99709370657
2009-03-08Some HttpGet cleanup: use references when setting options.Dominik Riebeling1-1/+1
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20232 a1c6a512-1295-4272-9138-f99709370657
2008-10-12Separate basic functionality from GUI parts by moving it into a separate ↵Dominik Riebeling1-0/+413
folder. Some files still need to get cleaned up prior moving them too. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18788 a1c6a512-1295-4272-9138-f99709370657