1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2025-07-30 18:34:23 +02:00

Added redirect loop check

This commit is contained in:
2017-01-16 21:45:27 +01:00
parent 1a29ab6304
commit 0e356d0222
2 changed files with 43 additions and 11 deletions

View File

@ -39,11 +39,28 @@ private slots:
void downloadFinished(QNetworkReply *reply);
private:
class Redirect
{
public:
Redirect() : _level(0) {}
Redirect(const QUrl &origin, int level) :
_origin(origin), _level(level) {}
const QUrl &origin() const {return _origin;}
int level() const {return _level;}
bool isNull() const {return (_level == 0);}
private:
QUrl _origin;
int _level;
};
Downloader();
Downloader(Downloader const&);
void operator=(Downloader const&);
bool doDownload(const Download &dl, const QUrl &origin = QUrl());
bool doDownload(const Download &dl, const Redirect &redirect = Redirect());
bool saveToDisk(const QString &filename, QIODevice *data);
QNetworkAccessManager _manager;