Add support for timing the download out

The time out is 30 seconds from the start of the request or from the
last time we got any data from the server.

Signed-off-by: Thiago Macieira <thiago@macieira.org>
This commit is contained in:
Thiago Macieira 2013-11-14 17:47:35 -08:00
parent ab1b314a84
commit 919c7045b7
2 changed files with 18 additions and 0 deletions

View file

@ -3,6 +3,7 @@
#include <QDialog>
#include <QNetworkReply>
#include <QTimer>
#include <libxml/tree.h>
#include "ui_webservices.h"
@ -23,6 +24,7 @@ private slots:
virtual void startDownload() = 0;
virtual void startUpload() = 0;
virtual void buttonClicked(QAbstractButton* button) = 0;
virtual void downloadTimedOut();
protected slots:
void updateProgress(qint64 current, qint64 total);
@ -33,6 +35,7 @@ protected:
Ui::WebServices ui;
QNetworkReply *reply;
QTimer timeout;
QByteArray downloadedData;
};